auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>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()); } <START> userOptions = new HashMap<>(); <END> }</code><technical_language>reason Collections.emptyMap()</technical_language>

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:
<code>void setToolbarButtons(IActionBars bars, IPerspectiveDescriptor perspective) { <START> enableAppearanceButtons(bars.getToolBarManager(), !simulationPerspective(perspective)); <END> }</code><technical_language>enableEditingButtons(..)</technical_language>

Target:
void setToolbarButtons(IActionBars bars, IPerspectiveDescriptor perspective) { enableEditingButtons(bars.getToolBarManager(), !relevantPerspective(perspective)); }
Source:
<code>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); <START> }else { <END> Collections.sort(trialSummaryList, getComparatorStartDate()); } }</code><technical_language>format</technical_language>

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:
<code>public void shouldCheckPage500WithParent(boolean expectedResult) { CustomPage.Type type = CustomPage.Type.ERROR_500; <START> ; <END> 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); }</code><technical_language>Remove</technical_language>

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:
<code>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); <START> CollectionStreamSystem system = CollectionStreamSystem.create("test"); <END> 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())); }</code><technical_language>Need hide this. pretty weird</technical_language>

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:
<code>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()), <START> f.prefixedCastExpression( <END> 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())))); }</code><technical_language>making a rule this directly? easier read PREFIXED_BINARY_CAST() here</technical_language>

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:
<code>public RecoverCmd() { super(CMD_RECOVER); <START> opts.addOption("d", "delete_cookie", false, "Delete cookie node for the bookie."); <END> }</code><technical_language>this break compatibility</technical_language>

Target:
public RecoverCmd() { super(CMD_RECOVER); opts.addOption("d", "deleteCookie", false, "Delete cookie node for the bookie."); }
Source:
<code>@Before public void vars() { <START> listener = StreamTaskListener.fromStdout(); <END> ws = j.jenkins.getRootPath().child("ws"); launcher = j.jenkins.createLauncher(listener); }</code><technical_language>This a good time Assume powershell.exe is in %Path% (or whatever)</technical_language>

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:
<code>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); <START> } catch (ClassNotFoundException ex) { <END> } } } throw new ClassNotFoundException(name); }</code><technical_language>prefer IntelliJ understands it</technical_language>

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:
<code>CloudantClient(CouchDbProperties props, GsonBuilder gsonBuilder) { this.couchDbClient = new CouchDbClient(props); if(gsonBuilder != null) { <START> couchDbClient.setGsonBuilder(gsonBuilder); <END> } else { couchDbClient.setGsonBuilder(new GsonBuilder()); } }</code><technical_language>setGsonBuilder method in this class needs private (or content potentially moved ClientBuilder.setGsonBuilder() method instead)</technical_language>

Target:
CloudantClient(CouchDbProperties props, GsonBuilder gsonBuilder) { this.couchDbClient = new CouchDbClient(props); couchDbClient.setGsonBuilder(gsonBuilder); }
Source:
<code>protected boolean isInterpolatableEdge(EdgeIteratorState edge) { <START> return edge.get(roadEnvironmentEnc).equals("tunnel"); <END> }</code><technical_language>For I hardcoded this. a access properties</technical_language>

Target:
protected boolean isInterpolatableEdge(EdgeIteratorState edge) { return edge.get((IntEncodedValue) roadEnvironmentEnc) == tunnelRef; }
Source:
<code>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; <START> } <END> 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; }</code><technical_language>Needs error message if more 1 is specified</technical_language>

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:
<code>public void issue1485withoutSpecifyingJARs() throws IOException { File dir = adaptPath("src/test/resources/issue1485").toFile(); <START> File file = adaptPath("src/test/resources/issue1485/Complex.java").toFile(); <END> 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()); }</code><technical_language>Try slowly refactoring File Path</technical_language>

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:
<code>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){ <START> throw e; <END> } return app; }</code><technical_language>Hmmm? :~)</technical_language>

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:
<code>public AmplitudeClient(String instance) { this.instanceName = Utils.normalizeInstanceName(instance); <START> this.url = Constants.EVENT_LOG_URL; <END> logThread.start(); httpThread.start(); }</code><technical_language>I kinda leaving this set variable is declared, is fine</technical_language>

Target:
public AmplitudeClient(String instance) { this.instanceName = Utils.normalizeInstanceName(instance); logThread.start(); httpThread.start(); }
Source:
<code>protected int createGammaId() throws OseeCoreException { <START> int newGammaId = 0; <END> if (attribute.isUseBackingData()) { newGammaId = attribute.getGammaId(); } else { newGammaId = ConnectionHandler.getSequence().getNextGammaId(); } return newGammaId; }</code><technical_language>nitpick ... this renamed simply gammaId, necessarily new</technical_language>

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

Target:
private synchronized void cancelSurfaceCompleters() { for (Map.Entry<CallbackToFutureAdapter.Completer<Surface>, ListenableFuture<Void>> entry : mCompleterMap.entrySet()) { entry.getKey().setCancelled(); } }
Source:
<code>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"; <START> if (requestLogInfo.contentLength < 5000) { <END> 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)); }</code><technical_language>content length of 0 excluded here</technical_language>

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:
<code>private void applyExpandedStateContext(ViewContext viewContext) { if (viewContext != null) { fTimeGraphViewer.expandAll(); fTimeGraphViewer.setExpandedState(viewContext.getCollapsedEntries(), false); <START> fTimeGraphViewer.refresh(); <END> } }</code><technical_language>This refresh necessary</technical_language>

Target:
private void applyExpandedStateContext(ViewContext viewContext) { if (viewContext != null) { fTimeGraphViewer.expandAll(); fTimeGraphViewer.setExpandedState(viewContext.getCollapsedEntries(), false); } }
Source:
<code>public CloudDataNode(CloudConfig cloudConfig, ClusterMapConfig clusterMapConfig) { this.hostName = clusterMapConfig.clusterMapHostName; <START> this.plainTextPort = new Port(clusterMapConfig.clusterMapPort, PortType.PLAINTEXT); <END> 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)); }</code><technical_language>This throw NPE if clusterMapPort is null. throw IllegalArgumentException clear message. for vcrSslPort next line</technical_language>

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:
<code>private String buildStringToSign(URL requestURL, String httpMethod, Map<String, String> headers, <START> boolean logStringToSign) { <END> 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; }</code><technical_language>accept context instead of a boolean</technical_language>

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:
<code>public CassandraVersion getCassandraVersion() { if (!dse) { return version; } else { <START> CassandraVersion cassandraVersion = version; <END> 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"); } } }</code><technical_language>extra local variable</technical_language>

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:
<code>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); <START> programEnrollment.setAttributes(programEnrollmentAttributes.size() == 0 ? null : <END> convertAttributeMapToList(programEnrollmentAttributes)); programEnrollmentService.createProgramEnrollment(configName, programEnrollment); }</code><technical_language>CollectionUtils.isEmpty</technical_language>

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:
<code><START> protected void setupHttpServer() throws Exception { <END> _httpServer = new LocalFileServer(); _configUrl = _httpServer.serveDir("/conf", "conf", getLocalServerPort()); LOG.info("Started serving config dir under " + _configUrl); }</code><technical_language>I refactoring in general, please refactoring commits separate commit addresses bug/issue/task</technical_language>

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:
<code>public Navigation clickExploreWikiHeader() { <START> Loading loading = new Loading(driver); <END> PageObjectLogging.logInfo("Click 'Explore Wiki' header"); wait.forElementClickable(exploreWikiHeader); exploreWikiHeader.click(); loading.handleAsyncPageReload(); return this; }</code><technical_language>loading declared class field</technical_language>

Target:
public Navigation clickExploreWikiHeader() { PageObjectLogging.logInfo("Click 'Explore Wiki' header"); wait.forElementClickable(exploreWikiHeader); exploreWikiHeader.click(); loading.handleAsyncPageReload(); return this; }
Source:
<code>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)"); <START> zkClient.showFolders(out); <END> }</code><technical_language>This is scary. For a zkcluster using, able this utility gonna dump a real ZK cluster a _lot_. do this explicitly for information dump this, do people rely exhibitor provide visibility ZK</technical_language>

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:
<code>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(); } <START> final Scope commitScope = TracingService.activateSpan((Span) request.getAttribute("span"), false); <END> 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)); } }</code><technical_language>TracingService.activateSpan request, do casting method</technical_language>

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:
<code>public static void applyAuth(final MqttConnectOptions options, final String brokerURI) { final String region = getRegion(brokerURI); <START> SimpleEntry<String, String> certificates = REGION_CERTIFICATES_MAP.get(region); <END> try { SSLSocketFactory socketFactory = getSocketFactory(AWS_IOT_ROOT_CA, certificates.getKey(), certificates.getValue(), ""); options.setSocketFactory(socketFactory); } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>final</technical_language>

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:
<code>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()); <START> if (command instanceof CheckedUpdateCommand) { <END> 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; }</code><technical_language>updateFullConfig accepts FullConfigUpdateCommand sense command instanceof CheckedUpdateCommand check here, canContinue is responsible for disallowing un-authorized save operation acquiring required write lock missing here</technical_language>

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:
<code>private void deleteTestDir(File rootDir) { <START> if (rootDir != null && rootDir.exists()) { <END> delete(rootDir); } }</code><technical_language>nan</technical_language>

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

Target:
InMemoryInputDescriptor(String streamId, InMemorySystemDescriptor systemDescriptor) { super(streamId, new NoOpSerde<>(), systemDescriptor, null); }
Source:
<code>public UUID getUserId() { <START> return userKey; <END> }</code><technical_language>Nit: rename field userId well</technical_language>

Target:
public UUID getUserId() { return userId; }
Source:
<code>public HdfsContext(String user) { <START> this.user = user; <END> this.queryId = Optional.empty(); this.schemaName = Optional.empty(); this.tableName = Optional.empty(); }</code><technical_language>Add null checks constructors, callers rely this null</technical_language>

Target:
public HdfsContext(String user) { this.user = requireNonNull(user, "user is null"); this.queryId = Optional.empty(); this.schemaName = Optional.empty(); this.tableName = Optional.empty(); }
Source:
<code>public void cancelNotOnMainThreadCrashes() throws Exception { <START> doCallRealMethod().when(picasso).cancelRequest(any(ImageView.class)); <END> doCallRealMethod().when(picasso).cancelRequest(any(Target.class)); final CountDownLatch latch = new CountDownLatch(1); new Thread(new Runnable() { @Override public void run() { try { new RequestCreator(picasso, null, 0).into(mockTarget()); fail("Should have thrown IllegalStateException"); } catch (IllegalStateException ignored) { } finally { latch.countDown(); } } }).start(); latch.await(); }</code><technical_language>Unused</technical_language>

Target:
public void cancelNotOnMainThreadCrashes() throws Exception { doCallRealMethod().when(picasso).cancelRequest(any(Target.class)); final CountDownLatch latch = new CountDownLatch(1); new Thread(new Runnable() { @Override public void run() { try { new RequestCreator(picasso, null, 0).into(mockTarget()); fail("Should have thrown IllegalStateException"); } catch (IllegalStateException ignored) { } finally { latch.countDown(); } } }).start(); latch.await(); }
Source:
<code>private List<String> getImportClasspath(String localRepo) { List<String> classpath = new ArrayList<>(); if (localRepo.equals("")) { return classpath; } File repo = new File(localRepo); File[] files = repo.listFiles(); if (files == null) { <START> return classpath; <END> } for (File file : files) { if (!file.isDirectory()) { classpath.add(file.getAbsolutePath()); } } return classpath; }</code><technical_language>fail here</technical_language>

Target:
private List<String> getImportClasspath(String localRepo) { List<String> classpath = new ArrayList<>(); if (localRepo.equals("")) { return classpath; } File repo = new File(localRepo); File[] files = repo.listFiles(); if (files == null) { return classpath; } for (File file : files) { if (file.isFile()) { classpath.add(file.getAbsolutePath()); } } return classpath; }
Source:
<code>private Layer getLayerToActivate(DDiagram parentDiagram, final DDiagramElement ddiagramElement, DiagramMappingsManager mappingManager) { Collection<Layer> layers = mappingManager.getActiveParentLayers(ddiagramElement.getDiagramElementMapping()); List<Layer> allLayers = LayerHelper.getAllLayers(parentDiagram.getDescription()); Set<Layer> deactivatedLayers = allLayers.stream().filter(elmt -> !layers.contains(elmt)).collect(Collectors.toSet()); Collection<Layer> diagramElementLayers = LayerHelper.getParentLayers(ddiagramElement.getDiagramElementMapping()); Collection<Layer> keptElementLayers = new LinkedHashSet<>(); for (Layer deactivatedLayer : deactivatedLayers) { for (Layer diagramElementLayer : diagramElementLayers) { if (EqualityHelper.areEquals(deactivatedLayer, diagramElementLayer)) { keptElementLayers.add(deactivatedLayer); } } } if <START> (keptElementLayers.size() > 0) { <END> return keptElementLayers.iterator().next(); } return null; }</code><technical_language>!keptElementLayers.isEmpty()</technical_language>

Target:
private Layer getLayerToActivate(DDiagram parentDiagram, final DDiagramElement ddiagramElement, DiagramMappingsManager mappingManager) { Collection<Layer> layers = mappingManager.getActiveParentLayers(ddiagramElement.getDiagramElementMapping()); List<Layer> allLayers = LayerHelper.getAllLayers(parentDiagram.getDescription()); Set<Layer> deactivatedLayers = allLayers.stream().filter(elmt -> !layers.contains(elmt)).collect(Collectors.toSet()); Collection<Layer> diagramElementLayers = LayerHelper.getParentLayers(ddiagramElement.getDiagramElementMapping()); Collection<Layer> keptElementLayers = new LinkedHashSet<>(); for (Layer deactivatedLayer : deactivatedLayers) { for (Layer diagramElementLayer : diagramElementLayers) { if (EqualityHelper.areEquals(deactivatedLayer, diagramElementLayer)) { keptElementLayers.add(deactivatedLayer); } } } if (!keptElementLayers.isEmpty()) { return keptElementLayers.iterator().next(); } return null; }
Source:
<code>public void afterSLAViolated(SLAViolatedEvent event) { <START> this.slaViolated = true; <END> }</code><technical_language>Instead of defining this attribute, invoke countdown for latch (initialized in constructor)</technical_language>

Target:
public void afterSLAViolated(SLAViolatedEvent event) { latch.countDown(); }
Source:
<code>IndentedAppendable indent() { int s = size; String[] cache = CACHE; if (s >= 0 && s < cache.length) { buff.append(cache[s]); return this; } <START> while (s-- > 0) { <END> buff.append(' '); } return this; }</code><technical_language>I a good for loop is more readable for (int i = 0; i < size; i++) concise easier understand (to least)</technical_language>

Target:
IndentedAppendable indent() { for (int i = 0; i < currentIndentation; i++) { stringBuilder.append(' '); } return this; }
Source:
<code><START> protected static String buildFilePath(String path) throws IOException { <END> if (StringUtils.isNotEmpty(path) && path.startsWith(RELATIVE_PATH_START_CHAR)) { File currentDirectory = new File(new File(RELATIVE_PATH_START_CHAR).getAbsolutePath()); path = currentDirectory.getCanonicalPath() + File.separator + path; } if (log.isDebugEnabled()) { log.debug("File path for KeyStore/TrustStore : " + path); } return path; }</code><technical_language>This is fine, of changing protected</technical_language>

Target:
private static String buildFilePath(String path) throws IOException { if (StringUtils.isNotEmpty(path) && path.startsWith(Constants.TenantConstants.RELATIVE_PATH_START_CHAR)) { File currentDirectory = new File(new File(Constants.TenantConstants.RELATIVE_PATH_START_CHAR) .getAbsolutePath()); path = currentDirectory.getCanonicalPath() + File.separator + path; } if (log.isDebugEnabled()) { log.debug("File path for KeyStore/TrustStore : " + path); } return path; }
Source:
<code>private void init() { inflate(); bind(); <START> FeedbackUtil.setToolbarButtonLongPressToast(bookmark); <END> FeedbackUtil.setToolbarButtonLongPressToast(navigate); FeedbackUtil.setToolbarButtonLongPressToast(share); }</code><technical_language>This is great! worth a FeedbackUtil.setToolbarButtonLongPressToast() variable arity overload</technical_language>

Target:
private void init() { inflate(); bind(); FeedbackUtil.setToolbarButtonLongPressToast(bookmark, navigate, share); }
Source:
<code>private ListMultipartUploadsResult listIncompleteUploads(String bucketName, String keyMarker, String uploadIdMarker, String prefix, String delimiter, int maxUploads) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { Map<String,String> queryParamMap = new HashMap<>(); queryParamMap.put("uploads", ""); <START> queryParamMap.put("max-uploads", Integer.toString(maxUploads < 0 || maxUploads > 1000 ? 1000 : maxUploads)); <END> queryParamMap.put("prefix", prefix); queryParamMap.put("key-marker", keyMarker); queryParamMap.put("upload-id-marker", uploadIdMarker); queryParamMap.put("delimiter", delimiter); HttpResponse response = executeGet(bucketName, null, null, queryParamMap); ListMultipartUploadsResult result = new ListMultipartUploadsResult(); result.parseXml(response.body().charStream()); response.body().close(); return result; }</code><technical_language>declare maxUploadsString ternary operator. avoid ternary operator</technical_language>

Target:
private ListMultipartUploadsResult listIncompleteUploads(String bucketName, String keyMarker, String uploadIdMarker, String prefix, String delimiter, int maxUploads) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { if (maxUploads < 0 || maxUploads > 1000) { maxUploads = 1000; } Map<String,String> queryParamMap = new HashMap<>(); queryParamMap.put("uploads", ""); queryParamMap.put("max-uploads", Integer.toString(maxUploads)); queryParamMap.put("prefix", prefix); queryParamMap.put("key-marker", keyMarker); queryParamMap.put("upload-id-marker", uploadIdMarker); queryParamMap.put("delimiter", delimiter); HttpResponse response = executeGet(bucketName, null, null, queryParamMap); ListMultipartUploadsResult result = new ListMultipartUploadsResult(); result.parseXml(response.body().charStream()); response.body().close(); return result; }
Source:
<code>public final void onInit() { if (!(this.executor instanceof ErrorHandlingTaskExecutor)) { ErrorHandler errorHandler = new MessagePublishingErrorHandler( new BeanFactoryChannelResolver(this.getBeanFactory())); this.executor = new ErrorHandlingTaskExecutor(this.executor, errorHandler); } UnicastingDispatcher unicastingDispatcher = new UnicastingDispatcher(this.executor); unicastingDispatcher.setFailover(this.failover); if (this.maxSubscribers == null) { this.maxSubscribers = getIntegrationProperty(IntegrationProperties.CHANNELS_MAX_UNICAST_SUBSCRIBERS, Integer.class); } unicastingDispatcher.setMaxSubscribers(this.maxSubscribers); if (this.loadBalancingStrategy != null) { unicastingDispatcher.setLoadBalancingStrategy(this.loadBalancingStrategy); } unicastingDispatcher.setMessageHandlingTaskDecorator(new MessageHandlingTaskDecorator() { @Override public Runnable decorate(MessageHandlingRunnable task) { <START> return new MessageHandlingTask(task); <END> } }); this.dispatcher = unicastingDispatcher; }</code><technical_language>I need this some more but, streamlining for XD lately, I keen this per-message extra object creation, especially interceptors</technical_language>

Target:
public final void onInit() { if (!(this.executor instanceof ErrorHandlingTaskExecutor)) { ErrorHandler errorHandler = new MessagePublishingErrorHandler( new BeanFactoryChannelResolver(this.getBeanFactory())); this.executor = new ErrorHandlingTaskExecutor(this.executor, errorHandler); } UnicastingDispatcher unicastingDispatcher = new UnicastingDispatcher(this.executor); unicastingDispatcher.setFailover(this.failover); if (this.maxSubscribers == null) { this.maxSubscribers = getIntegrationProperty(IntegrationProperties.CHANNELS_MAX_UNICAST_SUBSCRIBERS, Integer.class); } unicastingDispatcher.setMaxSubscribers(this.maxSubscribers); if (this.loadBalancingStrategy != null) { unicastingDispatcher.setLoadBalancingStrategy(this.loadBalancingStrategy); } unicastingDispatcher.setMessageHandlingTaskDecorator(new MessageHandlingTaskDecorator() { @Override public Runnable decorate(MessageHandlingRunnable task) { if (ExecutorChannel.this.executorInterceptorsSize > 0) { return new MessageHandlingTask(task); } else { return task; } } }); this.dispatcher = unicastingDispatcher; }