auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void init(Properties config) throws IOException { if(config.getProperty(IS_ENABLED_PROPERTY,"false").equalsIgnoreCase("true")){ isEnabled=true; threeLevelCache.put(LOCAL_SERVICE, new HashMap<String , Map<String, Metric>>()); threeLevelCache.put(MIRROR_SERVICE, new HashMap<String , Map<String, Metric>>()); threeLevelCache.put(MERGED_SERVICE, new HashMap<String , Map<String, Metric>>()); threeLevelCache.put(PURGER_SERVICE, new HashMap<String , Map<String, Metric>>()); registry= new MetricRegistry(); }else{ return; } timeBetweenPolls = Integer.parseInt(config.getProperty(REPORTING_PERIOD , "10")); slidingwindowtime = Integer.parseInt(config.getProperty(REPORTING_PERIOD, "10")); if (config.getProperty(GANGLIA, "false").equalsIgnoreCase("true")) { final GMetric ganglia = new GMetric(config.getProperty(GANGLIA_SERVERNAME), Integer.parseInt(config.getProperty(GANGLIA_PORT)), UDPAddressingMode.MULTICAST, 1); GangliaReporter reporter = GangliaReporter.forRegistry(registry) .convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS) .build(ganglia); reporterMap.put(GANGLIA, reporter); LOG.info("Ganglia Reporter registered"); } if (config.getProperty(CONSOLE, "false").equalsIgnoreCase("true")) { ConsoleReporter reporter = ConsoleReporter.forRegistry(registry) .convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS) .build(); reporterMap.put(CONSOLE, reporter); LOG.info("Console reporter registered"); } if (reporterMap.size() == 0) { LOG.warn("No reporter registered"); } }

Target:
public static void init(Properties config) throws IOException { if(config.getProperty(IS_ENABLED_PROPERTY,"false").equalsIgnoreCase("true")){ isEnabled=true; threeLevelCache.put(LOCAL_SERVICE, new HashMap<String , Map<String, Metric>>()); threeLevelCache.put(MIRROR_SERVICE, new HashMap<String , Map<String, Metric>>()); threeLevelCache.put(MERGED_SERVICE, new HashMap<String , Map<String, Metric>>()); threeLevelCache.put(PURGER_SERVICE, new HashMap<String , Map<String, Metric>>()); registry= new MetricRegistry(); }else{ return; } timeBetweenPolls = Integer.parseInt(config.getProperty(REPORTING_PERIOD , "10")); if (config.getProperty(GANGLIA, "false").equalsIgnoreCase("true")) { final GMetric ganglia = new GMetric(config.getProperty(GANGLIA_SERVERNAME), Integer.parseInt(config.getProperty(GANGLIA_PORT)), UDPAddressingMode.MULTICAST, 1); GangliaReporter reporter = GangliaReporter.forRegistry(registry) .convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS) .build(ganglia); reporterMap.put(GANGLIA, reporter); LOG.info("Ganglia Reporter registered"); } if (config.getProperty(CONSOLE, "false").equalsIgnoreCase("true")) { ConsoleReporter reporter = ConsoleReporter.forRegistry(registry) .convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS) .build(); reporterMap.put(CONSOLE, reporter); LOG.info("Console reporter registered"); } if (reporterMap.size() == 0) { LOG.warn("No reporter registered"); } }
Source:
public static Builder overriding(ExecutableElement method) { checkNotNull(method, "method == null"); if (method.getEnclosingElement().getModifiers().contains(Modifier.FINAL)) { throw new IllegalArgumentException("Cannot override method on final class."); } Set<Modifier> modifiers = method.getModifiers(); if (modifiers.contains(Modifier.PRIVATE) || modifiers.contains(Modifier.FINAL) || modifiers.contains(Modifier.STATIC)) { throw new IllegalArgumentException("cannot override method with modifiers: " + modifiers); } String methodName = method.getSimpleName().toString(); MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(methodName); methodBuilder.addAnnotation(Override.class); modifiers = new LinkedHashSet<>(modifiers); modifiers.remove(Modifier.ABSTRACT); modifiers.remove(Util.DEFAULT); methodBuilder.addModifiers(modifiers); for (TypeParameterElement typeParameterElement : method.getTypeParameters()) { TypeVariable var = (TypeVariable) typeParameterElement.asType(); methodBuilder.addTypeVariable(TypeVariableName.get(var)); } methodBuilder.returns(TypeName.get(method.getReturnType())); methodBuilder.addParameters(ParameterSpec.parametersOf(method)); methodBuilder.varargs(method.isVarArgs()); for (TypeMirror thrownType : method.getThrownTypes()) { methodBuilder.addException(TypeName.get(thrownType)); } return methodBuilder; }

Target:
public static Builder overriding(ExecutableElement method) { checkNotNull(method, "method == null"); Element enclosingClass = method.getEnclosingElement(); if (enclosingClass.getModifiers().contains(Modifier.FINAL)) { throw new IllegalArgumentException("Cannot override method on final class " + enclosingClass); } Set<Modifier> modifiers = method.getModifiers(); if (modifiers.contains(Modifier.PRIVATE) || modifiers.contains(Modifier.FINAL) || modifiers.contains(Modifier.STATIC)) { throw new IllegalArgumentException("cannot override method with modifiers: " + modifiers); } String methodName = method.getSimpleName().toString(); MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(methodName); methodBuilder.addAnnotation(Override.class); modifiers = new LinkedHashSet<>(modifiers); modifiers.remove(Modifier.ABSTRACT); modifiers.remove(Util.DEFAULT); methodBuilder.addModifiers(modifiers); for (TypeParameterElement typeParameterElement : method.getTypeParameters()) { TypeVariable var = (TypeVariable) typeParameterElement.asType(); methodBuilder.addTypeVariable(TypeVariableName.get(var)); } methodBuilder.returns(TypeName.get(method.getReturnType())); methodBuilder.addParameters(ParameterSpec.parametersOf(method)); methodBuilder.varargs(method.isVarArgs()); for (TypeMirror thrownType : method.getThrownTypes()) { methodBuilder.addException(TypeName.get(thrownType)); } return methodBuilder; }
Source:
public void testValidateCodeWithoutCodeOrCodingOrCodeableConcept() throws Exception { Parameters inParams = new Parameters(); inParams.addParameter().setName("url").setValue(new UriType(CS_ACMS_URL)); inParams.addParameter().setName("display").setValue(new StringType("Systolic blood pressure.inspiration - expiration")); try { myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute(); } catch (InvalidRequestException e) { assertEquals("HTTP 400 Bad Request: No code, coding, or codeableConcept provided to validate.",e.getMessage()); } }

Target:
public void testValidateCodeWithoutCodeOrCodingOrCodeableConcept() throws Exception { Parameters inParams = new Parameters(); inParams.addParameter().setName("url").setValue(new UriType(CS_ACMS_URL)); inParams.addParameter().setName("display").setValue(new StringType("Systolic blood pressure.inspiration - expiration")); try { myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute(); fail(); } catch (InvalidRequestException e) { assertEquals("HTTP 400 Bad Request: No code, coding, or codeableConcept provided to validate.",e.getMessage()); } }
Source:
public static Lens<IInventory, ItemStack> getLens(Fabric<IInventory> fabric, net.minecraft.inventory.Container container, SlotCollection slots) { System.out.print("### getLens for: " + container.getClass().getName() + " ###\n"); if (container instanceof InventoryAdapter) { Lens lens = ((InventoryAdapter) container).getRootLens(); if (lens != null) { System.out.print("Adapter found\n"); return lens; } } if (container instanceof LensProvider) { System.out.print("LensProvider found\n"); InventoryAdapter<IInventory, ItemStack> adapter; if (container instanceof InventoryAdapter) { adapter = ((InventoryAdapter) container); } else { adapter = new Adapter(MinecraftFabric.of(container)); } return ((LensProvider) container).getRootLens(null, adapter); } if (container.getInventory().size() == 0) { return null; } return generateLens(container, slots); }

Target:
public static Lens<IInventory, ItemStack> getLens(Fabric<IInventory> fabric, net.minecraft.inventory.Container container, SlotCollection slots) { if (container instanceof InventoryAdapter) { Lens lens = ((InventoryAdapter) container).getRootLens(); if (lens != null) { return lens; } } if (container instanceof LensProvider) { InventoryAdapter<IInventory, ItemStack> adapter; if (container instanceof InventoryAdapter) { adapter = ((InventoryAdapter) container); } else { adapter = new Adapter(MinecraftFabric.of(container)); } return ((LensProvider) container).getRootLens(fabric, adapter); } if (container.getInventory().size() == 0) { return null; } return generateLens(container, slots); }
Source:
private String getLocalizedMessage(final Locale locale) { final String pattern = this.getMessagePattern(locale, this.code); if ((this.code == null) || KuraErrorCode.INTERNAL_ERROR.equals(this.code)) { if ((this.arguments != null) && (this.arguments.length > 1)) { final StringBuilder sbAllArgs = new StringBuilder(); for (final Object arg : this.arguments) { sbAllArgs.append(" - "); sbAllArgs.append(arg); } this.arguments = new Object[] { sbAllArgs.toString() }; } } return MessageFormat.format(pattern, this.arguments); }

Target:
private String getLocalizedMessage(final Locale locale) { final String pattern = getMessagePattern(locale, this.code); if ((this.code == null) || KuraErrorCode.INTERNAL_ERROR.equals(this.code)) { if ((this.arguments != null) && (this.arguments.length > 1)) { final StringBuilder sbAllArgs = new StringBuilder(); for (final Object arg : this.arguments) { sbAllArgs.append(" - "); sbAllArgs.append(arg); } this.arguments = new Object[] { sbAllArgs.toString() }; } } return MessageFormat.format(pattern, this.arguments); }
Source:
public void prepareTest() { driver.manage().timeouts().pageLoadTimeout(100, TimeUnit.SECONDS); }

Target:
public void prepareTest() { driver.manage().timeouts().pageLoadTimeout(100, TimeUnit.SECONDS); wikiURL = urlBuilder.getUrlForWiki(MercuryWikis.MERCURY_CC); }
Source:
public void setServerContent(Map<String, String> serverContent) { this.serverContent = serverContent; }

Target:
public void setServerContent(Map<String, String> serverContent) { Preconditions.checkNotNull(serverContent); this.serverContent = serverContent; }
Source:
public IborIndexRates iborIndexRates(IborIndex index) { Curve curve = marketData.getValue(IborIndexCurveKey.of(index)); if (curve == null) { throw new IllegalArgumentException("Unable to find forward curve: " + index); } return IborIndexRates.of(index, getValuationDate(), curve, timeSeries(index)); }

Target:
public IborIndexRates iborIndexRates(IborIndex index) { Curve curve = marketData.getValue(IborIndexCurveKey.of(index)); return IborIndexRates.of(index, getValuationDate(), curve, timeSeries(index)); }
Source:
public String getStat() { ProducerStats stats = ProducerStatsRegistry.getProducerStats(clientId); ProducerTopicStats topicStats = ProducerTopicStatsRegistry.getProducerTopicStats(clientId); StringBuilder sb = new StringBuilder(); sb.append("resend rate: ").append(stats.resendRate().count()).append('\n'); sb.append("serialization error rate: " ).append(stats.serializationErrorRate().count()).append('\n'); sb.append("failed send rate: ").append(stats.failedSendRate().count()).append('\n'); sb.append("message rate: ").append(topicStats.getProducerAllTopicsStats().messageRate().count()).append('\n'); sb.append("byte rate: " ).append(topicStats.getProducerAllTopicsStats().byteRate().count()).append('\n'); sb.append("dropped message rate: " ).append(topicStats.getProducerAllTopicsStats().droppedMessageRate().count()).append('\n'); return sb.toString(); }

Target:
public String getStat() { Map<String,? extends Metric> metrics = producer.metrics(); StringBuilder sb = new StringBuilder(); for( Map.Entry<String,? extends Metric> e : metrics.entrySet() ){ sb.append("kafka.").append(e.getKey()).append(": ").append(e.getValue().value()).append('\n'); } sb.append("messages-in-queue4sink: ").append( this.queue4Sink.size() ).append('\n'); sb.append("failures: ").append( this.failureCount.get() ).append('\n'); return sb.toString(); }
Source:
public DbUser(DirectoryUser directoryUser) { externalId = directoryUser.getId(); domain = directoryUser.getDirectoryName(); namespace = directoryUser.getNamespace(); loginName = directoryUser.getPrincipal() != null ? directoryUser.getPrincipal() : directoryUser.getName(); this.setFirstName(directoryUser.getFirstName()); this.setLastName(lastName = directoryUser.getLastName()); this.setDepartment(directoryUser.getDepartment()); email = directoryUser.getEmail(); note = ""; groupNames = new HashSet<>(); for (DirectoryGroup directoryGroup : directoryUser.getGroups()) { groupNames.add(directoryGroup.getName()); } userOptions = new HashMap<>(); }

Target:
public DbUser(DirectoryUser directoryUser) { externalId = directoryUser.getId(); domain = directoryUser.getDirectoryName(); namespace = directoryUser.getNamespace(); loginName = directoryUser.getPrincipal() != null ? directoryUser.getPrincipal() : directoryUser.getName(); this.setFirstName(directoryUser.getFirstName()); this.setLastName(lastName = directoryUser.getLastName()); this.setDepartment(directoryUser.getDepartment()); email = directoryUser.getEmail(); note = ""; groupNames = new HashSet<>(); for (DirectoryGroup directoryGroup : directoryUser.getGroups()) { groupNames.add(directoryGroup.getName()); } userOptions = Collections.emptyMap(); }
Source:
private MBeanServer getMockMBeanServer() throws Exception { MBeanServer mbeanServer = mock(MBeanServer.class); Set<ObjectName> names = new HashSet<>(); names.add(new ObjectName("test1:type=test2")); when(mbeanServer.queryNames(any(ObjectName.class), any(QueryExp.class))).thenReturn(names); MBeanInfo mbeanInfo = mock(MBeanInfo.class); when(mbeanInfo.getClassName()).thenReturn("testClassName"); String[] attributeNames = new String[] {"intAttr", "nanAttr", "strAttr", "boolAttr"}; MBeanAttributeInfo[] attributeInfos = new MBeanAttributeInfo[attributeNames.length]; for (int i = 0; i < attributeInfos.length; i++) { attributeInfos[i] = new MBeanAttributeInfo(attributeNames[i], null, null, true, false, false); } when(mbeanInfo.getAttributes()).thenReturn(attributeInfos); when(mbeanServer.getMBeanInfo(any(ObjectName.class))).thenReturn(mbeanInfo); when(mbeanServer.getAttribute(any(ObjectName.class), eq("intAttr"))).thenReturn(3); when(mbeanServer.getAttribute(any(ObjectName.class), eq("nanAttr"))).thenReturn(Double.NaN); when(mbeanServer.getAttribute(any(ObjectName.class), eq("strAttr"))).thenReturn("aString"); when(mbeanServer.getAttribute(any(ObjectName.class), eq("boolAttr"))).thenReturn(true); return mbeanServer; }

Target:
private MBeanServer getMockMBeanServer() throws Exception { MBeanServer mbeanServer = mock(MBeanServer.class); Set<ObjectName> names = new HashSet<>(); names.add(new ObjectName("test1:type=test2")); when(mbeanServer.queryNames(any(ObjectName.class), any(QueryExp.class))).thenReturn(names); MBeanInfo mbeanInfo = mock(MBeanInfo.class); when(mbeanInfo.getClassName()).thenReturn("testClassName"); String[] attributeNames = new String[] {"intAttr", "nanAttr", "infinityAttr", "strAttr", "boolAttr"}; MBeanAttributeInfo[] attributeInfos = new MBeanAttributeInfo[attributeNames.length]; for (int i = 0; i < attributeInfos.length; i++) { attributeInfos[i] = new MBeanAttributeInfo(attributeNames[i], null, null, true, false, false); } when(mbeanInfo.getAttributes()).thenReturn(attributeInfos); when(mbeanServer.getMBeanInfo(any(ObjectName.class))).thenReturn(mbeanInfo); when(mbeanServer.getAttribute(any(ObjectName.class), eq("intAttr"))).thenReturn(3); when(mbeanServer.getAttribute(any(ObjectName.class), eq("nanAttr"))).thenReturn(Double.NaN); when(mbeanServer.getAttribute(any(ObjectName.class), eq("infinityAttr"))). thenReturn(Double.POSITIVE_INFINITY); when(mbeanServer.getAttribute(any(ObjectName.class), eq("strAttr"))).thenReturn("aString"); when(mbeanServer.getAttribute(any(ObjectName.class), eq("boolAttr"))).thenReturn(true); return mbeanServer; }
Source:
void setToolbarButtons(IActionBars bars, IPerspectiveDescriptor perspective) { enableAppearanceButtons(bars.getToolBarManager(), !simulationPerspective(perspective)); }

Target:
void setToolbarButtons(IActionBars bars, IPerspectiveDescriptor perspective) { enableEditingButtons(bars.getToolBarManager(), !relevantPerspective(perspective)); }
Source:
private void orderListByStartDate(List<TrialSummary> trialSummaryList, final String sortOrder) { if (StringUtil.isEmpty(sortOrder) || TrialResourceBrapi.DESCENDING.equalsIgnoreCase(sortOrder)) { Comparator desc = Collections.reverseOrder(getComparatorStartDate()); Collections.sort(trialSummaryList, desc); }else { Collections.sort(trialSummaryList, getComparatorStartDate()); } }

Target:
private void orderListByStartDate(List<TrialSummary> trialSummaryList, final String sortOrder) { if (StringUtil.isEmpty(sortOrder) || TrialResourceBrapi.ORDER_BY_DESCENDING.equalsIgnoreCase(sortOrder)) { Comparator desc = Collections.reverseOrder(TrialResourceBrapi.getComparatorStartDate()); Collections.sort(trialSummaryList, desc); } else { Collections.sort(trialSummaryList, TrialResourceBrapi.getComparatorStartDate()); } }
Source:
public void shouldCheckPage500WithParent(boolean expectedResult) { CustomPage.Type type = CustomPage.Type.ERROR_500; ; given(parent.isCustomPage(message, type)).willReturn(expectedResult); plugin.init(message, parent); boolean result = plugin.isPage500(message); assertThat(result, is(equalTo(expectedResult))); verify(parent).isCustomPage(message, type); }

Target:
public void shouldCheckPage500WithParent(boolean expectedResult) { CustomPage.Type type = CustomPage.Type.ERROR_500; given(parent.isCustomPage(message, type)).willReturn(expectedResult); plugin.init(message, parent); boolean result = plugin.isPage500(message); assertThat(result, is(equalTo(expectedResult))); verify(parent).isCustomPage(message, type); }
Source:
public void testSyncTaskWithSinglePartition() throws Exception { List<Integer> inputList = Arrays.asList(1, 2, 3, 4, 5); List<Integer> outputList = Arrays.asList(10, 20, 30, 40, 50); CollectionStreamSystem system = CollectionStreamSystem.create("test"); CollectionStream<Integer> input = CollectionStream.of("input", inputList).from(system); CollectionStream output = CollectionStream.empty("output").from(system); TestRunner .of(MyStreamTestTask.class) .addInputStream(input) .addOutputStream(output) .run(); Assert.assertThat(StreamUtils.getStreamState(output).get(0), IsIterableContainingInOrder.contains(outputList.toArray())); }

Target:
public void testSyncTaskWithSinglePartition() throws Exception { List<Integer> inputList = Arrays.asList(1, 2, 3, 4, 5); List<Integer> outputList = Arrays.asList(10, 20, 30, 40, 50); CollectionStream<Integer> input = CollectionStream.of("test", "input", inputList); CollectionStream output = CollectionStream.empty("test", "output"); TestRunner.of(MyStreamTestTask.class).addInputStream(input).addOutputStream(output).run(); Assert.assertThat(TestRunner.consumeStream(output, 1000).get(0), IsIterableContainingInOrder.contains(outputList.toArray())); }
Source:
public ExpressionTree CAST_EXPR() { return b.<ExpressionTree>nonterminal(PHPLexicalGrammar.CAST_TYPE).is( b.firstOf( f.castExpression( b.token(PHPPunctuator.LPARENTHESIS), b.firstOf( b.token(PHPKeyword.ARRAY), b.token(PHPKeyword.UNSET), b.token(PHPLexicalGrammar.INTEGER), b.token(PHPLexicalGrammar.INT), b.token(PHPLexicalGrammar.DOUBLE), b.token(PHPLexicalGrammar.FLOAT), b.token(PHPLexicalGrammar.STRING), b.token(PHPLexicalGrammar.OBJECT), b.token(PHPLexicalGrammar.BOOLEAN), b.token(PHPLexicalGrammar.BOOL), b.token(PHPLexicalGrammar.BINARY)), b.token(PHPPunctuator.RPARENTHESIS), UNARY_EXPR()), f.prefixedCastExpression( b.firstOf( b.token(PHPPunctuator.LOWER_BINARY_CAST_PREFIX), b.token(PHPPunctuator.UPPER_BINARY_CAST_PREFIX)), b.firstOf( STRING_LITERAL(), NOWDOC_STRING_LITERAL(), HEREDOC_STRING_LITERAL())))); }

Target:
public ExpressionTree CAST_EXPR() { return b.<ExpressionTree>nonterminal(PHPLexicalGrammar.CAST_TYPE).is( b.firstOf( f.castExpression( b.token(PHPPunctuator.LPARENTHESIS), b.firstOf( b.token(PHPKeyword.ARRAY), b.token(PHPKeyword.UNSET), b.token(PHPLexicalGrammar.INTEGER), b.token(PHPLexicalGrammar.INT), b.token(PHPLexicalGrammar.DOUBLE), b.token(PHPLexicalGrammar.FLOAT), b.token(PHPLexicalGrammar.STRING), b.token(PHPLexicalGrammar.OBJECT), b.token(PHPLexicalGrammar.BOOLEAN), b.token(PHPLexicalGrammar.BOOL), b.token(PHPLexicalGrammar.BINARY)), b.token(PHPPunctuator.RPARENTHESIS), UNARY_EXPR()), PREFIXED_BINARY_CAST())); }
Source:
public RecoverCmd() { super(CMD_RECOVER); opts.addOption("d", "delete_cookie", false, "Delete cookie node for the bookie."); }

Target:
public RecoverCmd() { super(CMD_RECOVER); opts.addOption("d", "deleteCookie", false, "Delete cookie node for the bookie."); }
Source:
@Before public void vars() { listener = StreamTaskListener.fromStdout(); ws = j.jenkins.getRootPath().child("ws"); launcher = j.jenkins.createLauncher(listener); }

Target:
@Before public void vars() throws IOException, InterruptedException { listener = StreamTaskListener.fromStdout(); ws = j.jenkins.getRootPath().child("ws"); launcher = j.jenkins.createLauncher(listener); Properties properties = System.getProperties(); String pathSeparator = properties.getProperty("path.separator"); String[] paths = System.getenv("PATH").split(pathSeparator); boolean powershellExists = false; String cmd = launcher.isUnix()?"powershell":"powershell.exe"; for (String p : paths) { File f = new File(p, cmd); if (f.exists()) { powershellExists = true; break; } } Assume.assumeTrue("This test should only run if powershell is available", powershellExists == true); if (powershellExists == true) { List<String> args = new ArrayList<>(Collections.singleton(cmd)); if (!launcher.isUnix()) { args.addAll(Arrays.asList("-ExecutionPolicy", "Bypass")); } args.add("$PSVersionTable.PSVersion.Major"); Launcher.ProcStarter ps = launcher.launch().cmds(args).quiet(true); ps.readStdout(); Proc proc = ps.start(); String psVersionStr = IOUtils.toString(proc.getStdout()); int psVersion; try { psVersion = Integer.parseInt(psVersionStr.trim()); } catch (NumberFormatException x) { throw new AssumptionViolatedException(psVersionStr, x); } Assume.assumeTrue("This test should only run if the powershell major version is at least 3", psVersion >= 3); } }
Source:
protected Class<?> findClass(String name) throws ClassNotFoundException { if (PluginManager.FAST_LOOKUP) { for (PluginWrapper pw : getTransitiveDependencies()) { try { Class<?> c = ClassLoaderReflectionToolkit._findLoadedClass(pw.classLoader, name); if (c!=null) return c; return ClassLoaderReflectionToolkit._findClass(pw.classLoader, name); } catch (ClassNotFoundException e) { } } } else { for (Dependency dep : dependencies) { PluginWrapper p = pluginManager.getPlugin(dep.shortName); if(p!=null) try { return p.classLoader.loadClass(name); } catch (ClassNotFoundException ex) { } } } throw new ClassNotFoundException(name); }

Target:
protected Class<?> findClass(String name) throws ClassNotFoundException { if (PluginManager.FAST_LOOKUP) { for (PluginWrapper pw : getTransitiveDependencies()) { try { Class<?> c = ClassLoaderReflectionToolkit._findLoadedClass(pw.classLoader, name); if (c!=null) return c; return ClassLoaderReflectionToolkit._findClass(pw.classLoader, name); } catch (ClassNotFoundException ignored) { } } } else { for (Dependency dep : dependencies) { PluginWrapper p = pluginManager.getPlugin(dep.shortName); if(p!=null) { try { return p.classLoader.loadClass(name); } catch (ClassNotFoundException ignored) { } } } } throw new ClassNotFoundException(name); }
Source:
CloudantClient(CouchDbProperties props, GsonBuilder gsonBuilder) { this.couchDbClient = new CouchDbClient(props); if(gsonBuilder != null) { couchDbClient.setGsonBuilder(gsonBuilder); } else { couchDbClient.setGsonBuilder(new GsonBuilder()); } }

Target:
CloudantClient(CouchDbProperties props, GsonBuilder gsonBuilder) { this.couchDbClient = new CouchDbClient(props); couchDbClient.setGsonBuilder(gsonBuilder); }
Source:
protected boolean isInterpolatableEdge(EdgeIteratorState edge) { return edge.get(roadEnvironmentEnc).equals("tunnel"); }

Target:
protected boolean isInterpolatableEdge(EdgeIteratorState edge) { return edge.get((IntEncodedValue) roadEnvironmentEnc) == tunnelRef; }
Source:
public boolean exec() throws CliException { String path = cl.getArgs()[1]; if (cl.hasOption("d")) { mode = AddWatchMode.STANDARD_DATA; } if (cl.hasOption("c")) { mode = AddWatchMode.STANDARD_CHILD; } if (cl.hasOption("e")) { mode = AddWatchMode.STANDARD_EXIST; } if (cl.hasOption("p")) { mode = AddWatchMode.PERSISTENT; } if (cl.hasOption("R")) { mode = AddWatchMode.PERSISTENT_RECURSIVE; } try { zk.addWatch(path, mode); } catch (KeeperException | InterruptedException ex) { throw new CliWrapperException(ex); } return false; }

Target:
public boolean exec() throws CliException { String path = cl.getArgs()[1]; if (cl.getOptions().length != 1) { throw new MalformedCommandException("addWatch can support one specified option"); } if (cl.hasOption("d")) { mode = AddWatchMode.STANDARD_DATA; } if (cl.hasOption("c")) { mode = AddWatchMode.STANDARD_CHILD; } if (cl.hasOption("e")) { mode = AddWatchMode.STANDARD_EXIST; } if (cl.hasOption("p")) { mode = AddWatchMode.PERSISTENT; } if (cl.hasOption("R")) { mode = AddWatchMode.PERSISTENT_RECURSIVE; } try { zk.addWatch(path, mode); } catch (KeeperException | InterruptedException ex) { throw new CliWrapperException(ex); } return false; }
Source:
public void issue1485withoutSpecifyingJARs() throws IOException { File dir = adaptPath("src/test/resources/issue1485").toFile(); File file = adaptPath("src/test/resources/issue1485/Complex.java").toFile(); CombinedTypeSolver typeSolver = new CombinedTypeSolver(); typeSolver.add(new ReflectionTypeSolver()); typeSolver.add(new JavaParserTypeSolver(dir)); JavaParser javaParser = new JavaParser(); javaParser.getParserConfiguration().setSymbolResolver(new JavaSymbolSolver(typeSolver)); CompilationUnit unit = javaParser.parse(ParseStart.COMPILATION_UNIT, new StreamProvider(new FileInputStream(file))).getResult().get(); MethodCallExpr methodCallExpr = unit.findFirst(MethodCallExpr.class, m -> m.getName().getIdentifier().equals("println")).get(); ResolvedMethodDeclaration resolvedMethodDeclaration = methodCallExpr.resolve(); assertEquals("java.io.PrintStream.println(java.lang.String)", resolvedMethodDeclaration.getQualifiedSignature()); }

Target:
public void issue1485withoutSpecifyingJARs() throws IOException { Path dir = adaptPath("src/test/resources/issue1485"); Path file = adaptPath("src/test/resources/issue1485/Complex.java"); CombinedTypeSolver typeSolver = new CombinedTypeSolver(); typeSolver.add(new ReflectionTypeSolver()); typeSolver.add(new JavaParserTypeSolver(dir)); JavaParser javaParser = new JavaParser(); javaParser.getParserConfiguration().setSymbolResolver(new JavaSymbolSolver(typeSolver)); CompilationUnit unit = javaParser.parse(ParseStart.COMPILATION_UNIT, new StreamProvider(Files.newInputStream(file))).getResult().get(); MethodCallExpr methodCallExpr = unit.findFirst(MethodCallExpr.class, m -> m.getName().getIdentifier().equals("println")).get(); ResolvedMethodDeclaration resolvedMethodDeclaration = methodCallExpr.resolve(); assertEquals("java.io.PrintStream.println(java.lang.String)", resolvedMethodDeclaration.getQualifiedSignature()); }
Source:
public Condition applyRestToApp(RestCondition rest, Condition cond) { Condition app = (Condition) SerializationUtils.clone(cond); app.setName(rest.name); app.setConditionGroup(rest.owningGroup); app.setConditionletId(rest.conditionlet); app.setOperator(Condition.Operator.valueOf(rest.operator)); app.setPriority(rest.priority); if(app.getValues()!=null){ app.getValues().clear(); } if(rest.values!=null){ for(Map.Entry<String, RestConditionValue> entry : rest.values.entrySet()){ app.addValue(entry.getValue().key, entry.getValue().value); } } try{ app.checkValid(); }catch(Exception e){ throw e; } return app; }

Target:
public Condition applyRestToApp(RestCondition rest, Condition cond) { Condition app = (Condition) SerializationUtils.clone(cond); app.setName(rest.name); app.setConditionGroup(rest.owningGroup); app.setConditionletId(rest.conditionlet); app.setOperator(Condition.Operator.valueOf(rest.operator)); app.setPriority(rest.priority); if(app.getValues()!=null){ app.getValues().clear(); } if(rest.values!=null){ for(Map.Entry<String, RestConditionValue> entry : rest.values.entrySet()){ app.addValue(entry.getValue().key, entry.getValue().value); } } app.checkValid(); return app; }
Source:
public AmplitudeClient(String instance) { this.instanceName = Utils.normalizeInstanceName(instance); this.url = Constants.EVENT_LOG_URL; logThread.start(); httpThread.start(); }

Target:
public AmplitudeClient(String instance) { this.instanceName = Utils.normalizeInstanceName(instance); logThread.start(); httpThread.start(); }
Source:
protected int createGammaId() throws OseeCoreException { int newGammaId = 0; if (attribute.isUseBackingData()) { newGammaId = attribute.getGammaId(); } else { newGammaId = ConnectionHandler.getSequence().getNextGammaId(); } return newGammaId; }

Target:
protected int createGammaId() throws OseeCoreException { return attribute.isUseBackingData() ? attribute.getGammaId() : ConnectionHandler.getSequence().getNextGammaId(); }
Source:
private void cancelSurfaceCompleters() { for (Map.Entry<CallbackToFutureAdapter.Completer<Surface>, ListenableFuture<Void>> entry : mCompleterMap.entrySet()) { entry.getKey().setCancelled(); } }

Target:
private synchronized void cancelSurfaceCompleters() { for (Map.Entry<CallbackToFutureAdapter.Completer<Surface>, ListenableFuture<Void>> entry : mCompleterMap.entrySet()) { entry.getKey().setCancelled(); } }
Source:
private void traceRequest(final RequestLogInfo requestLogInfo, final int statusCode, final Long timeSpentMs) { if (!isPublishingRequest(requestLogInfo)) { return; } final String eventType = requestLogInfo.path.substring("/event-types/".length(), requestLogInfo.path.lastIndexOf("/events")); String sloBucket = "5K-50K"; if (requestLogInfo.contentLength < 5000) { sloBucket = "<5K"; } else if (requestLogInfo.contentLength > 50000 || requestLogInfo.contentLength == 0) { sloBucket = ">50K"; } GlobalTracer.get() .buildSpan("publish_events") .withStartTimestamp(TimeUnit.MILLISECONDS.toMicros(requestLogInfo.requestTime)) .start() .setTag("client_id", requestLogInfo.user) .setTag("event_type", eventType) .setTag("error", statusCode == 207 || statusCode >= 500) .setTag("http.status_code", statusCode) .setTag("http.url", requestLogInfo.path + requestLogInfo.query) .setTag("http.header.content_encoding", requestLogInfo.contentEncoding) .setTag("http.header.accept_encoding", requestLogInfo.acceptEncoding) .setTag("http.header.user_agent", requestLogInfo.userAgent) .setTag("slo_bucket", sloBucket) .setTag("content_length", requestLogInfo.contentLength) .finish(TimeUnit.MILLISECONDS.toMicros(requestLogInfo.requestTime + timeSpentMs)); }

Target:
private void traceRequest(final RequestLogInfo requestLogInfo, final int statusCode, final Long timeSpentMs) { if (!isPublishingRequest(requestLogInfo)) { return; } final String eventType = requestLogInfo.path.substring("/event-types/".length(), requestLogInfo.path.lastIndexOf("/events")); String sloBucket = "5K-50K"; if (requestLogInfo.contentLength > 50000 || requestLogInfo.contentLength == 0) { sloBucket = ">50K"; } else if (requestLogInfo.contentLength < 5000) { sloBucket = "<5K"; } GlobalTracer.get() .buildSpan("publish_events") .withStartTimestamp(TimeUnit.MILLISECONDS.toMicros(requestLogInfo.requestTime)) .start() .setTag("client_id", requestLogInfo.user) .setTag("event_type", eventType) .setTag("error", statusCode == 207 || statusCode >= 500) .setTag("http.status_code", statusCode) .setTag("http.url", requestLogInfo.path + requestLogInfo.query) .setTag("http.header.content_encoding", requestLogInfo.contentEncoding) .setTag("http.header.accept_encoding", requestLogInfo.acceptEncoding) .setTag("http.header.user_agent", requestLogInfo.userAgent) .setTag("slo_bucket", sloBucket) .setTag("content_length", requestLogInfo.contentLength) .finish(TimeUnit.MILLISECONDS.toMicros(requestLogInfo.requestTime + timeSpentMs)); }
Source:
private void applyExpandedStateContext(ViewContext viewContext) { if (viewContext != null) { fTimeGraphViewer.expandAll(); fTimeGraphViewer.setExpandedState(viewContext.getCollapsedEntries(), false); fTimeGraphViewer.refresh(); } }

Target:
private void applyExpandedStateContext(ViewContext viewContext) { if (viewContext != null) { fTimeGraphViewer.expandAll(); fTimeGraphViewer.setExpandedState(viewContext.getCollapsedEntries(), false); } }
Source:
public CloudDataNode(CloudConfig cloudConfig, ClusterMapConfig clusterMapConfig) { this.hostName = clusterMapConfig.clusterMapHostName; this.plainTextPort = new Port(clusterMapConfig.clusterMapPort, PortType.PLAINTEXT); this.sslPort = new Port(cloudConfig.vcrSslPort, PortType.SSL); this.dataCenterName = clusterMapConfig.clusterMapDatacenterName; this.sslEnabledDataCenters = Utils.splitString(clusterMapConfig.clusterMapSslEnabledDatacenters, ","); validateHostName(clusterMapConfig.clusterMapResolveHostnames, hostName); validatePorts(plainTextPort, sslPort, sslEnabledDataCenters.contains(dataCenterName)); }

Target:
public CloudDataNode(CloudConfig cloudConfig, ClusterMapConfig clusterMapConfig) { if (clusterMapConfig.clusterMapPort == null) { throw new IllegalArgumentException("PlainText port is not provided"); } else if (cloudConfig.vcrSslPort == null) { throw new IllegalArgumentException("VCR SSL Port is not provided."); } this.hostName = clusterMapConfig.clusterMapHostName; this.plainTextPort = new Port(clusterMapConfig.clusterMapPort, PortType.PLAINTEXT); this.sslPort = new Port(cloudConfig.vcrSslPort, PortType.SSL); this.dataCenterName = clusterMapConfig.clusterMapDatacenterName; this.sslEnabledDataCenters = Utils.splitString(clusterMapConfig.clusterMapSslEnabledDatacenters, ","); validateHostName(clusterMapConfig.clusterMapResolveHostnames, hostName); validatePorts(plainTextPort, sslPort, sslEnabledDataCenters.contains(dataCenterName)); }
Source:
private String buildStringToSign(URL requestURL, String httpMethod, Map<String, String> headers, boolean logStringToSign) { String contentLength = headers.get("Content-Length"); contentLength = contentLength.equals("0") ? "" : contentLength; String dateHeader = (headers.containsKey("x-ms-date")) ? "" : getStandardHeaderValue(headers, "Date"); String stringToSign = String.join("\n", httpMethod, getStandardHeaderValue(headers, "Content-Encoding"), getStandardHeaderValue(headers, "Content-Language"), contentLength, getStandardHeaderValue(headers, "Content-MD5"), getStandardHeaderValue(headers, "Content-Type"), dateHeader, getStandardHeaderValue(headers, "If-Modified-Since"), getStandardHeaderValue(headers, "If-Match"), getStandardHeaderValue(headers, "If-None-Match"), getStandardHeaderValue(headers, "If-Unmodified-Since"), getStandardHeaderValue(headers, "Range"), getAdditionalXmsHeaders(headers), getCanonicalizedResource(requestURL)); if (logStringToSign) { StorageImplUtils.logStringToSign(logger, stringToSign, new Context(Constants.STORAGE_LOG_STRING_TO_SIGN, true)); } return stringToSign; }

Target:
private String buildStringToSign(URL requestURL, String httpMethod, Map<String, String> headers, boolean logStringToSign) { String contentLength = headers.get("Content-Length"); contentLength = contentLength.equals("0") ? "" : contentLength; String dateHeader = (headers.containsKey("x-ms-date")) ? "" : getStandardHeaderValue(headers, "Date"); String stringToSign = String.join("\n", httpMethod, getStandardHeaderValue(headers, "Content-Encoding"), getStandardHeaderValue(headers, "Content-Language"), contentLength, getStandardHeaderValue(headers, "Content-MD5"), getStandardHeaderValue(headers, "Content-Type"), dateHeader, getStandardHeaderValue(headers, "If-Modified-Since"), getStandardHeaderValue(headers, "If-Match"), getStandardHeaderValue(headers, "If-None-Match"), getStandardHeaderValue(headers, "If-Unmodified-Since"), getStandardHeaderValue(headers, "Range"), getAdditionalXmsHeaders(headers), getCanonicalizedResource(requestURL)); if (logStringToSign) { StorageImplUtils.logStringToSign(logger, stringToSign, LOG_STRING_TO_SIGN_CONTEXT); } return stringToSign; }
Source:
public CassandraVersion getCassandraVersion() { if (!dse) { return version; } else { CassandraVersion cassandraVersion = version; if (cassandraVersion.getMajor() == 6) { return CassandraVersion.parse("4.0.0"); } else if (cassandraVersion.getMajor() == 5) { if (cassandraVersion.getMinor() == 0) { return CassandraVersion.parse("3.0.15"); } else { return CassandraVersion.parse("3.10"); } } else { return CassandraVersion.parse("2.1.19"); } } }

Target:
public CassandraVersion getCassandraVersion() { if (!DSE_ENABLEMENT) { return VERSION; } else { CassandraVersion stableVersion = VERSION.nextStable(); if (stableVersion.compareTo(V6_0_0) >= 0) { return V4_0_0; } else if (stableVersion.compareTo(V5_1_0) >= 0) { return V3_10; } else if (stableVersion.compareTo(V5_0_0) >= 0) { return V3_0_15; } else { return V2_1_19; } } }
Source:
public void createProgramEnrollment(String configName, String patientUuid, String programUuid, DateTime dateEnrolled, DateTime dateCompleted, String locationName, Map<String, String> programEnrollmentAttributes) { Patient patient = new Patient(); patient.setUuid(patientUuid); Program program = new Program(); program.setUuid(programUuid); Location location = null; if (StringUtils.isNotBlank(locationName)) { location = getLocationByName(configName, locationName); } ProgramEnrollment programEnrollment = new ProgramEnrollment(); programEnrollment.setPatient(patient); programEnrollment.setProgram(program); programEnrollment.setDateEnrolled(dateEnrolled.toDate()); programEnrollment.setDateCompleted(Objects.nonNull(dateCompleted) ? dateCompleted.toDate() : null); programEnrollment.setLocation(location); programEnrollment.setAttributes(programEnrollmentAttributes.size() == 0 ? null : convertAttributeMapToList(programEnrollmentAttributes)); programEnrollmentService.createProgramEnrollment(configName, programEnrollment); }

Target:
public void createProgramEnrollment(String configName, String patientUuid, String programUuid, DateTime dateEnrolled, DateTime dateCompleted, String locationName, Map<String, String> programEnrollmentAttributes) { Patient patient = new Patient(); patient.setUuid(patientUuid); Program program = new Program(); program.setUuid(programUuid); Location location = null; if (StringUtils.isNotBlank(locationName)) { location = getLocationByName(configName, locationName); } ProgramEnrollment programEnrollment = new ProgramEnrollment(); programEnrollment.setPatient(patient); programEnrollment.setProgram(program); programEnrollment.setDateEnrolled(dateEnrolled.toDate()); programEnrollment.setDateCompleted(Objects.nonNull(dateCompleted) ? dateCompleted.toDate() : null); programEnrollment.setLocation(location); programEnrollment.setAttributes(MapUtils.isEmpty(programEnrollmentAttributes) ? null : convertAttributeMapToList(programEnrollmentAttributes)); programEnrollmentService.createProgramEnrollment(configName, programEnrollment); }
Source:
protected void setupHttpServer() throws Exception { _httpServer = new LocalFileServer(); _configUrl = _httpServer.serveDir("/conf", "conf", getLocalServerPort()); LOG.info("Started serving config dir under " + _configUrl); }

Target:
protected void setupHttpServer() throws Exception { _httpServer = new LocalFileServer(); _configUrl = _httpServer.serveDir("/conf", "conf", _localFileServerPort); LOG.info("Started HTTP server from which config for the MesosSupervisor's may be fetched. URL: " + _configUrl); }
Source:
public Navigation clickExploreWikiHeader() { Loading loading = new Loading(driver); PageObjectLogging.logInfo("Click 'Explore Wiki' header"); wait.forElementClickable(exploreWikiHeader); exploreWikiHeader.click(); loading.handleAsyncPageReload(); return this; }

Target:
public Navigation clickExploreWikiHeader() { PageObjectLogging.logInfo("Click 'Explore Wiki' header"); wait.forElementClickable(exploreWikiHeader); exploreWikiHeader.click(); loading.handleAsyncPageReload(); return this; }
Source:
private static void dumpFromZk(ZkClient zkClient, String zpathBase, String zkConnect, PrintStream out) { final String propPath = Initialization.makePropPath(zpathBase); if (zkClient.exists(propPath)) { Properties currProps = zkClient.readData(propPath, true); if (currProps != null) { out.println("# Begin Properties Listing for zkConnect=" + zkConnect + " zpath=" + propPath); try { currProps.store(out, "Druid"); } catch (IOException ignored) { } out.println("# End Properties Listing for zkConnect=" + zkConnect + " zpath=" + propPath); out.println("# NOTE: properties like druid.zk.paths.*Path are always stored in zookeeper in absolute form."); out.println(); } } out.println("Zookeeper znodes and zpaths for " + zkConnect + " (showing all zpaths)"); zkClient.showFolders(out); }

Target:
private static void dumpFromZk(ZkClient zkClient, String zpathBase, String zkConnect, PrintStream out) { final String propPath = Initialization.makePropPath(zpathBase); if (zkClient.exists(propPath)) { Properties currProps = zkClient.readData(propPath, true); if (currProps != null) { out.println("# Begin Properties Listing for zkConnect=" + zkConnect + " zpath=" + propPath); try { currProps.store(out, "Druid"); } catch (IOException ignored) { } out.println("# End Properties Listing for zkConnect=" + zkConnect + " zpath=" + propPath); out.println("# NOTE: properties like druid.zk.paths.*Path are always stored in zookeeper in absolute form."); out.println(); } } }
Source:
public ResponseEntity<?> commitCursors(@PathVariable("subscriptionId") final String subscriptionId, @Valid @RequestBody final ItemsWrapper<SubscriptionCursor> cursorsIn, @NotNull @RequestHeader("X-Nakadi-StreamId") final String streamId, final HttpServletRequest request, final Client client) throws NoSuchEventTypeException, NoSuchSubscriptionException, InvalidCursorException, ServiceTemporarilyUnavailableException, InternalNakadiException { final List<NakadiCursor> cursors = convertToNakadiCursors(cursorsIn); if (cursors.isEmpty()) { throw new CursorsAreEmptyException(); } final Scope commitScope = TracingService.activateSpan((Span) request.getAttribute("span"), false); commitScope.span().setOperationName("commit_events"); if (blacklistService.isSubscriptionConsumptionBlocked(subscriptionId, client.getClientId())) { TracingService.logErrorInSpan(commitScope, "Application or subscription is blocked"); throw new BlockedException("Application or subscription is blocked"); } final List<Boolean> items = cursorsService.commitCursors(streamId, subscriptionId, cursors, commitScope.span()); final boolean allCommitted = items.stream().allMatch(item -> item); if (allCommitted) { return noContent().build(); } else { final List<CursorCommitResult> body = IntStream.range(0, cursorsIn.getItems().size()) .mapToObj(idx -> new CursorCommitResult(cursorsIn.getItems().get(idx), items.get(idx))) .collect(Collectors.toList()); return ok(new ItemsWrapper<>(body)); } }

Target:
public ResponseEntity<?> commitCursors(@PathVariable("subscriptionId") final String subscriptionId, @Valid @RequestBody final ItemsWrapper<SubscriptionCursor> cursorsIn, @NotNull @RequestHeader("X-Nakadi-StreamId") final String streamId, final HttpServletRequest request, final Client client) throws NoSuchEventTypeException, NoSuchSubscriptionException, InvalidCursorException, ServiceTemporarilyUnavailableException, InternalNakadiException { final List<NakadiCursor> cursors = convertToNakadiCursors(cursorsIn); if (cursors.isEmpty()) { throw new CursorsAreEmptyException(); } final Scope commitScope = TracingService.activateSpan(request, false); commitScope.span().setOperationName("commit_events"); if (blacklistService.isSubscriptionConsumptionBlocked(subscriptionId, client.getClientId())) { TracingService.logErrorInSpan(commitScope, "Application or subscription is blocked"); throw new BlockedException("Application or subscription is blocked"); } final List<Boolean> items = cursorsService.commitCursors(streamId, subscriptionId, cursors, commitScope.span()); final boolean allCommitted = items.stream().allMatch(item -> item); if (allCommitted) { return noContent().build(); } else { final List<CursorCommitResult> body = IntStream.range(0, cursorsIn.getItems().size()) .mapToObj(idx -> new CursorCommitResult(cursorsIn.getItems().get(idx), items.get(idx))) .collect(Collectors.toList()); return ok(new ItemsWrapper<>(body)); } }
Source:
public static void applyAuth(final MqttConnectOptions options, final String brokerURI) { final String region = getRegion(brokerURI); SimpleEntry<String, String> certificates = REGION_CERTIFICATES_MAP.get(region); try { SSLSocketFactory socketFactory = getSocketFactory(AWS_IOT_ROOT_CA, certificates.getKey(), certificates.getValue(), ""); options.setSocketFactory(socketFactory); } catch (Exception e) { e.printStackTrace(); } }

Target:
public static void applyAuth(final MqttConnectOptions options, final String brokerURI) { final String region = getRegion(brokerURI); final SimpleEntry<String, String> certificates = REGION_CERTIFICATES_MAP.get(region); try { final SSLSocketFactory socketFactory = getSocketFactory(AWS_IOT_ROOT_CA, certificates.getKey(), certificates.getValue(), ""); options.setSocketFactory(socketFactory); } catch (Exception e) { e.printStackTrace(); } }
Source:
public ConfigSaveState updateFullConfig(FullConfigUpdateCommand command) { ConfigSaveState configSaveState = null; LOGGER.info("Config update request by is in queue - {}", UserHelper.getUserName().getUsername(), command); synchronized (GoConfigWriteLock.class) { try { LOGGER.info("Config update request by is being processed", UserHelper.getUserName().getUsername()); if (command instanceof CheckedUpdateCommand) { CheckedUpdateCommand checkedCommand = (CheckedUpdateCommand) command; if (!checkedCommand.canContinue(cachedConfigService.currentConfig())) { throw new ConfigUpdateCheckFailedException(); } } configSaveState = cachedConfigService.writeFullConfigWithLock(command); } finally { if (command instanceof ConfigAwareUpdate) { ((ConfigAwareUpdate) command).afterUpdate(clonedConfig()); } LOGGER.info("Config update request by is completed", UserHelper.getUserName().getUsername()); } } return configSaveState; }

Target:
public ConfigSaveState updateFullConfig(FullConfigUpdateCommand command) { ConfigSaveState configSaveState; LOGGER.info("Config update request by is in queue - {}", UserHelper.getUserName().getUsername(), command); synchronized (GoConfigWriteLock.class) { LOGGER.info("Config update request by is being processed", UserHelper.getUserName().getUsername()); configSaveState = cachedConfigService.writeFullConfigWithLock(command); LOGGER.info("Config update request by is completed", UserHelper.getUserName().getUsername()); } return configSaveState; }
Source:
private void deleteTestDir(File rootDir) { if (rootDir != null && rootDir.exists()) { delete(rootDir); } }

Target:
private void deleteTestDir(File rootDir) throws IOException { if (rootDir.exists()) { deleteRecursively(rootDir.toPath(), ALLOW_INSECURE); } }
Source:
InMemoryInputDescriptor(String streamId, InMemorySystemDescriptor systemDescriptor) { super(streamId, new NoOpSerde<>(), systemDescriptor, null); this.partitionData = new HashMap<Integer, Iterable<StreamMessageType>>(); }

Target:
InMemoryInputDescriptor(String streamId, InMemorySystemDescriptor systemDescriptor) { super(streamId, new NoOpSerde<>(), systemDescriptor, null); }
Source:
public UUID getUserId() { return userKey; }

Target:
public UUID getUserId() { return userId; }
Source:
public HdfsContext(String user) { this.user = user; this.queryId = Optional.empty(); this.schemaName = Optional.empty(); this.tableName = Optional.empty(); }

Target:
public HdfsContext(String user) { this.user = requireNonNull(user, "user is null"); this.queryId = Optional.empty(); this.schemaName = Optional.empty(); this.tableName = Optional.empty(); }