auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testNonDeterministicPredicatePropagatesOnlyToSourceSideOfSemiJoin() { assertPlan("SELECT * FROM lineitem WHERE orderkey IN (SELECT orderkey FROM orders) AND orderkey = random(5)", anyTree( semiJoin("LINE_ORDER_KEY", "ORDERS_ORDER_KEY", "SEMI_JOIN_RESULT", anyTree( filter("LINE_ORDER_KEY = CAST(random(5) AS bigint)", tableScan("lineitem", ImmutableMap.of( "LINE_ORDER_KEY", "orderkey")))), anyTree( <START> project( END> tableScan("orders", ImmutableMap.of("ORDERS_ORDER_KEY", "orderkey"))))))); assertPlan("SELECT * FROM lineitem WHERE orderkey NOT IN (SELECT orderkey FROM orders) AND orderkey = random(5)", anyTree( semiJoin("LINE_ORDER_KEY", "ORDERS_ORDER_KEY", "SEMI_JOIN_RESULT", anyTree( filter("LINE_ORDER_KEY = CAST(random(5) AS bigint)", tableScan("lineitem", ImmutableMap.of( "LINE_ORDER_KEY", "orderkey")))), anyTree( project( tableScan("orders", ImmutableMap.of("ORDERS_ORDER_KEY", "orderkey"))))))); }</code><technical_language>do know? Filter project. com.facebook.presto.sql.planner.assertions.PlanMatchPattern#anyNot, need anyTreeNot</technical_language>

Target:
public void testNonDeterministicPredicatePropagatesOnlyToSourceSideOfSemiJoin() { assertPlan("SELECT * FROM lineitem WHERE orderkey IN (SELECT orderkey FROM orders) AND orderkey = random(5)", anyTree( semiJoin("LINE_ORDER_KEY", "ORDERS_ORDER_KEY", "SEMI_JOIN_RESULT", anyTree( filter("LINE_ORDER_KEY = CAST(random(5) AS bigint)", tableScan("lineitem", ImmutableMap.of( "LINE_ORDER_KEY", "orderkey")))), node(ExchangeNode.class, project( tableScan("orders", ImmutableMap.of("ORDERS_ORDER_KEY", "orderkey"))))))); assertPlan("SELECT * FROM lineitem WHERE orderkey NOT IN (SELECT orderkey FROM orders) AND orderkey = random(5)", anyTree( semiJoin("LINE_ORDER_KEY", "ORDERS_ORDER_KEY", "SEMI_JOIN_RESULT", anyTree( filter("LINE_ORDER_KEY = CAST(random(5) AS bigint)", tableScan("lineitem", ImmutableMap.of( "LINE_ORDER_KEY", "orderkey")))), anyTree( project( tableScan("orders", ImmutableMap.of("ORDERS_ORDER_KEY", "orderkey"))))))); }
Source:
<code>public boolean isRsMaintainer(CIString mntner) { <START> return isRsMaintainer(Sets.newHashSet(mntner)); <END> }</code><technical_language>Collections.singleton(mntner) is faster creating a new Set element</technical_language>

Target:
public boolean isRsMaintainer(CIString mntner) { return isRsMaintainer(Collections.singleton(mntner)); }
Source:
<code>public TableDefinition get(TableHandle tableHandle) { if (tableDefinitions.containsKey(tableHandle)) { return tableDefinitions.get(tableHandle); } TableHandle found = null; <START> for (TableHandle testTableHandle : tableDefinitions.keySet()) { <END> if (testTableHandle.isMoreSpecificThan(tableHandle)) { checkState(found == null, "ambiguous table handle: %s", tableHandle); found = testTableHandle; } } checkState(found != null, "no table definition for: %s", tableHandle); return tableDefinitions.get(found); }</code><technical_language>remove this implicit mechanism discussed</technical_language>

Target:
public TableDefinition get(TableHandle tableHandle) { TableDefinitionRepositoryKey tableHandleKey = asRepositoryKey(tableHandle); TableDefinitionRepositoryKey nameKey = asRepositoryKey(tableHandle.getName()); if (tableDefinitions.containsKey(tableHandleKey)) { return tableDefinitions.get(tableHandleKey); } else if (tableDefinitions.containsKey(nameKey)){ return tableDefinitions.get(nameKey); } throw new IllegalStateException("no table definition for: " + tableHandleKey); }
Source:
<code>private SBIIndex fromSAMRecords(final File bamFile, final long granularity) { final ByteArrayOutputStream out = new ByteArrayOutputStream(); <START> final SBIIndexWriter indexWriter = new SBIIndexWriter(out, granularity); <END> final BAMFileReader bamFileReader = bamFileReader(bamFile); final CloseableIterator<SAMRecord> iterator = bamFileReader.getIterator(); while (iterator.hasNext()) { processAlignment(indexWriter, iterator.next()); } indexWriter.finish(bamFileReader.getVirtualFilePointer(), bamFile.length()); return SBIIndex.load(new ByteArrayInputStream(out.toByteArray())); }</code><technical_language>TWR close reader writer (and BAOS)</technical_language>

Target:
private SBIIndex fromSAMRecords(final File bamFile, final long granularity) throws IOException { final BAMFileReader bamFileReader = bamFileReader(bamFile); try (CloseableIterator<SAMRecord> iterator = bamFileReader.getIterator(); ByteArrayOutputStream out = new ByteArrayOutputStream()) { final SBIIndexWriter indexWriter = new SBIIndexWriter(out, granularity); while (iterator.hasNext()) { processAlignment(indexWriter, iterator.next()); } indexWriter.finish(bamFileReader.getVirtualFilePointer(), bamFile.length()); return SBIIndex.load(new ByteArrayInputStream(out.toByteArray())); } }
Source:
<code>protected int findQueueIndex(File queueFile) { String queueDirName = queueFile.getParentFile().getName(); <START> return Integer.valueOf(queueDirName.substring(queueDirName.length() - 2)); <END> }</code><technical_language>Integer.parseInt</technical_language>

Target:
protected int findQueueIndex(File queueFile) { String queueDirName = queueFile.getParentFile().getName(); return Integer.parseInt(queueDirName.substring(queueDirName.length() - 2)); }
Source:
<code>public void InteractiveMaps_035_PalantirSetDecimalZoom() { InteractiveMapPageObject selectedMap = new InteractiveMapPageObject(driver); <START> selectedMap.openMap(wikiURL, 3); <END> selectedMap.verifyMapOpened(); PalantirComponentObject poi = new PalantirComponentObject(driver); PalantirContent handle = new PalantirContent(); handle = poi.setAndVerifyPlayerPosition(-40, -10, 3.4, true); poi.verifyDecimalZoomLevel(handle.success, handle.responseCode, handle.message); poi.verifyPoiNotAppearOnMap(); }</code><technical_language>Suggest move 2nd param a class variable I other tests value</technical_language>

Target:
public void InteractiveMaps_035_PalantirSetDecimalZoom() { InteractiveMapsPageObject specialMap = new InteractiveMapsPageObject(driver); InteractiveMapPageObject selectedMap = specialMap.openMap(wikiURL, PalantirContent.PALANTIR_MAP); selectedMap.verifyMapOpened(); PalantirComponentObject poi = new PalantirComponentObject(driver); PalantirContent handle = poi.setAndVerifyPlayerPosition(-40, -10, 3.4, true); poi.verifyDecimalZoomLevel(handle); poi.verifyPoiNotAppearOnMap(); }
Source:
<code>protected Object evalBody(DataInstance model, EvaluationContext evalContext, Object[] evaluatedArgs) { List<String> sortedList; if (evaluatedArgs.length == 1) { sortedList = sortSingleList(FunctionUtils.toString(evaluatedArgs[0]), true); } else if (evaluatedArgs.length == 2) { Object lastArg = evaluatedArgs[1]; <START> if (lastArg instanceof Boolean) { <END> sortedList = sortSingleList(FunctionUtils.toString(evaluatedArgs[0]), FunctionUtils.toBoolean(evaluatedArgs[1])); } else { sortedList = sortListByOtherList(FunctionUtils.toString(evaluatedArgs[0]), FunctionUtils.toString(evaluatedArgs[1]), true); } } else { sortedList = sortListByOtherList(FunctionUtils.toString(evaluatedArgs[0]), FunctionUtils.toString(evaluatedArgs[1]), FunctionUtils.toBoolean(evaluatedArgs[2])); } return listToString(sortedList); }</code><technical_language>I this behavior is potentially harmful lead issues if expression is comparing ends casting int something. If wants sort original list, include in a row, in a non-typed function spec language, method dispatch dynamically type feel a good practice</technical_language>

Target:
protected Object evalBody(DataInstance model, EvaluationContext evalContext, Object[] evaluatedArgs) { List<String> sortedList; if (evaluatedArgs.length == 1) { sortedList = sortSingleList(FunctionUtils.toString(evaluatedArgs[0]), true); } else { sortedList = sortSingleList(FunctionUtils.toString(evaluatedArgs[0]), FunctionUtils.toBoolean(evaluatedArgs[1])); } return DataUtil.listToString(sortedList); }
Source:
<code>public void loadMetaData() { try { File metaFile = FileSelector.selectFile("Select metadata file", this, ".txt"); gd.loadMetaData(metaFile); <START> System.out.println(gd.getGenomes().get(0).getAge()); <END> } catch (FileSelectorException | FileNotFoundException exception) { if (DialogUtil.confirm("Error!", "Your file was not found. Want to try again?")) { loadMetaData(); } } }</code><technical_language>sysout</technical_language>

Target:
public void loadMetaData() { try { File metaFile = FileSelector.selectFile("Select metadata file", this, ".txt"); graphDataRepository.loadMetaData(metaFile); } catch (FileSelectorException | FileNotFoundException exception) { if (DialogUtil.confirm("Error!", "Your file was not found. Want to try again?")) { loadMetaData(); } } }
Source:
<code><START> public AggregatorFactory[] getMetrics() <END> { return metrics; }</code><technical_language>Do of getters need public ? I getBytesInMemory(), others default package access</technical_language>

Target:
AggregatorFactory[] getMetrics() { return metrics; }
Source:
<code>private synchronized void updateItemsFromPanelSettings(PowerMaxBindingProvider provider, String name, PowerMaxSelectorType selector) { if (itemUpdateDisabled) { logger.debug("updateItemsFromPanelSettings(): items update disabled"); return; } if (provider == null) { for (PowerMaxBindingProvider prov : providers) { <START> updateItemsFromPanelSettings(prov, name, selector); <END> } } else { PowerMaxPanelSettings settings = PowerMaxPanelSettings.getThePanelSettings(); for (String itemName : provider.getItemNames()) { if ((name == null) || itemName.equals(name)) { State itemState = null; PowerMaxBindingConfig config = provider.getConfig(itemName); Item item = config.getItem(); if ((selector == null) || (selector == config.getSelectorType())) { switch (config.getSelectorType()) { case PANEL_TYPE: if ((item instanceof StringItem) && (settings.getPanelType() != null)) { itemState = new StringType(settings.getPanelType().getLabel()); } break; case PANEL_SERIAL: if ((item instanceof StringItem) && (settings.getPanelSerial() != null)) { itemState = new StringType(settings.getPanelSerial()); } break; case PANEL_EPROM: if ((item instanceof StringItem) && (settings.getPanelEprom() != null)) { itemState = new StringType(settings.getPanelEprom()); } break; case PANEL_SOFTWARE: if ((item instanceof StringItem) && (settings.getPanelSoftware() != null)) { itemState = new StringType(settings.getPanelSoftware()); } break; default: break; } if (itemState != null) { eventPublisher.postUpdate(itemName, itemState); } } } } } }</code><technical_language>a null providers list, if were, stack overflow infinite recursion! :-/</technical_language>

Target:
private synchronized void updateItemsFromPanelSettings(PowerMaxBindingProvider provider, String name, PowerMaxSelectorType selector) { if (itemUpdateDisabled) { logger.debug("updateItemsFromPanelSettings(): items update disabled"); return; } if (provider == null) { for (PowerMaxBindingProvider prov : providers) { if (prov != null) { updateItemsFromPanelSettings(prov, name, selector); } } } else { PowerMaxPanelSettings settings = PowerMaxPanelSettings.getThePanelSettings(); for (String itemName : provider.getItemNames()) { if ((name == null) || itemName.equals(name)) { String value = null; PowerMaxBindingConfig config = provider.getConfig(itemName); if ((selector == null) || (selector == config.getSelectorType())) { switch (config.getSelectorType()) { case PANEL_TYPE: value = (settings.getPanelType() != null) ? settings.getPanelType().getLabel() : null; break; case PANEL_SERIAL: value = settings.getPanelSerial(); break; case PANEL_EPROM: value = settings.getPanelEprom(); break; case PANEL_SOFTWARE: value = settings.getPanelSoftware(); break; default: break; } } if (value != null) { State itemState = TypeParser.parseState(config.getAcceptedDataTypes(), value); if (itemState != null) { eventPublisher.postUpdate(itemName, itemState); } } } } } }
Source:
<code>@NonNull public PreparedPutContentValues prepare() { <START> Checks.checkNotNull(putResolver, "Please specify put resolver"); <END> return new PreparedPutContentValues( storIOSQLiteDb, putResolver, contentValues ); }</code><technical_language>Static import</technical_language>

Target:
@NonNull public PreparedPutContentValues prepare() { checkNotNull(putResolver, "Please specify put resolver"); return new PreparedPutContentValues( storIOSQLiteDb, putResolver, contentValues ); }
Source:
<code>public void executeNextAction(Environment environment) throws WordsProgramException { if (createdInThisFrame) { createdInThisFrame = false; } else { if (!lastCell.equals(cell)) { this.movedInTurn = true; } <START> else { <END> this.movedInTurn = false; } if (!actionQueue.isEmpty()) { while (actionQueue.peek().isExpandable()) { Action action = actionQueue.pop(); actionQueue.addAll(0, action.expand(this, environment)); if (actionQueue.isEmpty()) { lastAction = new WaitAction(environment.getCurrentScope()); return; } } Action action = actionQueue.pop(); lastAction = action; lastCell = new Position(cell); action.execute(this, environment); if (!lastCell.equals(cell)) { this.movedInTurn = true; } } else { lastAction = new WaitAction(environment.getCurrentScope()); } } lastCell = new Position(cell); }</code><technical_language>style guide here. :-)</technical_language>

Target:
public void executeNextAction(Environment environment) throws WordsProgramException { if (createdInThisFrame) { createdInThisFrame = false; } else { if (!actionQueue.isEmpty()) { while (actionQueue.peek().isExpandable()) { Action action = actionQueue.pop(); actionQueue.addAll(0, action.expand(this, environment)); if (actionQueue.isEmpty()) { lastAction = new WaitAction(environment.getCurrentScope()); return; } } Action action = actionQueue.pop(); lastAction = action; action.execute(this, environment); } else { lastAction = new WaitAction(environment.getCurrentScope()); } } }
Source:
<code>private void connectAndQueryTopology() throws LogReplicationDiscoveryServiceException { for (int retry=0; retry < CLUSTER_MANAGER_CONNECT_RETRIES; retry++) { try { log.info("Connecting to Cluster Manager adapter..."); <START> clusterManagerAdapter.setCorfuReplicationDiscoveryService(this); <END> log.info("Fetch topology from Cluster Manager..."); TopologyConfigurationMsg topologyMessage = clusterManagerAdapter.queryTopologyConfig(); topologyDescriptor = new TopologyDescriptor(topologyMessage); return; } catch (Exception e) { String message = "Caught exception while fetching topology. Log Replication cannot start."; log.error(message, e); Sleep.sleepUninterruptibly(Duration.ofMillis(CONNECT_SLEEP_DURATION)); } } throw new LogReplicationDiscoveryServiceException("Failed to connect and fetch topology. Abort."); }</code><technical_language>call clusterManagerAdapter.start() this point? connects remote topology provider? If implements interface this triggered</technical_language>

Target:
private void connectAndQueryTopology() throws LogReplicationDiscoveryServiceException { for (int retry=0; retry < CLUSTER_MANAGER_CONNECT_RETRIES; retry++) { try { log.info("Connecting to Cluster Manager adapter..."); clusterManagerAdapter.register(this); clusterManagerAdapter.start(); log.info("Fetch topology from Cluster Manager..."); TopologyConfigurationMsg topologyMessage = clusterManagerAdapter.queryTopologyConfig(false); topologyDescriptor = new TopologyDescriptor(topologyMessage); return; } catch (Exception e) { String message = "Caught exception while fetching topology. Log Replication cannot start."; log.error(message, e); Sleep.sleepUninterruptibly(Duration.ofMillis(CONNECT_SLEEP_DURATION)); } } throw new LogReplicationDiscoveryServiceException("Failed to connect and fetch topology. Abort."); }
Source:
<code>public synchronized String getFieldString(int size, int decimalPlaces, Number n) { buffer.delete(0, buffer.length()); if (n != null) { double dval = n.doubleValue(); if (Double.isNaN(dval) || Double.isInfinite(dval)) { buffer.append(n.toString()); } else { numFormat.setMaximumFractionDigits(decimalPlaces); numFormat.setMinimumFractionDigits(decimalPlaces); FieldPosition fp = new FieldPosition(NumberFormat.FRACTION_FIELD); numFormat.format(n, buffer, fp); <START> if (fp.getBeginIndex() >= size) { <END> buffer.delete(0, buffer.length()); buffer.append(n.toString()); if (buffer.length() > size) { throw new IllegalArgumentException("Value "+n+" cannot be represented in size " + size); } } } } int diff = size - buffer.length(); if (diff > 0) { buffer.insert(0, emptyString.substring(0, diff)); } else if (diff < 0) { buffer.setLength(size); } return buffer.toString(); }</code><technical_language>This is invalid afraid, while original dbf specification is hard find, pretty allow for exponential notification. Checked shapelib does, if a number is long, truncated</technical_language>

Target:
public String getFieldString(int size, int decimalPlaces, Number n) { buffer.delete(0, buffer.length()); if (n != null) { double dval = n.doubleValue(); if (Double.isNaN(dval) || Double.isInfinite(dval)) { buffer.append(n.toString()); } else { numFormat.setMaximumFractionDigits(decimalPlaces); numFormat.setMinimumFractionDigits(decimalPlaces); FieldPosition fp = new FieldPosition(NumberFormat.FRACTION_FIELD); numFormat.format(n, buffer, fp); if (fp.getBeginIndex() >= size) { buffer.delete(0, buffer.length()); buffer.append(n.toString()); if (buffer.length() > size) { logger.logp(Level.WARNING, this.getClass().getName(), "getFieldString", "Writing DBF data, value {0} cannot be represented in size {1,number}", new Object[] {n, size}); if ( ! swallowFieldSizeErrors) { throw new IllegalArgumentException("Value "+n+" cannot be represented in size " + size); } } } } } int diff = size - buffer.length(); if (diff > 0) { buffer.insert(0, emptyString.substring(0, diff)); } else if (diff < 0) { buffer.setLength(size); } return buffer.toString(); }
Source:
<code>protected void executeCommand() { final List<LUNs> lunsFromVgInfo = getLunsFromVgInfo(); final List<LUNs> lunsFromDb = lunDao.getAllForVolumeGroup(getStorageDomain().getStorage()); Map<LunHandler, List<LUNs>> lunsToUpdateInDb = getLunsToUpdateInDb(lunsFromVgInfo, lunsFromDb); boolean dbShouldBeUpdated = lunsToUpdateInDb.keySet().stream().anyMatch(LunHandler::requiresDbUpdate); if (dbShouldBeUpdated) { TransactionSupport.executeInNewTransaction(() -> { updateLunsInDb(lunsToUpdateInDb); refreshLunsConnections(lunsFromVgInfo); return null; }); } <START> refreshMetadataDevicesInfo(); <END> setSucceeded(true); }</code><technical_language>change method name refreshMetadataDevicesInfoIfNeeded add if condition here</technical_language>

Target:
protected void executeCommand() { final List<LUNs> lunsFromVgInfo = getLunsFromVgInfo(); final List<LUNs> lunsFromDb = lunDao.getAllForVolumeGroup(getStorageDomain().getStorage()); Map<LunHandler, List<LUNs>> lunsToUpdateInDb = getLunsToUpdateInDb(lunsFromVgInfo, lunsFromDb); boolean dbShouldBeUpdated = lunsToUpdateInDb.keySet().stream().anyMatch(LunHandler::requiresDbUpdate); if (dbShouldBeUpdated) { TransactionSupport.executeInNewTransaction(() -> { updateLunsInDb(lunsToUpdateInDb); refreshLunsConnections(lunsFromVgInfo); return null; }); } refreshMetadataDevicesInfoIfNeeded(); setSucceeded(true); }
Source:
<code>public Filter(ResourceStore dataDirectory) { <START> Resource resource = dataDirectory.get("rules.xml"); <END> rules = RulesDao.getRules(resource.in()); resource.addListener(notify -> rules = RulesDao.getRules(resource.in())); }</code><technical_language>Is rules.xml stored in main data_dir folder? move a more meaningful subfolder? (params-extractor) give a more meaningful name rules.xml (params-extractor.xml)</technical_language>

Target:
public Filter(ResourceStore dataDirectory) { Resource resource = dataDirectory.get(RulesDao.getRulesPath()); rules = RulesDao.getRules(resource.in()); resource.addListener(notify -> rules = RulesDao.getRules(resource.in())); }
Source:
<code>public void equilateralTrianglesHaveEqualSides() throws TriangleException { Triangle triangle = new Triangle(2, 2, 2); <START> assertEquals(true, triangle.isEquilateral()); <END> }</code><technical_language>assertTrue instead in assertions :)</technical_language>

Target:
public void equilateralTrianglesHaveEqualSides() throws TriangleException { Triangle triangle = new Triangle(2, 2, 2); assertTrue(triangle.isEquilateral()); }
Source:
<code>private void removeFromIndex(String path) throws IOException { final DirCache dirc = db.lockDirCache(); final int first = dirc.findEntry(path); if (first < 0) throw new IOException("could not find entry " + path); <START> final DirCacheBuilder edit = dirc.builder(); <END> if (first > 0) edit.keep(0, first); final int next = dirc.nextEntry(first); if (next < dirc.getEntryCount()) edit.keep(next, dirc.getEntryCount() - next); if (!edit.commit()) throw new IOException("could not commit"); }</code><technical_language>DirCacheEditor easier here: DirCacheEditor edit = dirc.editor(); edit.add(new DirCacheEditor.DeletePath(path)); edit.commit(); :-)</technical_language>

Target:
private void removeFromIndex(String path) throws IOException { final DirCache dirc = db.lockDirCache(); final DirCacheEditor edit = dirc.editor(); edit.add(new DirCacheEditor.DeletePath(path)); if (!edit.commit()) throw new IOException("could not commit"); }
Source:
<code>public void setAuthenticationManager(AuthenticationManager authenticationManager) { <START> Assert.notNull(authenticationManager, "authenticationManager cannot be null"); <END> this.authenticationManager = authenticationManager; }</code><technical_language>This is making guarantees is possibly null before, do assertion here</technical_language>

Target:
public void setAuthenticationManager(AuthenticationManager authenticationManager) { this.authenticationManager = authenticationManager; }
Source:
<code>private PatchLink createLink(int index, PatchScreen.Type patchType, String before, String after) { Patch patch = patchList.get(index); String fileName = patch.getFileName(); <START> int s = fileName.indexOf(File.pathSeparator); <END> if (s >= 0) { fileName = fileName.substring(s + 1); } Key thisKey = patch.getKey(); PatchLink result = null; String linkText = before + " " + fileName + " " + after; if (patchType == PatchScreen.Type.SIDE_BY_SIDE && patch.getPatchType() == Patch.PatchType.UNIFIED) { result = new PatchLink.SideBySide(linkText, thisKey, index, this); } else { result = new PatchLink.Unified(linkText, thisKey, index, this); } return result; }</code><technical_language>lastIndexOf, in order get "A.java" out of "src/foo/bar/A.java". Also, Git paths *always* '/', Windows, need hardcode '/' here, Win32 Gerrit produces correct file path. worse, willing bet this is client UI code, compiled JavaScript, is meaning of java.io.File in JavaScript world, GWT fail convert this expression, choke, die, build work. :-)</technical_language>

Target:
private PatchLink createLink(int index, PatchScreen.Type patchType, String before, String after) { Patch patch = patchList.get(index); String fileName = patch.getFileName(); int s = fileName.lastIndexOf('/'); if (s >= 0) { fileName = fileName.substring(s + 1); } Key thisKey = patch.getKey(); String linkText = before + " " + fileName + " " + after; if (patchType == PatchScreen.Type.SIDE_BY_SIDE && patch.getPatchType() == Patch.PatchType.UNIFIED) { return new PatchLink.SideBySide(linkText, thisKey, index, this); } else { return new PatchLink.Unified(linkText, thisKey, index, this); } }
Source:
<code>public void addLinks(List<String> sourceIds, String targetId) throws DirectoryException { if (sourceIds == null || sourceIds.isEmpty()) { return; } try (MongoDBSession session = getMongoDBSession()) { MongoCollection<Document> coll = session.getCollection(collection); List<Document> newDocs = sourceIds.stream() .map(sourceId -> buildDoc(sourceId, targetId)) .filter(doc -> coll.count(doc) == 0) .collect(Collectors.toList()); <START> if(!newDocs.isEmpty()) { <END> coll.insertMany(newDocs); } } catch (MongoWriteException e) { throw new DirectoryException(e); } }</code><technical_language>Insert a space if</technical_language>

Target:
public void addLinks(List<String> sourceIds, String targetId) throws DirectoryException { if (sourceIds == null || sourceIds.isEmpty()) { return; } try (MongoDBSession session = getMongoDBSession()) { addLinks(sourceIds, targetId, session); } catch (MongoWriteException e) { throw new DirectoryException(e); } }
Source:
<code>public Builder services(ServicesConfig servicesConfig) { checkNotNull(servicesConfig); <START> if (servicesConfig != null) { <END> this.servicesConfig = servicesConfig; } return this; }</code><technical_language>need this if-statement checked line</technical_language>

Target:
public Builder services(ServicesConfig servicesConfig) { checkNotNull(servicesConfig); this.servicesConfig = servicesConfig; return this; }
Source:
<code>private ResultScanner<Row> streamRows(ReadRowsRequest request) { expandPoolIfNecessary(this.bigtableOptions.getChannelCount()); <START> Timer.Context timeContext = readRowsAsync.getRpcMetrics().timeRpc(); <END> ClientCall<ReadRowsRequest, ReadRowsResponse> readRowsCall = channelPool.newCall(BigtableGrpc.METHOD_READ_ROWS, CallOptions.DEFAULT); ResponseQueueReader responseQueueReader = new ResponseQueueReader( retryOptions.getReadPartialRowTimeoutMillis(), retryOptions.getStreamingBufferSize()); StreamObserver<ReadRowsResponse> rowMerger = new RowMerger(responseQueueReader); ClientCall.Listener<ReadRowsResponse> listener = new StreamObserverAdapter<>(readRowsCall, rowMerger); asyncUtilities.asyncServerStreamingCall(readRowsCall, request, listener, createMetadata(request.getTableName())); CancellationToken cancellationToken = createCancellationToken(readRowsCall, timeContext); return new StreamingBigtableResultScanner(responseQueueReader, cancellationToken); }</code><technical_language>nit: I inconsistent call local variables of this type I timerContext sense</technical_language>

Target:
private ResultScanner<Row> streamRows(ReadRowsRequest request) { Timer.Context timerContext = readRowsAsync.getRpcMetrics().timeRpc(); expandPoolIfNecessary(this.bigtableOptions.getChannelCount()); ClientCall<ReadRowsRequest, ReadRowsResponse> readRowsCall = channelPool.newCall(BigtableGrpc.METHOD_READ_ROWS, CallOptions.DEFAULT); return new StreamingBigtableResultScanner( createReader(request, readRowsCall), createCancellationToken(readRowsCall, timerContext)); }
Source:
<code>public SortOrder getSortOrder() { final String so = getAttribute("SO"); <START> if (so == null || so.equals("unknown")) { <END> return SortOrder.unsorted; } try { return SortOrder.valueOf(so); } catch (IllegalArgumentException e) { log.warn("Found non conforming header SO tag: "+ so + ". Treating as 'unknown'."); return SortOrder.unknown; } }</code><technical_language>get rid of so.equals("unknown") a valid value</technical_language>

Target:
public SortOrder getSortOrder() { if (sortOrder == null) { final String so = getAttribute(SORT_ORDER_TAG); if (so == null) { sortOrder = SortOrder.unsorted; } else { try { return SortOrder.valueOf(so); } catch (IllegalArgumentException e) { log.warn("Found non conforming header SO tag: " + so + ". Treating as 'unknown'."); sortOrder = SortOrder.unknown; } } } return sortOrder; }
Source:
<code>@Produces public ErrbitConfig createConfig() throws URISyntaxException { ErrbitConfig config = new ErrbitConfig(); config.setEndpoint(new URI(properties.getProperty("errbitEndpoint"))); config.setKey(properties.getProperty("errbitApiKey")); config.setEnvironmentName(properties.getProperty("errbitEnvironment")); <START> config.getApplicationBasePackages().addAll(ImmutableList.of("org.cru.godTools")); <END> return config; }</code><technical_language>I if this is a case sensitive lookup not, if is, "godTools" "godtools"</technical_language>

Target:
@Produces public ErrbitConfig createConfig() throws URISyntaxException { ErrbitConfig config = new ErrbitConfig(); config.setEndpoint(new URI(properties.getProperty("errbitEndpoint"))); config.setKey(properties.getProperty("errbitApiKey")); config.setEnvironmentName(properties.getProperty("errbitEnvironment")); config.getApplicationBasePackages().addAll(ImmutableList.of("org.cru.godtools")); return config; }
Source:
<code>public List<GerritQueryResult> queryMyReviews(IProgressMonitor monitor) throws GerritException { Version version = getCachedVersion(monitor); <START> if (version.compareTo(GERRIT_VERSION_2_6) < 0 && !restQueryAPIEnabled) { <END> try { final Account account = getAccount(monitor); AccountDashboardInfo ad = execute(monitor, new Operation<AccountDashboardInfo>() { @Override public void execute(IProgressMonitor monitor) throws GerritException { getChangeListService().forAccount(account.getId(), this); } }); List<ChangeInfo> allMyChanges = ad.getByOwner(); allMyChanges.addAll(ad.getForReview()); allMyChanges.addAll(ad.getClosed()); return convert(allMyChanges); } catch (GerritException e) { if (isNoSuchServiceError(e)) { restQueryAPIEnabled = true; } else { throw e; } } } return executeQueryRest(monitor, "owner:self OR reviewer:self"); }</code><technical_language>Please extract condition some meaningful function, e.g. hasJsonRpcAPI() lines</technical_language>

Target:
public List<GerritQueryResult> queryMyReviews(IProgressMonitor monitor) throws GerritException { if (hasJsonRpcApi(monitor) && !restQueryAPIEnabled) { try { final Account account = getAccount(monitor); AccountDashboardInfo ad = execute(monitor, new Operation<AccountDashboardInfo>() { @Override public void execute(IProgressMonitor monitor) throws GerritException { getChangeListService().forAccount(account.getId(), this); } }); List<ChangeInfo> allMyChanges = ad.getByOwner(); allMyChanges.addAll(ad.getForReview()); allMyChanges.addAll(ad.getClosed()); return convert(allMyChanges); } catch (GerritException e) { if (isNoSuchServiceError(e)) { restQueryAPIEnabled = true; } else { throw e; } } } return executeQueryRest(monitor, "owner:self OR reviewer:self"); }
Source:
<code>public void testGetWorkspaceMetacardsWithException() throws UnsupportedQueryException, SourceUnavailableException, FederationException, PersistenceException { <START> mockCatalogFrameworkQuery("123", "subject"); <END> when(catalogFramework.query(any())).thenThrow(UnsupportedQueryException.class); List<WorkspaceMetacardImpl> workspaceMetacards = workspaceService.getWorkspaceMetacards(); assertThat(workspaceMetacards, hasSize(0)); }</code><technical_language>Create a variable for ID subject. create a class variable ID subject in multiple places</technical_language>

Target:
public void testGetWorkspaceMetacardsWithException() throws UnsupportedQueryException, SourceUnavailableException, FederationException, PersistenceException { mockCatalogFrameworkQuery(TEST_ID, TEST_SUBJECT); when(catalogFramework.query(any())).thenThrow(UnsupportedQueryException.class); List<WorkspaceMetacardImpl> workspaceMetacards = workspaceServiceImpl.getWorkspaceMetacards(); assertThat(workspaceMetacards, hasSize(0)); }
Source:
<code>protected final Collection<T> sortItems(Collection<T> items) { if (items == null || comparator == null) { return items; } insertionIndex.clear(); SortedSet<T> sortedItems = new TreeSet<T>(comparator) { <START> private int counter = 0; <END> @Override public boolean add(T e) { insertionIndex.put(e, counter++); return super.add(e); } @Override public boolean remove(Object o) { insertionIndex.remove(o); return super.remove(o); } }; sortedItems.addAll(items); return sortedItems; }</code><technical_language>allAll, clear(), removeAll()? iterators? kinds of bring this out of sync. gaining this point a SortedSet a List</technical_language>

Target:
protected final Collection<T> sortItems(Collection<T> items) { if (items == null || comparator == null) { return items; } SortedSet<T> sortedItems = new TreeSet<T>(comparator) { private int nextPosition = positions.size(); @Override public boolean add(T e) { if (!positions.containsKey(e)) { positions.put(e, nextPosition++); } return super.add(e); } @Override public boolean addAll(Collection<? extends T> c) { boolean changed = false; for (T e : c) { changed |= add(e); } return changed; } }; sortedItems.addAll(items); return sortedItems; }
Source:
<code>public void stopPortForwarding() { <START> final MessageConsole console = ConsoleUtils.findMessageConsole(getMessageConsoleName()); <END> MessageConsoleStream stream = console.newMessageStream(); stream.println("Stopping port-forwarding..."); final IPortForwardable cap = PortForwardingUtils.stopPortForwarding(pod); if (cap != null) { Stream.of(cap.getPortPairs()).forEach(port -> stream.println(NLS.bind("{0} {1} -> {2}", new Object[] { port.getName(), port.getLocalPort(), port.getRemotePort() }))); } stream.println("done."); ConsoleUtils.displayConsoleView(console); firePropertyChange(PROPERTY_PORT_FORWARDING, true, getPortForwarding()); updatePortForwardingAllowed(); ConsoleUtils.deregisterConsoleListener(consoleListener); }</code><technical_language>try-catch block removed</technical_language>

Target:
public void stopPortForwarding() throws IOException { if (!PortForwardingUtils.isPortForwardingStarted(pod)) { return; } final MessageConsole console = ConsoleUtils.findMessageConsole(getMessageConsoleName()); try (final MessageConsoleStream stream = console.newMessageStream()) { stream.println("Stopping port-forwarding..."); final IPortForwardable cap = PortForwardingUtils.stopPortForwarding(pod, stream); if (cap != null) { Stream.of(cap.getPortPairs()).forEach(port -> stream.println(NLS.bind("{0} {1} -> {2}", new Object[] { port.getName(), port.getLocalPort(), port.getRemotePort() }))); } if (!PortForwardingUtils.hasPortInUse(this.ports)) { stream.println("done."); } else { stream.println( "Ports remain in use yet. Stopping ports is requested and eventually will be completed."); } ConsoleUtils.displayConsoleView(console); firePropertyChange(PROPERTY_PORT_FORWARDING, true, getPortForwarding()); updatePortForwardingAllowed(); } finally { ConsoleUtils.deregisterConsoleListener(consoleListener); } }
Source:
<code>public TSOFuture<Long> commit(long transactionId, Set<? extends CellId> cells) { TSOProto.Request.Builder builder = TSOProto.Request.newBuilder(); TSOProto.CommitRequest.Builder commitbuilder = TSOProto.CommitRequest.newBuilder(); commitbuilder.setStartTimestamp(transactionId); rowLevelWriteSet.clear(); for (CellId cell : cells) { long id; <START> if (conflictAnalysisLevel == ConflictAnalysisLevel.ROW) { <END> id = cell.getRowId(); if (rowLevelWriteSet.contains(id)) { continue; } else { rowLevelWriteSet.add(id); } } else { id = cell.getCellId(); } commitbuilder.addCellId(id); } builder.setCommitRequest(commitbuilder.build()); RequestEvent request = new RequestEvent(builder.build(), requestMaxRetries); fsm.sendEvent(request); return new ForwardingTSOFuture<>(request); }</code><technical_language>a switch enum (even 2 values)</technical_language>

Target:
public TSOFuture<Long> commit(long transactionId, Set<? extends CellId> cells) { TSOProto.Request.Builder builder = TSOProto.Request.newBuilder(); TSOProto.CommitRequest.Builder commitbuilder = TSOProto.CommitRequest.newBuilder(); commitbuilder.setStartTimestamp(transactionId); rowLevelWriteSet.clear(); for (CellId cell : cells) { long id; switch (conflictDetectionLevel) { case ROW: id = cell.getRowId(); if (rowLevelWriteSet.contains(id)) { continue; } else { rowLevelWriteSet.add(id); } break; case CELL: id = cell.getCellId(); break; default: id = 0; assert (false); } commitbuilder.addCellId(id); } builder.setCommitRequest(commitbuilder.build()); RequestEvent request = new RequestEvent(builder.build(), requestMaxRetries); fsm.sendEvent(request); return new ForwardingTSOFuture<>(request); }
Source:
<code>private DmrResponse getResponseAndWait(ResourceAddress address, String attribute) { DmrResponse response = dispatcher.execute(readAttributeOperation(address, attribute)); <START> Library.letsSleep(50); <END> return response; }</code><technical_language>Please switch order of lines 163 164 (move sleep dispatcher.execute) avoid waiting for 50ms longer is necessary avoiding non-essential loop run</technical_language>

Target:
private DmrResponse getResponseAndWait(ResourceAddress address, String attribute) { Library.letsSleep(50); DmrResponse response = dispatcher.execute(readAttributeOperation(address, attribute)); return response; }
Source:
<code>public static int computeIndex(Match match, EStructuralFeature feature, Object value, DifferenceSource side) { Comparison comparison = match.getComparison(); int result = -1; EObject matchedObject = MatchUtil.getMatchedObject(match, side); if (matchedObject != null) { IEqualityHelper equalityHelper = comparison.getEqualityHelper(); boolean hasOrigin = match.getOrigin() != null; @SuppressWarnings("unchecked") final List<Object> sideValues = (List<Object>)ReferenceUtil.safeEGet(matchedObject, feature); <START> for (int i = 0, size = sideValues.size(); i < size; i++) { <END> final Object sideObject = sideValues.get(i); if (equalityHelper.matchingValues(sideObject, value)) { break; } else if ((hasOrigin && hasDiff(match, feature, sideObject)) || hasDeleteDiff(match, feature, sideObject)) { } else { result++; } } } return result; }</code><technical_language>Style nit: do multiple affectations for for loops. This changed a for-each</technical_language>

Target:
public static int computeIndex(Match match, EStructuralFeature feature, Object value, DifferenceSource side) { Comparison comparison = match.getComparison(); int result = -1; EObject matchedObject = MatchUtil.getMatchedObject(match, side); if (matchedObject != null) { IEqualityHelper equalityHelper = comparison.getEqualityHelper(); boolean hasOrigin = match.getOrigin() != null; @SuppressWarnings("unchecked") final List<Object> sideValues = (List<Object>)ReferenceUtil.safeEGet(matchedObject, feature); for (Object sideObject : sideValues) { if (equalityHelper.matchingValues(sideObject, value)) { break; } else if ((hasOrigin && hasDiff(match, feature, sideObject)) || hasDeleteDiff(match, feature, sideObject)) { } else { result++; } } } return result; }
Source:
<code>public boolean isMemberActive() { <START> return this.getStartDate().before(new Date()) && this.getEndDate() == null; <END> }</code><technical_language>End null memebership is active depending passed in asOfDate I mentioned</technical_language>

Target:
public boolean isMemberActive() { return this.getStartDate() != null && this.getStartDate().before(new Date()) && this.getEndDate() == null; }
Source:
<code>protected void onPostExecute(OEmbed embed) { if (embed != null) { if(!isCancelled()) { mMainWebView.loadUrl(mStep.getEmded().getOembed().getURL()); <START> mMainWebView.setTag(mStep.getEmded().getOembed().getURL()); <END> } } }</code><technical_language>this DRY. String url = mStep.getEmded().getOembed().getURL(); mMainWebView.loadUrl(url); mMainWebView.setTag(url);</technical_language>

Target:
protected void onPostExecute(OEmbed embed) { if (embed != null) { if(!isCancelled()) { String url = mStep.getEmded().getOembed().getURL(); mMainWebView.loadUrl(url); mMainWebView.setTag(url); } } }
Source:
<code>static public Object getNewInstance(Class<?>[] cast, String classname, Object... params) { try { return getThrowableNewInstance(cast, classname, params); } catch (Exception e) { if (!classname.endsWith("Gui")) { <START> log.error("getNewInstance failed for {}", cast, classname, e.getClass()); <END> } } return null; }</code><technical_language>wonky here. this written following: log.error("getNewInstance failed for {}", cast, classname, e);</technical_language>

Target:
static public Object getNewInstance(Class<?>[] cast, String classname, Object... params) { try { return getThrowableNewInstance(cast, classname, params); } catch (Exception e) { log.warn("getNewInstance failed for {}", cast, classname, e.getClass()); } return null; }
Source:
<code>public void startScreencast(JsonRpcPeer peer, Page.StartScreencastRequest request) { mRequest = request; LogUtil.d("Starting screencast"); <START> if (mHandlerThread == null) { <END> mHandlerThread = new HandlerThread("Screencast Thread"); mHandlerThread.start(); } mPeer = peer; mIsRunning = true; mStream = new ByteArrayOutputStream(); mBackgroundHandler = new Handler(mHandlerThread.getLooper()); mMainHandler.postDelayed(mBitmapFetchRunnable, FRAME_DELAY); }</code><technical_language>ScreencastDispatcher supports starting, stopping, starting again. This class is in Page -- object is thrown stopScreencast() is called. need support restarting dispatcher here, code a lot simpler if assume "trash" stopScreencasting() is called</technical_language>

Target:
public void startScreencast(JsonRpcPeer peer, Page.StartScreencastRequest request) { LogUtil.d("Starting screencast"); mRequest = request; mHandlerThread = new HandlerThread("Screencast Thread"); mHandlerThread.start(); mPeer = peer; mIsRunning = true; mStream = new ByteArrayOutputStream(); mBackgroundHandler = new Handler(mHandlerThread.getLooper()); mMainHandler.postDelayed(mBitmapFetchRunnable, FRAME_DELAY); }
Source:
<code>public BlobList getInput(String content) { <START> String[] ar = StringUtils.split(content, ',', true); <END> BlobList list = new BlobList(ar.length); for (String b : ar) { list.add(BlobInputResolver.blobFromKey(b)); } return list; }</code><technical_language>Call array split rather</technical_language>

Target:
public BlobList getInput(String content) { String[] array = StringUtils.split(content, ',', true); BlobList list = new BlobList(array.length); for (String key : array) { list.add(BlobInputResolver.blobFromKey(key)); } return list; }
Source:
<code>public JobScheduler(final CoordinatorRegistryCenter regCenter, final ElasticJob elasticJob, final JobConfiguration jobConfig, final TracingConfiguration<?> tracingConfig) { this.regCenter = regCenter; elasticJobType = null; final Collection<ElasticJobListener> elasticJobListeners = jobConfig.getJobListenerTypes().stream() <START> .map(type -> ElasticJobListenerFactory.getListener(type)).collect(Collectors.toList()); <END> setUpFacade = new SetUpFacade(regCenter, jobConfig.getJobName(), elasticJobListeners); schedulerFacade = new SchedulerFacade(regCenter, jobConfig.getJobName()); jobFacade = new LiteJobFacade(regCenter, jobConfig.getJobName(), elasticJobListeners, tracingConfig); jobExecutor = null == elasticJob ? new ElasticJobExecutor(elasticJobType, jobConfig, jobFacade) : new ElasticJobExecutor(elasticJob, jobConfig, jobFacade); String jobClassName = JobClassNameProviderFactory.getProvider().getJobClassName(elasticJob); this.jobConfig = setUpFacade.setUpJobConfiguration(jobClassName, jobConfig); setGuaranteeServiceForElasticJobListeners(regCenter, elasticJobListeners); jobScheduleController = createJobScheduleController(); }</code><technical_language>I replace lambda method reference 'ElasticJobListenerFactory::getListener' is more elegant</technical_language>

Target:
public JobScheduler(final CoordinatorRegistryCenter regCenter, final ElasticJob elasticJob, final JobConfiguration jobConfig, final TracingConfiguration<?> tracingConfig) { this.regCenter = regCenter; elasticJobType = null; final Collection<ElasticJobListener> elasticJobListeners = jobConfig.getJobListenerTypes().stream() .map(ElasticJobListenerFactory::getListener).collect(Collectors.toList()); setUpFacade = new SetUpFacade(regCenter, jobConfig.getJobName(), elasticJobListeners); schedulerFacade = new SchedulerFacade(regCenter, jobConfig.getJobName()); jobFacade = new LiteJobFacade(regCenter, jobConfig.getJobName(), elasticJobListeners, tracingConfig); jobExecutor = null == elasticJob ? new ElasticJobExecutor(elasticJobType, jobConfig, jobFacade) : new ElasticJobExecutor(elasticJob, jobConfig, jobFacade); String jobClassName = JobClassNameProviderFactory.getProvider().getJobClassName(elasticJob); this.jobConfig = setUpFacade.setUpJobConfiguration(jobClassName, jobConfig); setGuaranteeServiceForElasticJobListeners(regCenter, elasticJobListeners); jobScheduleController = createJobScheduleController(); }
Source:
<code>public boolean process(final I_ESR_ImportLine line, final String message) { super.process(line, message); Check.assumeNotNull(line.getESR_Payment_Action(), "@" + ESRConstants.ERR_ESR_LINE_WITH_NO_PAYMENT_ACTION + "@"); final I_C_Invoice invoice = line.getC_Invoice(); if (invoice == null) { return true; } final PaymentId esrImportLinePaymentId = PaymentId.ofRepoIdOrNull(line.getC_Payment_ID()); final I_C_Payment payment = esrImportLinePaymentId == null ? null : paymentDAO.getById(esrImportLinePaymentId); final String trxName = trxManager.getThreadInheritedTrxName(OnTrxMissingPolicy.ReturnTrxNone); Check.assumeNotNull(payment, "Null payment for line {}", line.getESR_ImportLine_ID()); Check.errorIf(payment.getOverUnderAmt().signum() > 0, "Exces payment for line {}. Can't discount this", line.getESR_ImportLine_ID()); final Amount discount = invoiceDAO.retrieveOpenAmt(InvoiceId.ofRepoId(invoice.getC_Invoice_ID())); <START> trxManager.run(trxName, new TrxRunnable() <END> { @Override public void run(String trxName) throws Exception { InterfaceWrapperHelper.refresh(invoice, trxName); invoiceBL.discountInvoice(invoice, discount.getAsBigDecimal(), message); } }); return true; }</code><technical_language>i guess u simply runInThreadInheritedTrx</technical_language>

Target:
public boolean process(final I_ESR_ImportLine line, final String message) { super.process(line, message); Check.assumeNotNull(line.getESR_Payment_Action(), "@" + ESRConstants.ERR_ESR_LINE_WITH_NO_PAYMENT_ACTION + "@"); final I_C_Invoice invoice = line.getC_Invoice(); if (invoice == null) { return true; } final PaymentId esrImportLinePaymentId = PaymentId.ofRepoIdOrNull(line.getC_Payment_ID()); final I_C_Payment payment = esrImportLinePaymentId == null ? null : paymentDAO.getById(esrImportLinePaymentId); Check.assumeNotNull(payment, "Null payment for line {}", line.getESR_ImportLine_ID()); Check.errorIf(payment.getOverUnderAmt().signum() > 0, "Exces payment for line {}. Can't discount this", line.getESR_ImportLine_ID()); final Amount discount = invoiceDAO.retrieveOpenAmt(InvoiceId.ofRepoId(invoice.getC_Invoice_ID())); trxManager.runInThreadInheritedTrx(new TrxRunnable() { @Override public void run(String trxName) throws Exception { invoiceBL.discountInvoice(invoice, discount, payment.getDateAcct()); } }); return true; }
Source:
<code>public void send(Message message) { org.apache.camel.Message camelMsg = extract(message); if (getPhase() == null) { _exchange.setProperty(PHASE, ExchangePhase.IN); _exchange.setIn(camelMsg); getContext().setProperty(Exchange.MESSAGE_ID, camelMsg.getMessageId()); initInContentType(); } else { _exchange.setProperty(PHASE, ExchangePhase.OUT); String id = getContext().getPropertyValue(MESSAGE_ID); _exchange.setIn(camelMsg); getContext().setProperty(Exchange.RELATES_TO, id); getContext().setProperty(Exchange.MESSAGE_ID, camelMsg.getMessageId()); initOutContentType(); } <START> copyProperties(camelMsg); <END> sendInternal(); }</code><technical_language>This done. Exchange#send() is invoked for exchange, i.e. interactions of implementations bindings. implementation.camel is propagating context properties itself, this is breaking things</technical_language>

Target:
public void send(Message message) { org.apache.camel.Message camelMsg = extract(message); if (getPhase() == null) { _exchange.setProperty(PHASE, ExchangePhase.IN); _exchange.setIn(camelMsg); getContext().setProperty(Exchange.MESSAGE_ID, camelMsg.getMessageId()); initInContentType(); } else { _exchange.setProperty(PHASE, ExchangePhase.OUT); String id = getContext().getPropertyValue(MESSAGE_ID); _exchange.setIn(camelMsg); getContext().setProperty(Exchange.RELATES_TO, id); getContext().setProperty(Exchange.MESSAGE_ID, camelMsg.getMessageId()); initOutContentType(); } sendInternal(); }