auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void setUp() { this.builder = EventEnricher.newBuilder(); <START> this.function = new BiFunction<Timestamp, Int32Value, StringValue>() { <END> @Override public @Nullable StringValue apply(@Nullable Timestamp input, Int32Value context) { if (input == null) { return null; } return toMessage(Timestamps.toString(input)); } }; this.fieldEnrichment = FieldEnrichment.of(Timestamp.class, StringValue.class, function); }</code><technical_language>Please parameter type (e.g. EventContext) below. get rid of rejections (and rejection events), parameter EventContext; includes C parameter in FieldEnrichment class, removed generic params all</technical_language>

Target:
void setUp() { this.builder = EventEnricher.newBuilder(); this.function = new BiFunction<Timestamp, EventContext, StringValue>() { @Override public @Nullable StringValue apply(@Nullable Timestamp input, EventContext context) { if (input == null) { return null; } return toMessage(Timestamps.toString(input)); } }; this.fieldEnrichment = FieldEnrichment.of(Timestamp.class, StringValue.class, function); }
Source:
<code>protected void executeVdsBrokerCommand() { vmListReturn = getBroker().getExternalVmList(getParameters().getUrl(), getParameters().getUsername(), getParameters().getPassword(), getParameters().getNamesOfVms()); proceedProxyReturnValue(); List<VM> vms = new ArrayList<>(); List<VM> notDownVms = new ArrayList<>(); for (Map<String, Object> map : vmListReturn.vmList) { VM vm = VdsBrokerObjectsBuilder.buildVmsDataFromExternalProvider(map); if (vm != null) { vm.setOrigin(getParameters().getOriginType()); if (vm.getOrigin() == OriginType.KVM && vm.getStaticData().getImages().stream() <START> .anyMatch(i -> i.getDiskVmElementForVm(vm.getId()) .getDiskInterface() == DiskInterface.VirtIO_SCSI)) { <END> VmDeviceCommonUtils.addVirtIoScsiDevice(vm.getStaticData()); } vms.add(vm); if (!vm.isDown()) { notDownVms.add(vm); } } } logNonDownVms(notDownVms); setReturnValue(vms); }</code><technical_language>please extract VmDeviceCommonUtils</technical_language>

Target:
protected void executeVdsBrokerCommand() { vmListReturn = getBroker().getExternalVmList(getParameters().getUrl(), getParameters().getUsername(), getParameters().getPassword(), getParameters().getNamesOfVms()); proceedProxyReturnValue(); List<VM> vms = new ArrayList<>(); List<VM> notDownVms = new ArrayList<>(); for (Map<String, Object> map : vmListReturn.vmList) { VM vm = VdsBrokerObjectsBuilder.buildVmsDataFromExternalProvider(map); if (vm != null) { vm.setOrigin(getParameters().getOriginType()); if (vm.getOrigin() == OriginType.KVM) { VmDeviceCommonUtils.addVirtIoScsiDevice(vm.getStaticData()); } vms.add(vm); if (!vm.isDown()) { notDownVms.add(vm); } } } logNonDownVms(notDownVms); setReturnValue(vms); }
Source:
<code>public void putByteProperty(final SimpleString key, final byte value) { <START> checkCreateProperties(); <END> checkCreateProperties(); doPutValue(key, ByteValue.valueOf(value)); }</code><technical_language>i missing this a duplicate method call</technical_language>

Target:
public void putByteProperty(final SimpleString key, final byte value) { checkCreateProperties(); doPutValue(key, ByteValue.valueOf(value)); }
Source:
<code>public void metricsWithOneFilterAreFiltered() { MetricPublicationArbiter arbiter = createArbiter(ImmutableMap.of( <START> METRIC_NAME_1, ImmutableSet.of(() -> false), <END> METRIC_NAME_2, ImmutableSet.of(() -> true))); assertThat(arbiter.test(METRIC_NAME_1)).isFalse(); assertThat(arbiter.test(METRIC_NAME_2)).isTrue(); }</code><technical_language>nit: extract a constant for () -> false () -> true calls</technical_language>

Target:
public void metricsWithOneFilterAreFiltered() { MetricPublicationArbiter arbiter = createArbiter(ImmutableMap.of( METRIC_NAME_1, ImmutableSet.of(FALSE_RETURNING_FILTER), METRIC_NAME_2, ImmutableSet.of(TRUE_RETURNING_FILTER))); assertThat(arbiter.test(METRIC_NAME_1)).isFalse(); assertThat(arbiter.test(METRIC_NAME_2)).isTrue(); }
Source:
<code>private void setFwdBwdSpeed(EdgeIteratorState edge, int fwdSpeed, int bwdSpeed) { if (accessEnc.getBool(false, edge.getFlags())) { setSpeed(false, edge.getFlags(), fwdSpeed); } if (accessEnc.getBool(true, edge.getFlags())) { setSpeed(true, edge.getFlags(), bwdSpeed); } <START> } <END></code><technical_language>setSpeed method is deprecated need a approach here. Some more hints: * edge.get(accessEnc) instead accessEnc.getBool * instead of setting speed 0, set access false</technical_language>

Target:
private void setFwdBwdSpeed(EdgeIteratorState edge, int fwdSpeed, int bwdSpeed) { if (edge.get(accessEnc)) edge.set(avgSpeedEnc, fwdSpeed); if (edge.getReverse(accessEnc)) edge.setReverse(avgSpeedEnc, bwdSpeed); }
Source:
<code>public DataWord div(DataWord word) { if (word.isZero()) { <START> return this.and(ZERO); <END> } BigInteger result = value().divide(word.value()); return new DataWord(ByteUtil.copyToArray(result.and(MAX_VALUE))); }</code><technical_language>return ZERO;</technical_language>

Target:
public DataWord div(DataWord word) { if (word.isZero()) { return ZERO; } BigInteger result = value().divide(word.value()); return new DataWord(ByteUtil.copyToArray(result.and(MAX_VALUE))); }
Source:
<code>public void populateItemSetChoices(QueryPrompt queryPrompt) { <START> evaluationContext.setVariables(userAnswers); <END> ItemsetBinding itemset = queryPrompt.getItemsetBinding(); if (itemset != null) { String instanceName = itemset.nodesetRef.getInstanceName(); if (instanceName != null) { DataInstance dataInstance = evaluationContext.getInstance(instanceName); if (dataInstance == null) { throw new XPathException("Instance " + instanceName + " not found"); } IConditionExpr nodesetExpr = itemset.nodesetExpr; Vector<TreeReference> matches = nodesetExpr.evalNodeset(dataInstance, evaluationContext); if (matches == null) { throw new XPathException("Make sure the '" + instanceName + "' lookup table is available, and that its contents are accessible to the current user."); } Vector<SelectChoice> choices = new Vector<>(); QueryContext newContext = evaluationContext.getCurrentQueryContext() .checkForDerivativeContextAndReturn(matches.size()); evaluationContext.setQueryContext(newContext); for (int i = 0; i < matches.size(); i++) { choices.addElement(buildSelectChoice(matches.elementAt(i), itemset, dataInstance, null, evaluationContext, null, i)); } itemset.setChoices(choices); } else { throw new XPathException("No items found at '" + itemset.nodesetRef + "'"); } } }</code><technical_language>If change scoped values in EvaluationContext spawn a new context (evaluationContext.spawnWithCleanLifecycle()) so, want change "root" context data for future requests</technical_language>

Target:
public void populateItemSetChoices(QueryPrompt queryPrompt) { EvaluationContext evalContextWithAnswers = evaluationContext.spawnWithCleanLifecycle(); evalContextWithAnswers.setVariables(userAnswers); ItemSetUtils.populateDynamicChoices(queryPrompt.getItemsetBinding(), evalContextWithAnswers); }
Source:
<code>public SubTabDiskGeneralView(DetailModelProvider<DiskListModel, DiskGeneralModel> modelProvider) { super(modelProvider); formPanel = new GeneralFormPanel(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); driver.initialize(this); generateIds(); formBuilder = new FormBuilder(formPanel, 1, 8); formBuilder.addFormItem(new FormItem(constants.aliasDisk(), alias, 0, 0)); formBuilder.addFormItem(new FormItem(constants.descriptionDisk(), description, 1, 0)); formBuilder.addFormItem(new FormItem(constants.idDisk(), diskId, 2, 0)); formBuilder.addFormItem(new FormItem(constants.diskAlignment(), alignment, 3, 0)); formBuilder.addFormItem(new FormItem(constants.lunIdSanStorage(), lunId, 4, 0) { @Override public boolean getIsAvailable() { return getDetailModel().isLun(); } }); formBuilder.addFormItem(new FormItem(constants.diskProfile(), diskProfileName, 5, 0) { @Override public boolean getIsAvailable() { return !getDetailModel().isLun(); } }); formBuilder.addFormItem(new FormItem(constants.quota(), quotaName, 6, 0) { @Override public boolean getIsAvailable() { return getDetailModel().isQuotaAvailable(); } }); <START> formBuilder.addFormItem(new FormItem(constants.wipeAfterDelete(), wipeAfterDelete, 7, 0)); <END> formBuilder.setRelativeColumnWidth(0, 3); }</code><technical_language>irrelevant for DirectLUN disks</technical_language>

Target:
public SubTabDiskGeneralView(DetailModelProvider<DiskListModel, DiskGeneralModel> modelProvider) { super(modelProvider); formPanel = new GeneralFormPanel(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); driver.initialize(this); generateIds(); formBuilder = new FormBuilder(formPanel, 1, 8); formBuilder.addFormItem(new FormItem(constants.aliasDisk(), alias, 0, 0)); formBuilder.addFormItem(new FormItem(constants.descriptionDisk(), description, 1, 0)); formBuilder.addFormItem(new FormItem(constants.idDisk(), diskId, 2, 0)); formBuilder.addFormItem(new FormItem(constants.diskAlignment(), alignment, 3, 0)); formBuilder.addFormItem(new FormItem(constants.lunIdSanStorage(), lunId, 4, 0) { @Override public boolean getIsAvailable() { return getDetailModel().isLun(); } }); formBuilder.addFormItem(new FormItem(constants.diskProfile(), diskProfileName, 5, 0) { @Override public boolean getIsAvailable() { return !getDetailModel().isLun(); } }); formBuilder.addFormItem(new FormItem(constants.quota(), quotaName, 6, 0) { @Override public boolean getIsAvailable() { return getDetailModel().isQuotaAvailable(); } }); formBuilder.addFormItem(new FormItem(constants.wipeAfterDelete(), wipeAfterDelete, 7, 0) { @Override public boolean getIsAvailable() { return getDetailModel().isImage(); } }); formBuilder.setRelativeColumnWidth(0, 3); }
Source:
<code>private @Nullable String getColorFormulaString() { Formula formula = getFormulaWithBrickField(BrickField.COLOR); FormulaElement formulaTree = formula.getFormulaTree(); <START> boolean formulaIsString = formulaTree.getElementType() == FormulaElement.ElementType.STRING; <END> return formulaIsString ? formulaTree.getValue() : null; }</code><technical_language>please replace if else construct</technical_language>

Target:
private @Nullable String getColorFormulaString() { Formula formula = getFormulaWithBrickField(BrickField.COLOR); FormulaElement formulaTree = formula.getFormulaTree(); if (formulaTree.getElementType() == FormulaElement.ElementType.STRING) { return formulaTree.getValue(); } else { return null; } }
Source:
<code>private TransientLedgerInfo getOrAddLedgerInfo(long ledgerId) { TransientLedgerInfo tli = transientLedgerInfoCache.get(ledgerId); if (tli != null) { return tli; } else { TransientLedgerInfo newTli = new TransientLedgerInfo(ledgerId, ledgerIndex); tli = transientLedgerInfoCache.putIfAbsent(ledgerId, newTli); <START> return tli != null ? tli : newTli; <END> } }</code><technical_language>close newTli</technical_language>

Target:
private TransientLedgerInfo getOrAddLedgerInfo(long ledgerId) { TransientLedgerInfo tli = transientLedgerInfoCache.get(ledgerId); if (tli != null) { return tli; } else { TransientLedgerInfo newTli = new TransientLedgerInfo(ledgerId, ledgerIndex); tli = transientLedgerInfoCache.putIfAbsent(ledgerId, newTli); if (tli != null) { newTli.close(); return tli; } else { return newTli; } } }
Source:
<code>public void addUnit(Unit unit) { if (unit == null) { return; } <START> UUID id = unit.getId(); if (id == null) { id = UUID.randomUUID(); unit.setId(id); } units.put(id, unit); <END> }</code><technical_language>suggestion if (unit.getId() == null) { unit.setId(UUID.randomUUID()); } units.put(unit.getId(), unit);</technical_language>

Target:
public void addUnit(Unit unit) { if (unit == null) { return; } if (unit.getId() == null) { unit.setId(UUID.randomUUID()); } units.put(unit.getId(), unit); }
Source:
<code>public static int compare(CharSequence left, CharSequence right) { if (left == right) { return 0; } int minLength = Math.min(left.length(), right.length()); for (int i = 0; i < minLength; i += 1) { <START> int cmp = Character.compare(left.charAt(i), right.charAt(i)); <END> if (cmp != 0) { return cmp; } } return Integer.compare(left.length(), right.length()); }</code><technical_language>Java 7 - inline. Similarly for Integer.compare</technical_language>

Target:
public static int compare(CharSequence left, CharSequence right) { if (left == right) { return 0; } int minLength = Math.min(left.length(), right.length()); for (int i = 0; i < minLength; i += 1) { int cmp = (left.charAt(i) - right.charAt(i)); if (cmp != 0) { return cmp; } } return (left.length() - right.length()); }
Source:
<code>public void setup() { openTSDBMessageFormatter = Mockito.mock(OpenTSDBMessageFormatter.class); writer = new TCollectorUDPWriter2(openTSDBMessageFormatter); outputWriter = Mockito.mock(Writer.class); result = Mockito.mock(Result.class); <START> server = ServerFixtures.dummyServer(); <END> }</code><technical_language>This instance variable inlined</technical_language>

Target:
public void setup() { openTSDBMessageFormatter = Mockito.mock(OpenTSDBMessageFormatter.class); writer = new TCollectorUDPWriter2(openTSDBMessageFormatter); outputWriter = Mockito.mock(Writer.class); result = Mockito.mock(Result.class); }
Source:
<code>private void uploadToKeyserver() { <START> long keyId = 0; <END> try { keyId = new ProviderHelper(getActivity()) .getCachedPublicKeyRing(mDataUri) .extractOrGetMasterKeyId(); } catch (PgpKeyNotFoundException e) { Log.e(Constants.TAG, "key not found!", e); } Intent uploadIntent = new Intent(getActivity(), UploadKeyActivity.class); uploadIntent.setData(mDataUri); uploadIntent.putExtra(MultiUserIdsFragment.EXTRA_KEY_IDS, new long[]{keyId}); startActivityForResult(uploadIntent, 0); }</code><technical_language>this error handled correctly</technical_language>

Target:
private void uploadToKeyserver() { long keyId; try { keyId = new ProviderHelper(getActivity()) .getCachedPublicKeyRing(mDataUri) .extractOrGetMasterKeyId(); } catch (PgpKeyNotFoundException e) { Log.e(Constants.TAG, "key not found!", e); Notify.create(getActivity(), "key not found", Style.ERROR).show(); return; } Intent uploadIntent = new Intent(getActivity(), UploadKeyActivity.class); uploadIntent.setData(mDataUri); uploadIntent.putExtra(MultiUserIdsFragment.EXTRA_KEY_IDS, new long[]{keyId}); startActivityForResult(uploadIntent, 0); }
Source:
<code>public static boolean hasSymbolicAlleles( final List<Allele> alleles ) { <START> for (int i = 0; i < alleles.size(); i++ ) { <END> if (alleles.get(i).isSymbolic()) { return true; } } return false; }</code><technical_language>if performance is critical here, I pull call size initializer repeated</technical_language>

Target:
public static boolean hasSymbolicAlleles( final List<Allele> alleles ) { for (int i = 0, size = alleles.size(); i < size; i++ ) { if (alleles.get(i).isSymbolic()) { return true; } } return false; }
Source:
<code>private void initializeDatasource(Annotation storeAnnotation) { Properties connectionProperties = new Properties(); String poolPropertyString = storeAnnotation.getElement(ANNOTATION_ELEMENT_POOL_PROPERTIES); String url = storeAnnotation.getElement(ANNOTATION_ELEMENT_URL); String username = storeAnnotation.getElement(ANNOTATION_ELEMENT_USERNAME); String password = storeAnnotation.getElement(ANNOTATION_ELEMENT_PASSWORD); if (RDBMSTableUtils.isEmpty(url) || RDBMSTableUtils.isEmpty(username) || RDBMSTableUtils.isEmpty(password)) { <START> throw new RDBMSTableException("Required parameter(s) for DB connectivity cannot be empty."); <END> } connectionProperties.setProperty("jdbcUrl", url); connectionProperties.setProperty("dataSource.user", username); connectionProperties.setProperty("dataSource.password", password); if (poolPropertyString != null) { List<String[]> poolProps = RDBMSTableUtils.processKeyValuePairs(poolPropertyString); poolProps.forEach(pair -> connectionProperties.setProperty(pair[0], pair[1])); } HikariConfig config = new HikariConfig(connectionProperties); this.dataSource = new HikariDataSource(config); }</code><technical_language>Add some context, is missing table</technical_language>

Target:
private void initializeDatasource(Annotation storeAnnotation) { Properties connectionProperties = new Properties(); String poolPropertyString = storeAnnotation.getElement(ANNOTATION_ELEMENT_POOL_PROPERTIES); String url = storeAnnotation.getElement(ANNOTATION_ELEMENT_URL); String username = storeAnnotation.getElement(ANNOTATION_ELEMENT_USERNAME); String password = storeAnnotation.getElement(ANNOTATION_ELEMENT_PASSWORD); if (RDBMSTableUtils.isEmpty(url)) { throw new RDBMSTableException("Required parameter '" + ANNOTATION_ELEMENT_URL + "' for DB " + "connectivity cannot be empty."); } if (RDBMSTableUtils.isEmpty(username)) { throw new RDBMSTableException("Required parameter '" + ANNOTATION_ELEMENT_USERNAME + "' for DB " + "connectivity cannot be empty."); } if (RDBMSTableUtils.isEmpty(password)) { throw new RDBMSTableException("Required parameter '" + ANNOTATION_ELEMENT_PASSWORD + "' for DB " + "connectivity cannot be empty."); } connectionProperties.setProperty("jdbcUrl", url); connectionProperties.setProperty("dataSource.user", username); connectionProperties.setProperty("dataSource.password", password); if (poolPropertyString != null) { List<String[]> poolProps = RDBMSTableUtils.processKeyValuePairs(poolPropertyString); poolProps.forEach(pair -> connectionProperties.setProperty(pair[0], pair[1])); } HikariConfig config = new HikariConfig(connectionProperties); this.dataSource = new HikariDataSource(config); }
Source:
<code>public Object getNegotiatedProperty(String propName) { assertComplete(); switch (propName) { case Sasl.QOP: return selectedQop.getName(); case Sasl.MAX_BUFFER: return Integer.toString(actualMaxReceiveBuffer != 0 ? actualMaxReceiveBuffer : configuredMaxReceiveBuffer); case Sasl.RAW_SEND_SIZE: return Integer.toString(maxBuffer); } <START> return super.getNegotiatedProperty(propName); <END> }</code><technical_language>superclass repeats assertComplete() call. I this PR adds value</technical_language>

Target:
public Object getNegotiatedProperty(String propName) { assertComplete(); switch (propName) { case Sasl.QOP: return selectedQop.getName(); case Sasl.MAX_BUFFER: return Integer.toString(actualMaxReceiveBuffer != 0 ? actualMaxReceiveBuffer : configuredMaxReceiveBuffer); case Sasl.RAW_SEND_SIZE: return Integer.toString(maxBuffer); } return null; }
Source:
<code>public static void fromMetastoreApiStorageDescriptor(StorageDescriptor storageDescriptor, Storage.Builder builder, String tablePartitionName) { SerDeInfo serdeInfo = storageDescriptor.getSerdeInfo(); if (serdeInfo == null) { throw new PrestoException(HIVE_INVALID_METADATA, "Table storage descriptor is missing SerDe info"); } builder.setStorageFormat(StorageFormat.createNullable(serdeInfo.getSerializationLib(), storageDescriptor.getInputFormat(), storageDescriptor.getOutputFormat())) .setLocation(nullToEmpty(storageDescriptor.getLocation())) .setBucketProperty(HiveBucketProperty.fromStorageDescriptor(storageDescriptor, tablePartitionName)) .setSkewed(storageDescriptor.isSetSkewedInfo() && storageDescriptor.getSkewedInfo().isSetSkewedColNames() && !storageDescriptor.getSkewedInfo().getSkewedColNames().isEmpty()) .setSerdeParameters(serdeInfo.getParameters() == null ? ImmutableMap.of() : serdeInfo.getParameters()) <START> .setParameters(storageDescriptor.getParameters()); <END> }</code><technical_language>null (similarly serdeInfo.getParameters()?)</technical_language>

Target:
public static void fromMetastoreApiStorageDescriptor(StorageDescriptor storageDescriptor, Storage.Builder builder, String tablePartitionName) { SerDeInfo serdeInfo = storageDescriptor.getSerdeInfo(); if (serdeInfo == null) { throw new PrestoException(HIVE_INVALID_METADATA, "Table storage descriptor is missing SerDe info"); } builder.setStorageFormat(StorageFormat.createNullable(serdeInfo.getSerializationLib(), storageDescriptor.getInputFormat(), storageDescriptor.getOutputFormat())) .setLocation(nullToEmpty(storageDescriptor.getLocation())) .setBucketProperty(HiveBucketProperty.fromStorageDescriptor(storageDescriptor, tablePartitionName)) .setSkewed(storageDescriptor.isSetSkewedInfo() && storageDescriptor.getSkewedInfo().isSetSkewedColNames() && !storageDescriptor.getSkewedInfo().getSkewedColNames().isEmpty()) .setSerdeParameters(serdeInfo.getParameters() == null ? ImmutableMap.of() : serdeInfo.getParameters()) .setParameters(storageDescriptor.getParameters() == null ? ImmutableMap.of() : storageDescriptor.getParameters()); }
Source:
<code>public ExpiredObject getExpiredObject(String key) { String expiredObjectType = (String) redisProvider.get(key); if(!Strings.isNullOrEmpty(expiredObjectType)){ ExpiredObject expiredObject = new ExpiredObject(); expiredObject.setKey(key); <START> expiredObject.setValue(key); <END> expiredObject.setType(ExpiredObjectType.fromValue(expiredObjectType)); return expiredObject; } return null; }</code><technical_language>of object, type value</technical_language>

Target:
public ExpiredObject getExpiredObject(String key) { String value = (String) redisProvider.get(key); if (!Strings.isNullOrEmpty(value)) { ExpiredObject expiredObjectFromDb = null; try { expiredObjectFromDb = Jackson2.createJsonMapper().readValue(value, ExpiredObject.class); } catch (IOException e) { LOG.error("Error in assigning json value to ExpiredObject value attribute.", e); expiredObjectFromDb = new ExpiredObject(); } ExpiredObject expiredObject = new ExpiredObject(key, expiredObjectFromDb.getType(), expiredObjectFromDb.getCreatedAt(), expiredObjectFromDb.getExpiredAt()); return expiredObject; } return null; }
Source:
<code>protected void writeEntityBody(Annotation entity, JsonGenerator jg) throws IOException { jg.writeStringField("id", entity.getId()); jg.writeStringField("color", entity.getColor()); String date = null; if (entity.getDate() != null) { date = entity.getDate().toInstant().toString(); } jg.writeStringField("date", date); jg.writeStringField("flags", entity.getFlags()); jg.writeStringField("name", entity.getName()); jg.writeStringField("documentId", entity.getDocumentId()); jg.writeStringField("xpath", entity.getXpath()); jg.writeStringField("lastModifier", entity.getLastModifier()); jg.writeNumberField("page", entity.getPage()); <START> jg.writeStringField("position", entity.getPosition()); <END> String creationDate = null; if (entity.getCreationDate() != null) { creationDate = entity.getCreationDate().toInstant().toString(); } jg.writeStringField("creationDate", creationDate); jg.writeNumberField("opacity", entity.getOpacity()); jg.writeStringField("subject", entity.getSubject()); jg.writeStringField("security", entity.getSecurity()); }</code><technical_language>constants for JSON field names, share reader writer</technical_language>

Target:
protected void writeEntityBody(Annotation entity, JsonGenerator jg) throws IOException { jg.writeStringField(ANNOTATION_ID, entity.getId()); jg.writeStringField(ANNOTATION_COLOR, entity.getColor()); String date = null; if (entity.getDate() != null) { date = entity.getDate().toInstant().toString(); } jg.writeStringField(ANNOTATION_DATE, date); jg.writeStringField(ANNOTATION_FLAGS, entity.getFlags()); jg.writeStringField(ANNOTATION_NAME, entity.getName()); jg.writeStringField(ANNOTATION_DOCUMENT_ID, entity.getDocumentId()); jg.writeStringField(ANNOTATION_XPATH, entity.getXpath()); jg.writeStringField(ANNOTATION_LAST_MODIFIER, entity.getLastModifier()); jg.writeNumberField(ANNOTATION_PAGE, entity.getPage()); jg.writeStringField(ANNOTATION_POSITION, entity.getPosition()); String creationDate = null; if (entity.getCreationDate() != null) { creationDate = entity.getCreationDate().toInstant().toString(); } jg.writeStringField(ANNOTATION_CREATION_DATE, creationDate); jg.writeNumberField(ANNOTATION_OPACITY, entity.getOpacity()); jg.writeStringField(ANNOTATION_SUBJECT, entity.getSubject()); jg.writeStringField(ANNOTATION_SECURITY, entity.getSecurity()); }
Source:
<code>public static long saturatedAdd(long a, long b) { long naiveSum = a + b; <START> if ((a ^ b) < 0 || (a ^ naiveSum) >= 0) { <END> return naiveSum; } return Long.MAX_VALUE + ((naiveSum >>> (Long.SIZE - 1)) ^ 1); }</code><technical_language>a bit worried this change. I this code imported Guava</technical_language>

Target:
public static long saturatedAdd(long a, long b) { long naiveSum = a + b; if ((a ^ b) < 0 | (a ^ naiveSum) >= 0) { return naiveSum; } return Long.MAX_VALUE + ((naiveSum >>> (Long.SIZE - 1)) ^ 1); }
Source:
<code><START> public String getUrl() { <END> return client.url(); }</code><technical_language>latest today's discussion: return URL</technical_language>

Target:
public URL getUrl() { try { return new URL(client.url()); } catch (MalformedURLException ex) { throw new IllegalStateException("Queue URL is malformed"); } }
Source:
<code><START> public static void loadDclassSharedObject() throws IOException { <END> try { if (OS.contains("mac")) { System.load("/usr/local/lib/libdclassjni.0.dylib"); } else if (OS.contains("nix") || OS.contains("nux") || OS.contains("aix")) { try { System.loadLibrary("dclassjni"); } catch(Exception e) { System.err.println("Error: " + e); System.exit(-1); }; } else { System.err.println("OS not supported."); System.exit(-1); } } catch (UnsatisfiedLinkError e) { File f = new File("/usr/lib/libdclassjni.so"); System.err.println("/usr/lib/libdclassjni.so exists: " + f.exists()); System.err.println("/usr/lib/libdclassjni.so is readable: " + f.canRead()); System.err.println("Native code library failed to load.\n" + e); e.printStackTrace(); } }</code><technical_language>changing exposed contract rename file, fix visibility of this function well? I visibility is copied location, leave public well. provide a separate patch set for then</technical_language>

Target:
public static void loadDclassSharedObject() throws IOException { try { if (OS.contains("mac")) { System.load("/usr/local/lib/libdclassjni.0.dylib"); } else if (OS.contains("nix") || OS.contains("nux") || OS.contains("aix")) { try { System.loadLibrary("dclassjni"); } catch(Exception e) { System.err.println("Error: " + e); System.exit(-1); }; } else { System.err.println("OS not supported."); System.exit(-1); } } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load.\n" + e); e.printStackTrace(); } }
Source:
<code>public ResponseEntity<Problem> handleInvalidStreamId(final InvalidStreamIdException ex, final NativeWebRequest request) { <START> LOG.warn("Stream id is not found", ex.getStreamId(), ex.getMessage()); <END> return Responses.create(MoreStatus.UNPROCESSABLE_ENTITY, ex.getMessage(), request); }</code><technical_language>@lmontrieux Wow... Strange. I in this manner need add addional log message</technical_language>

Target:
public ResponseEntity<Problem> handleInvalidStreamId(final InvalidStreamIdException ex, final NativeWebRequest request) { LOG.warn("Stream id is not found: {}", ex.getStreamId(), ex.getMessage()); return Responses.create(MoreStatus.UNPROCESSABLE_ENTITY, ex.getMessage(), request); }
Source:
<code>public UUID createRule(UUID chainId, short ethertype) { try { UUID randId = UUID.randomUUID(); <START> Topology.Rule r = <END> Topology.Rule.getDefaultInstance() .toBuilder() .setId(UUIDUtil.toProto(randId)) .setAction(Topology.Rule.Action.ACCEPT) .setChainId(UUIDUtil.toProto(chainId)) .setDlType(ethertype) .build(); backend.store().create(r); return randId; } catch (Exception e) { throw new RuntimeException("Failed to create chain"); } }</code><technical_language>Compared before, set rule's position, is fine</technical_language>

Target:
public UUID createRule(UUID chainId, short ethertype) { try { UUID randId = UUID.randomUUID(); Topology.Rule r = Topology.Rule.getDefaultInstance() .toBuilder() .setId(UUIDUtil.toProto(randId)) .setType(Topology.Rule.Type.LITERAL_RULE) .setAction(Topology.Rule.Action.ACCEPT) .setChainId(UUIDUtil.toProto(chainId)) .setDlType(ethertype) .build(); backend.store().create(r); return randId; } catch (Exception e) { throw new RuntimeException("Failed to create chain"); } }
Source:
<code>private boolean passesGithubAuthenticationCheck(TriggerEvent event, Trigger trigger) { boolean triggerHasSecret = StringUtils.isNotEmpty(trigger.getSecret()); boolean eventHasSignature = event.getDetails().getRequestHeaders().containsKey(GITHUB_SECURE_SIGNATURE_HEADER); if (triggerHasSecret && !eventHasSignature) { <START> log.warn("Received GitEvent from Github without secure signature, for trigger configured with a secret"); <END> return false; } if (!triggerHasSecret && eventHasSignature) { log.warn("Received GitEvent from Github with secure signature, but trigger did not contain the secret"); return false; } if (!triggerHasSecret) { return true; } return hasValidGitHubSecureSignature(event, trigger); }</code><technical_language>Remove comma</technical_language>

Target:
private boolean passesGithubAuthenticationCheck(TriggerEvent event, Trigger trigger) { boolean triggerHasSecret = StringUtils.isNotEmpty(trigger.getSecret()); boolean eventHasSignature = event.getDetails().getRequestHeaders().containsKey(GITHUB_SECURE_SIGNATURE_HEADER); if (triggerHasSecret && !eventHasSignature) { log.warn("Received GitEvent from Github without secure signature for trigger configured with a secret"); return false; } if (!triggerHasSecret && eventHasSignature) { log.warn("Received GitEvent from Github with secure signature, but trigger did not contain the secret"); return false; } if (!triggerHasSecret) { return true; } return hasValidGitHubSecureSignature(event, trigger); }
Source:
<code>public WSResponse sendAndReceiveRequestsFromSolver() { this.solverInstances = new ArrayList<>(); WSResponse response = null; String resultJson; TextAnnotation processedInstance; for (TextAnnotation ta : unprocessedInstances) { response = solver.processRequest(ta); try{ resultJson = response.getBody(); processedInstance = SerializationHelper.deserializeFromJson(resultJson); } catch(Exception e){ break; } solverInstances.add(processedInstance); } <START> return response; <END> }</code><technical_language>this return response? response received solver random. return solverInstances true/false if succeeded</technical_language>

Target:
public WSResponse sendAndReceiveRequestsFromSolver() { this.solverInstances = new ArrayList<>(); WSResponse response = null; String resultJson; TextAnnotation processedInstance; for (TextAnnotation ta : unprocessedInstances) { response = learnerInterface.processRequest(ta); try{ resultJson = response.getBody(); processedInstance = SerializationHelper.deserializeFromJson(resultJson); } catch(Exception e){ break; } solverInstances.add(processedInstance); } return response; }
Source:
<code>void cancelScheduleMessage() { final String messageId = UUID.randomUUID().toString(); final String contents = "Some-contents"; final ServiceBusMessage message = TestUtils.getServiceBusMessage(contents, messageId, 0); int enqueDelayInSec = 3; <START> StepVerifier.create(sender.scheduleMessage(message, Instant.now().plusSeconds(enqueDelayInSec)) <END> .doOnSuccess(seqNumber -> sender.cancelScheduledMessage(seqNumber)) .delaySubscription(Duration.ofSeconds(enqueDelayInSec + 1)) .thenMany(receiver.receive().take(1))) .expectNoEvent(Duration.ofSeconds(5)) .verifyComplete(); }</code><technical_language>Scheduling a message part of scenario. Do part of // Arrange</technical_language>

Target:
void cancelScheduleMessage() { final String messageId = UUID.randomUUID().toString(); final String contents = "Some-contents"; final ServiceBusMessage message = TestUtils.getServiceBusMessage(contents, messageId, 0); final Instant scheduledEnqueueTime = Instant.now().plusSeconds(10); final Duration delayDuration = Duration.ofSeconds(3); final Long sequenceNumber = sender.scheduleMessage(message, scheduledEnqueueTime).block(); logger.verbose("Scheduled the message, sequence number {}.", sequenceNumber); Mono.delay(delayDuration) .then(sender.cancelScheduledMessage(sequenceNumber.longValue())) .block(); logger.verbose("Cancelled the scheduled message, sequence number {}.", sequenceNumber); StepVerifier.create(receiver.receive().take(1)) .expectNoEvent(Duration.ofSeconds(5)) .verifyComplete(); }
Source:
<code>protected void importResources(File file) { if (file.exists()) { <START> File[] files = file.listFiles(); <END> if (files != null) { for (File f : files) { importResources(f); } } else { try { URL url = file.toURI().toURL(); String parserType = getParserType(url); importFile(parserType, url); } catch (MalformedURLException e) { } } } }</code><technical_language>I know, need check if file is a directory (or a symlink a directory) first</technical_language>

Target:
public void importResources(File file) { if (file.exists()) { File[] files = file.listFiles(); if (files != null) { for (File f : files) { importResources(f); } } else { try { URL url = file.toURI().toURL(); String parserType = getParserType(url); importFile(parserType, url); } catch (MalformedURLException e) { logger.debug("Can't create a URL", e); } } } }
Source:
<code>public void recordRequest(HttpServletRequest request, boolean enabled) { if (Telemetry.isDisabled()) { return; } if (!isActivePeriod()) { return; } HttpSession session = request.getSession(false); if (session != null) { String sessionId = session.getId(); sessionsBySetting.putIfAbsent(enabled, new HashSet<>()); <START> sessionsBySetting.get(enabled).add(sessionId); <END> } }</code><technical_language>remove sessionIds for enabled is false? If enables it, disables it, sessionId is in sets it? a fix is necessarily needed in case, checking. **UPDATE: well, remove sessionId !enabled set, true false, is.**</technical_language>

Target:
public void recordRequest(HttpServletRequest request, boolean enabled) { if (Telemetry.isDisabled()) { return; } if (!isActivePeriod()) { return; } HttpSession session = request.getSession(false); if (session != null) { String sessionId = session.getId(); if (enabled) { synchronized (sessionsWithAutoRefresh) { sessionsWithAutoRefresh.add(sessionId); } } else { synchronized (sessionsWithoutAutoRefresh) { sessionsWithoutAutoRefresh.add(sessionId); } } } }
Source:
<code>private PageId getPageId(Path path) { Path parent = Preconditions.checkNotNull(path.getParent()); if (!Paths.get(mRoot).equals(parent.getParent())) { <START> return null; <END> } try { Path fileName = Preconditions.checkNotNull(path.getFileName()); Path parentName = Preconditions.checkNotNull(parent.getFileName()); long pageIndex = Long.parseLong(fileName.toString()); long fileId = Long.parseLong(parentName.toString()); return new PageId(fileId, pageIndex); } catch (NumberFormatException e) { return null; } }</code><technical_language>warn files unable recover? delete them</technical_language>

Target:
private PageId getPageId(Path path) { Matcher matcher = mPagePattern.matcher(path.toString()); if (!matcher.matches()) { return null; } try { String parentName = Preconditions.checkNotNull(matcher.group(1)); String fileName = Preconditions.checkNotNull(matcher.group(2)); long fileId = Long.parseLong(parentName); long pageIndex = Long.parseLong(fileName); return new PageId(fileId, pageIndex); } catch (NumberFormatException e) { return null; } }
Source:
<code>private void updateFeedbackParticipantComments(List<FeedbackResponseCommentAttributes> commentsToUpdate) throws EntityDoesNotExistException { for (FeedbackResponseCommentAttributes feedbackResponseComment : commentsToUpdate) { try { FeedbackResponseCommentAttributes updatedComment = logic.updateFeedbackResponseComment(feedbackResponseComment); <START> logic.putDocument(updatedComment); <END> statusToAdmin += this.getClass().getName() + ":<br>" + "Editing feedback response comment: " + feedbackResponseComment.getId() + "<br>" + "in course/feedback session: " + feedbackResponseComment.courseId + "/" + feedbackResponseComment.feedbackSessionName + "<br>" + "by: " + feedbackResponseComment.commentGiver + "<br>" + "comment text: " + feedbackResponseComment.commentText.getValue(); } catch (InvalidParametersException e) { setStatusForException(e); isError = true; } } }</code><technical_language>I so</technical_language>

Target:
private void updateFeedbackParticipantComments(List<FeedbackResponseCommentAttributes> commentsToUpdate) throws EntityDoesNotExistException { for (FeedbackResponseCommentAttributes feedbackResponseComment : commentsToUpdate) { try { FeedbackResponseCommentAttributes updatedComment = logic.updateFeedbackResponseComment(feedbackResponseComment); logic.putDocument(updatedComment); statusToAdmin += this.getClass().getName() + ":<br>" + "Editing feedback response comment: " + feedbackResponseComment.getId() + "<br>" + "in course/feedback session: " + feedbackResponseComment.courseId + "/" + feedbackResponseComment.feedbackSessionName + "<br>" + "by: " + feedbackResponseComment.commentGiver + "<br>" + "comment text: " + feedbackResponseComment.commentText.getValue(); } catch (InvalidParametersException e) { setStatusForException(e); } } }
Source:
<code>public void simpleRequest() throws Exception { Map<String, String> s = new HashMap<>(); s.put("url", "http://localhost:" + wireMockRule.port()); s.put("database", "test-db"); <START> stubFor(post(urlPathEqualTo("/write")).willReturn(aResponse().withStatus(200))); <END> InfluxDbOutputWriter writer = new InfluxDbOutputWriter(new FakeClock()); writer.postConstruct(s); writer.writeQueryResult("foo", null, 1); writer.postCollect(); verify(postRequestedFor(urlPathEqualTo("/write")) .withQueryParam("db", equalTo("test-db")) .withQueryParam("precision", equalTo("ms")) .withRequestBody(equalTo("foo value=1i 1234"))); }</code><technical_language>I love unit test HTTP stubs! takes time write helpful. Thanks</technical_language>

Target:
public void simpleRequest() throws Exception { Map<String, String> s = new HashMap<>(); s.put("url", "http://localhost:" + wireMockRule.port()); s.put("database", "test-db"); stubFor(post(urlPathEqualTo("/write")).willReturn(aResponse().withStatus(200))); InfluxDbOutputWriter writer = new InfluxDbOutputWriter(FAKE_CLOCK); writer.postConstruct(s); writer.writeQueryResult("foo", null, 1); writer.postCollect(); verify(postRequestedFor(urlPathEqualTo("/write")) .withQueryParam("db", equalTo("test-db")) .withQueryParam("precision", equalTo("ms")) .withRequestBody(equalTo("foo value=1i 1234"))); }
Source:
<code>public Folder findParentFolder(final Treeable asset, final User user, final boolean respectFrontEndPermissions) throws DotIdentifierStateException, DotDataException, DotSecurityException { Identifier id = APILocator.getIdentifierAPI().find(asset.getIdentifier()); if(id==null) return null; if(id.getParentPath()==null || ROOT_PATH.equals(id.getParentPath()) || SYSTEM_FOLDER_PATH.equals(id.getParentPath())){ return null; } Host host = APILocator.getHostAPI().find(id.getHostId(), user, respectFrontEndPermissions); <START> Folder f = folderFactory.findFolderByPath(id.getParentPath(), host); <END> if(f == null || !UtilMethods.isSet(f.getInode())) return null; if (!permissionAPI.doesUserHavePermission(f, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { final String userId = user.getUserId() != null ? user.getUserId(): ""; final String path = f.getPath() != null ? f.getPath() : id.getParentPath(); Logger.error(this, "User " + userId + " does not have permission to read Folder " + path + " Please check the folder exists."); throw new DotSecurityException("User " + userId + " does not have permission to read Folder " + path); } return f; }</code><technical_language>rename folder</technical_language>

Target:
public Folder findParentFolder(final Treeable asset, final User user, final boolean respectFrontEndPermissions) throws DotIdentifierStateException, DotDataException, DotSecurityException { Identifier id = APILocator.getIdentifierAPI().find(asset.getIdentifier()); if(id==null || id.getParentPath()==null || ROOT_PATH.equals(id.getParentPath()) || SYSTEM_FOLDER_PATH.equals(id.getParentPath())){ return null; } Host host = APILocator.getHostAPI().find(id.getHostId(), user, respectFrontEndPermissions); final Folder folder = folderFactory.findFolderByPath(id.getParentPath(), host); if(folder == null || !UtilMethods.isSet(folder.getInode())){ return null; } if (!doesUserHavePermissions(folder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { final String userId = user.getUserId() != null ? user.getUserId(): ""; final String path = folder.getPath() != null ? folder.getPath() : id.getParentPath(); Logger.error(this, "User " + userId + " does not have permission to read Folder " + path + " Please check the folder exists."); throw new DotSecurityException("User " + userId + " does not have permission to read Folder " + path); } return folder; }
Source:
<code>public InputStream open() throws IOException { final String bucket = uri.getAuthority(); final String key = GoogleUtils.extractGoogleCloudStorageObjectKey(uri); final GoogleByteSource byteSource = new GoogleByteSource(storage, bucket, key); <START> return CompressionUtils.decompress(byteSource.openStream(), uri.toString()); <END> }</code><technical_language>minor: uri.getPath() is more here, return decoded version, uri.toString() URI-encodes everything. matter for this call site, good form me</technical_language>

Target:
public InputStream open() throws IOException { final String bucket = uri.getAuthority(); final String key = GoogleUtils.extractGoogleCloudStorageObjectKey(uri); final GoogleByteSource byteSource = new GoogleByteSource(storage, bucket, key); return CompressionUtils.decompress(byteSource.openStream(), uri.getPath()); }
Source:
<code>public String getErrorMessage() { <START> return null; <END> }</code><technical_language>add some message here</technical_language>

Target:
public String getErrorMessage() { return errorMessage; }
Source:
<code>public static ConversionResult getResult(int error) { switch (error) { case 0: return CONVERSION_OK; case 1: return ILLEGAL_SEQUENCE; case 2: return OUTPUT_BUFFER_TOO_SMALL; case 3: return INCOMPLETE_SEQUENCE; case 4: return ERROR_METHOD_ID; case 5: return ERROR_ARRAY_FUNCTION_CALL; case 6: return ERROR_DESCRIPTOR; default: <START> return WEIRD_ERROR; <END> } }</code><technical_language>If this happen throw IllegalArgumentException instead</technical_language>

Target:
public static ConversionResult getResult(int error) { switch (error) { case 0: return CONVERSION_OK; case 1: return ILLEGAL_SEQUENCE; case 2: return OUTPUT_BUFFER_TOO_SMALL; case 3: return INCOMPLETE_SEQUENCE; default: throw new IllegalArgumentException(); } }
Source:
<code>public static Collection<Tile> parseTileMetrics(final File tileMetricsOutFile, final Map<Integer, File> phasingMetricsFiles, final ReadStructure readStructure, final ValidationStringency validationStringency) throws FileNotFoundException { TileMetricsOutReader tileMetricsIterator = new TileMetricsOutReader <START> (tileMetricsOutFile, 3); <END> final Collection<IlluminaTileMetrics> tileMetrics = determineLastValueForLaneTileMetricsCode(tileMetricsIterator); final Map<String, ? extends Collection<IlluminaTileMetrics>> locationToMetricsMap = partitionTileMetricsByLocation(tileMetrics); final Collection<Tile> tiles = new LinkedList<>(); for (final Map.Entry<String, ? extends Collection<IlluminaTileMetrics>> entry : locationToMetricsMap.entrySet()) { final Collection<IlluminaTileMetrics> tileRecords = entry.getValue(); final IlluminaTileMetrics record = CollectionUtil.getSoleElement(tileRecords); if (record.isClusterRecord()) { final Collection<TilePhasingValue> tilePhasingValues = getTilePhasingValues(record.getLaneTileCode(), phasingMetricsFiles, readStructure, validationStringency); tiles.add(new Tile(record.getLaneNumber(), record.getTileNumber(), tileMetricsIterator.getDensity(), record.getMetricValue(), tilePhasingValues.toArray(new TilePhasingValue[tilePhasingValues.size()]))); } } return Collections.unmodifiableCollection(tiles); }</code><technical_language>odd line wrap</technical_language>

Target:
public static Collection<Tile> parseTileMetrics(final File tileMetricsOutFile, final Map<Integer, File> phasingMetricsFiles, final ReadStructure readStructure, final ValidationStringency validationStringency) throws FileNotFoundException { TileMetricsOutReader tileMetricsIterator = new TileMetricsOutReader(tileMetricsOutFile, TileMetricsOutReader.TileMetricsVersion.THREE); final Collection<IlluminaTileMetrics> tileMetrics = determineLastValueForLaneTileMetricsCode(tileMetricsIterator); final Map<String, ? extends Collection<IlluminaTileMetrics>> locationToMetricsMap = partitionTileMetricsByLocation(tileMetrics); final Collection<Tile> tiles = new LinkedList<>(); for (final Map.Entry<String, ? extends Collection<IlluminaTileMetrics>> entry : locationToMetricsMap.entrySet()) { final Collection<IlluminaTileMetrics> tileRecords = entry.getValue(); final IlluminaTileMetrics record = CollectionUtil.getSoleElement(tileRecords); if (record.isClusterRecord()) { final Collection<TilePhasingValue> tilePhasingValues = getTilePhasingValues(record.getLaneTileCode(), phasingMetricsFiles, readStructure, validationStringency); tiles.add(new Tile(record.getLaneNumber(), record.getTileNumber(), tileMetricsIterator.getDensity(), record.getMetricValue(), tilePhasingValues.toArray(new TilePhasingValue[tilePhasingValues.size()]))); } } return Collections.unmodifiableCollection(tiles); }
Source:
<code>public void test() { Client client = new Client(); long result = client.useService(10); <START> assertTrue(result == 100 || result == -1); <END> }</code><technical_language>RemoteServiceInterface.FAILURE well. Also, create a contstant for 100 int respective tests</technical_language>

Target:
public void test() { Client client = new Client(); long result = client.useService(10); assertTrue(result == 100 || result == RemoteService.FAILURE); }
Source:
<code>private MessageHandlerNode handlerNode(String name, IntegrationConsumer consumer) { MessageChannel outputChannel = consumer.getOutputChannel(); <START> String outputChannelName = outputChannel == null ? null : outputChannel.toString(); <END> MessageHandler handler = consumer.getHandler(); return handler instanceof CompositeMessageHandler ? compositeHandler(name, consumer, (CompositeMessageHandler) handler, outputChannelName, null, false) : handler instanceof DiscardingMessageHandler ? discardingHandler(name, consumer, (DiscardingMessageHandler) handler, outputChannelName, null, false) : handler instanceof MappingMessageRouterManagement ? routingHandler(name, consumer, handler, (MappingMessageRouterManagement) handler, outputChannelName, null, false) : handler instanceof RecipientListRouterManagement ? recipientListRoutingHandler(name, consumer, handler, (RecipientListRouterManagement) handler, outputChannelName, null, false) : new MessageHandlerNode(this.nodeId.incrementAndGet(), name, handler, consumer.getInputChannel().toString(), outputChannelName); }</code><technical_language>rework this "ternary fractal" if...else! A bit complicated review IDEA is crazy refactoring :smile:</technical_language>

Target:
private MessageHandlerNode handlerNode(String name, IntegrationConsumer consumer) { MessageChannel outputChannel = consumer.getOutputChannel(); String outputChannelName = outputChannel == null ? null : outputChannel.toString(); MessageHandler handler = consumer.getHandler(); if (handler instanceof CompositeMessageHandler) { return compositeHandler(name, consumer, (CompositeMessageHandler) handler, outputChannelName, null, false); } else if (handler instanceof DiscardingMessageHandler) { return discardingHandler(name, consumer, (DiscardingMessageHandler) handler, outputChannelName, null, false); } else if (handler instanceof MappingMessageRouterManagement) { return routingHandler(name, consumer, handler, (MappingMessageRouterManagement) handler, outputChannelName, null, false); } else if (handler instanceof RecipientListRouterManagement) { return recipientListRoutingHandler(name, consumer, handler, (RecipientListRouterManagement) handler, outputChannelName, null, false); } else { return new MessageHandlerNode(this.nodeId.incrementAndGet(), name, handler, consumer.getInputChannel().toString(), outputChannelName); } }