auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public abstract JsonWriter beginArray() throws IOException; public abstract JsonWriter endArray() throws IOException; public abstract JsonWriter beginObject() throws IOException; public abstract JsonWriter endObject() throws IOException; public abstract JsonWriter name(String name) throws IOException; public abstract JsonWriter value(String value) throws IOException; public abstract JsonWriter nullValue() throws IOException; public abstract JsonWriter value(boolean value) throws IOException; public abstract JsonWriter value(Boolean value) throws IOException; public abstract JsonWriter value(double value) throws IOException; public abstract JsonWriter value(long value) throws IOException; public abstract JsonWriter value(Number value) throws IOException; abstract void promoteNameToValue() throws IOException; <START> public String getPath() { <END> return JsonScope.getPath(stackSize, scopes, pathNames, pathIndices); }</code><technical_language>final question</technical_language>

Target:
public abstract JsonWriter beginArray() throws IOException; public abstract JsonWriter endArray() throws IOException; public abstract JsonWriter beginObject() throws IOException; public abstract JsonWriter endObject() throws IOException; public abstract JsonWriter name(String name) throws IOException; public abstract JsonWriter value(String value) throws IOException; public abstract JsonWriter nullValue() throws IOException; public abstract JsonWriter value(boolean value) throws IOException; public abstract JsonWriter value(Boolean value) throws IOException; public abstract JsonWriter value(double value) throws IOException; public abstract JsonWriter value(long value) throws IOException; public abstract JsonWriter value(Number value) throws IOException; abstract void promoteNameToValue() throws IOException; public final String getPath() { return JsonScope.getPath(stackSize, scopes, pathNames, pathIndices); }
Source:
<code>void reserveMemory(long size, int maxSleeps) throws MemoryReservationException { long availableOrReserved = tryReserveMemory(size); if (availableOrReserved >= size) { return; } boolean interrupted = false; try { boolean refprocActive; do { try { refprocActive = JavaGcCleanerWrapper.tryRunPendingCleaners(); } catch (InterruptedException e) { interrupted = true; refprocActive = true; } availableOrReserved = tryReserveMemory(size); if (availableOrReserved >= size) { return; } } while (refprocActive); System.gc(); long sleepTime = 1; int sleeps = 0; while (true) { availableOrReserved = tryReserveMemory(size); if (availableOrReserved >= size) { return; } if (sleeps >= maxSleeps) { break; } try { if (!JavaGcCleanerWrapper.tryRunPendingCleaners()) { if (sleeps >= RETRIGGER_GC_AFTER_SLEEPS) { System.gc(); } Thread.sleep(sleepTime); sleepTime <<= 1; sleeps++; } } catch (InterruptedException e) { interrupted = true; } } throw new MemoryReservationException(String.format( <START> "Could not allocate %d bytes, only %d bytes are remaining, try to upgrade to Java 8u72 or higher", <END> size, availableOrReserved)); } finally { if (interrupted) { Thread.currentThread().interrupt(); } } }</code><technical_language>I change these; right result is ambiguous necessarily due Java version. If Java version is problem, logged a warning process started</technical_language>

Target:
void reserveMemory(long size, int maxSleeps) throws MemoryReservationException { long availableOrReserved = tryReserveMemory(size); if (availableOrReserved >= size) { return; } boolean interrupted = false; try { boolean refprocActive; do { try { refprocActive = JavaGcCleanerWrapper.tryRunPendingCleaners(); } catch (InterruptedException e) { interrupted = true; refprocActive = true; } availableOrReserved = tryReserveMemory(size); if (availableOrReserved >= size) { return; } } while (refprocActive); System.gc(); long sleepTime = 1; int sleeps = 0; while (true) { availableOrReserved = tryReserveMemory(size); if (availableOrReserved >= size) { return; } if (sleeps >= maxSleeps) { break; } try { if (!JavaGcCleanerWrapper.tryRunPendingCleaners()) { if (sleeps >= RETRIGGER_GC_AFTER_SLEEPS) { System.gc(); } Thread.sleep(sleepTime); sleepTime <<= 1; sleeps++; } } catch (InterruptedException e) { interrupted = true; } } throw new MemoryReservationException(String.format( "Could not allocate %d bytes, only %d bytes are remaining. This usually indicates " + "that you are requesting more memory than you have reserved. " + "However, when running an old JVM version it can also be caused by slow garbage collection. " + "Try to upgrade to Java 8u72 or higher if running on an old Java version.", size, availableOrReserved)); } finally { if (interrupted) { Thread.currentThread().interrupt(); } } }
Source:
<code>public void load() { <START> if (mFutureTask != null) { <END> return; } mFutureTask = new FutureTask<Models> (() -> new Models(mCol).load(loadColumn("models"))); new Thread(mFutureTask).start(); }</code><technical_language>This function potentially called simultaneously multiple threads lead a race condition, synchronized</technical_language>

Target:
public synchronized void load() { if (mFutureTask != null) { return; } mFutureTask = new FutureTask<Models> (() -> new Models(mCol).load(loadColumn("models"))); new Thread(mFutureTask).start(); }
Source:
<code>public void xlsWithOOPathTest() { KieSession kieSession = getKieSessionFromXls("oopath.xls"); <START> List<String> list = new ArrayList<>(); <END> populateKieSession(kieSession, list); int rulesFired = kieSession.fireAllRules(); assertThat(rulesFired).isEqualTo(2); verifyRuleFireResults(list); verifyQueryResults(kieSession.getQueryResults("listSafeCities")); }</code><technical_language>This test method body session creation extracted a method reused in test. E.g. testOOPathWithDTable(final KieSession session)</technical_language>

Target:
public void xlsWithOOPathTest() { final KieSession kieSession = getKieSessionFromXls("oopath.xls"); testOOPathWithDTable(kieSession); }
Source:
<code><START> public boolean isDroneConnected() { <END> return mConnectedToDrone; }</code><technical_language>a worried this method, I solution</technical_language>

Target:
public boolean isDroneConnected() { return drone.MavClient.isConnected(); }
Source:
<code>public boolean isInMaintenanceStates() { ResourceState state = getResourceState(); <START> return (state == ResourceState.Maintenance || state == ResourceState.ErrorInMaintenance || <END> state == ResourceState.PrepareForMaintenance || state == ResourceState.ErrorInPrepareForMaintenance); }</code><technical_language>This simplified Arrays().contains</technical_language>

Target:
public boolean isInMaintenanceStates() { return ResourceState.isMaintenanceState(getResourceState()); }
Source:
<code>private void printBRDALines(SourceFileCoverage sourceFile) throws IOException { for (BranchCoverage branch : sourceFile.getAllBranches()) { bufferedWriter.write(Constants.BRDA_MARKER); bufferedWriter.write(Integer.toString(branch.lineNumber())); bufferedWriter.write(Constants.DELIMITER); <START> bufferedWriter.write(branch.blockNumber().isEmpty() ? "0" : branch.blockNumber()); <END> bufferedWriter.write(Constants.DELIMITER); bufferedWriter.write(branch.branchNumber().isEmpty() ? "0" : branch.branchNumber()); bufferedWriter.write(Constants.DELIMITER); if (branch.wasExecuted()) { bufferedWriter.write(Integer.toString(branch.nrOfExecutions())); } else { bufferedWriter.write(Constants.TAKEN); } bufferedWriter.newLine(); } }</code><technical_language>is printBALines method dead code this change</technical_language>

Target:
private void printBRDALines(SourceFileCoverage sourceFile) throws IOException { for (BranchCoverage branch : sourceFile.getAllBranches()) { bufferedWriter.write(Constants.BRDA_MARKER); bufferedWriter.write(Integer.toString(branch.lineNumber())); bufferedWriter.write(Constants.DELIMITER); bufferedWriter.write(branch.blockNumber()); bufferedWriter.write(Constants.DELIMITER); bufferedWriter.write(branch.branchNumber()); bufferedWriter.write(Constants.DELIMITER); if (branch.wasExecuted()) { bufferedWriter.write(Integer.toString(branch.nrOfExecutions())); } else { bufferedWriter.write(Constants.TAKEN); } bufferedWriter.newLine(); } }
Source:
<code>void transportedUnitsAreTransferredToTheFirstNewUnit() { final Unit oldUnit = transport.create(1, player).get(0); seaZone.getUnitCollection().add(oldUnit); final List<Unit> newUnits = transport.create(2, player); final List<Unit> transportedUnits = infantry.create(1, player); seaZone.getUnitCollection().addAll(transportedUnits); transportedUnits.get(0).setTransportedBy(oldUnit); final Change changes = UnitUtils.translateAttributesToOtherUnits(oldUnit, newUnits, seaZone); gameData.performChange(changes); assertThat( <START> "Units can only be transported by one unit at a time. So the transported unit " <END> + "should be transferred to one of the new units. Since the new units is a list, the " + "first one will be selected.", transportedUnits.get(0).getTransportedBy(), is(newUnits.get(0))); }</code><technical_language>Thinking further, I speak more test cases. If more infantry transport, infantry assigned new transport? (which means in theory looped list of transported units asserted new transport. a singleton list, I not, explicitly checking list element overtly intentional. Though, I do keeping units separate in list easier follow avoids "okay, grabbing unit this list, unit is that?" (Which is a salient question for 'newUnits.get(0)', clear line transport)</technical_language>

Target:
void transportedUnitsAreTransferredToTheFirstNewUnit() { final Unit oldTransport = transport.create(1, player).get(0); seaZone.getUnitCollection().add(oldTransport); final Unit newTransport1 = transport.create(1, player).get(0); final Unit newTransport2 = transport.create(1, player).get(0); final List<Unit> transportedUnits = infantry.create(1, player); seaZone.getUnitCollection().addAll(transportedUnits); transportedUnits.get(0).setTransportedBy(oldTransport); final Change changes = UnitUtils.translateAttributesToOtherUnits( oldTransport, List.of(newTransport1, newTransport2), seaZone); gameData.performChange(changes); assertThat( "Units can only be transported by one unit at a time. So the transported unit " + "should be transferred to one of the new units. Since the new units is a list, the " + "first one will be selected and the first one is 'newTransport1'", transportedUnits.get(0).getTransportedBy(), is(newTransport1)); }
Source:
<code>public void processResult(int rc, String path, Object ctx) { <START> LOG.info("sycnOnNewSession with sessionID async return code: {}", _sessionId, rc); <END> callback(rc, path, ctx); }</code><technical_language>Do need a info log if return success? "syncOnNewSession" is accurate, "sync() call", right</technical_language>

Target:
public void processResult(int rc, String path, Object ctx) { LOG.debug("sync() call with sessionID async return code: {}", _sessionId, rc); callback(rc, path, ctx); }
Source:
<code>private static String resolveUrlTemplate(String template, String baseUrl, RelyingPartyRegistration relyingParty) { String entityId = relyingParty.getAssertingPartyDetails().getEntityId(); String registrationId = relyingParty.getRegistrationId(); Map<String, String> uriVariables = new HashMap<>(); UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl(baseUrl) .replaceQuery(null) .fragment(null) .build(); String scheme = uriComponents.getScheme(); uriVariables.put("baseScheme", scheme == null ? "" : scheme); String host = uriComponents.getHost(); uriVariables.put("baseHost", host == null ? "" : host); int port = uriComponents.getPort(); uriVariables.put("basePort", port == -1 ? "" : ":" + port); String path = uriComponents.getPath(); <START> if (StringUtils.hasLength(path)) { <END> if (path.charAt(0) != PATH_DELIMITER) { path = PATH_DELIMITER + path; } } uriVariables.put("basePath", path == null ? "" : path); uriVariables.put("baseUrl", uriComponents.toUriString()); uriVariables.put("entityId", StringUtils.hasText(entityId) ? entityId : ""); uriVariables.put("registrationId", StringUtils.hasText(registrationId) ? registrationId : ""); return UriComponentsBuilder.fromUriString(template) .buildAndExpand(uriVariables) .toUriString(); }</code><technical_language>This merged nested if</technical_language>

Target:
private static String resolveUrlTemplate(String template, String baseUrl, RelyingPartyRegistration relyingParty) { String entityId = relyingParty.getAssertingPartyDetails().getEntityId(); String registrationId = relyingParty.getRegistrationId(); Map<String, String> uriVariables = new HashMap<>(); UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl(baseUrl) .replaceQuery(null) .fragment(null) .build(); String scheme = uriComponents.getScheme(); uriVariables.put("baseScheme", scheme == null ? "" : scheme); String host = uriComponents.getHost(); uriVariables.put("baseHost", host == null ? "" : host); int port = uriComponents.getPort(); uriVariables.put("basePort", port == -1 ? "" : ":" + port); String path = uriComponents.getPath(); if (StringUtils.hasLength(path) && path.charAt(0) != PATH_DELIMITER) { path = PATH_DELIMITER + path; } uriVariables.put("basePath", path == null ? "" : path); uriVariables.put("baseUrl", uriComponents.toUriString()); uriVariables.put("entityId", StringUtils.hasText(entityId) ? entityId : ""); uriVariables.put("registrationId", StringUtils.hasText(registrationId) ? registrationId : ""); return UriComponentsBuilder.fromUriString(template) .buildAndExpand(uriVariables) .toUriString(); }
Source:
<code><START> protected static <END> IWorkbenchWindow getActiveWindow(MApplication app) { return PlatformUI.getWorkbench().getActiveWorkbenchWindow(); }</code><technical_language>is protected, package protected private</technical_language>

Target:
private static IWorkbenchWindow getActiveWindow(MApplication app) { return PlatformUI.getWorkbench().getActiveWorkbenchWindow(); }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SpatialDimFilter that = (SpatialDimFilter) o; if (bound != null ? !bound.equals(that.bound) : that.bound != null) { return false; } if (dimension != null ? !dimension.equals(that.dimension) : that.dimension != null) { return false; } <START> return Objects.equal(delimiter, that.delimiter); <END> }</code><technical_language>delimiter is non-null, delimiter.equals(that.delimiter)</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SpatialDimFilter that = (SpatialDimFilter) o; if (!bound.equals(that.bound)) { return false; } if (!dimension.equals(that.dimension)) { return false; } return delimiter.equals(that.delimiter); }
Source:
<code>public void testBatchRunOnSpecificPractitioner() { assertLinkCount(2); myEmpiProviderR4.clearEmpiLinks(null); <START> afterEmpiLatch.runWithExpectedCount(1, () -> myEmpiProviderR4.empiBatchPractitionerInstance(myPractitioner.getIdElement(), null)); <END> assertLinkCount(1); }</code><technical_language>I this syntax! demo next cdr core dev meeting</technical_language>

Target:
public void testBatchRunOnSpecificPractitioner() throws InterruptedException { myEmpiProviderR4.clearEmpiLinks(null); afterEmpiLatch.runWithExpectedCount(1, () -> myEmpiProviderR4.empiBatchPractitionerInstance(myPractitioner.getIdElement(), null)); assertLinkCount(1); }
Source:
<code>private Schema getOutputSchema(Schema inputSchema) { List<Schema.Field> fields = new ArrayList<>(inputSchema.getFields()); for (Map.Entry<String, String> entry : getFeatureListMapping().entrySet()) { <START> fields.add(Schema.Field.of(entry.getValue(), Schema.recordOf( <END> "sparseVector", Schema.Field.of("size", Schema.of(Schema.Type.INT)), Schema.Field.of("indices", Schema.arrayOf(Schema.of(Schema.Type.INT))), Schema.Field.of("vectorValues", Schema.arrayOf(Schema.of(Schema.Type.DOUBLE)))))); } return Schema.recordOf("record", fields); }</code><technical_language>VectorUtils.SPARSE_SCHEMA</technical_language>

Target:
private Schema getOutputSchema(Schema inputSchema) { List<Schema.Field> fields = new ArrayList<>(inputSchema.getFields()); for (Map.Entry<String, String> entry : getFeatureListMapping(outputColumnMapping).entrySet()) { fields.add(Schema.Field.of(entry.getValue(), VectorUtils.SPARSE_SCHEMA)); } return Schema.recordOf("record", fields); }
Source:
<code>@Override public void set(double v) { <START> if (Double.isFinite(v)) { <END> value.getCurrent().max(v); updateLastModTime(); } }</code><technical_language>max gauge do check set a regular gauge measure</technical_language>

Target:
@Override public void set(double v) { value.getCurrent().max(v); updateLastModTime(); }
Source:
<code>public boolean validateDistributedStripedReplicateRemove(GlusterVolumeType volumeType, List<GlusterBrickEntity> selectedBricks, List<GlusterBrickEntity> brickList, RemoveBrickModel removeBrickModel) { int stripeCount = removeBrickModel.getStripeCount(); int replicaCount = removeBrickModel.getReplicaCount(); if (selectedBricks.size() != stripeCount * replicaCount) { return false; <START> } <END> return true; }</code><technical_language>is remove multiple distribution groups in a single shot? If yes, is problem logic</technical_language>

Target:
public boolean validateDistributedStripedReplicateRemove(GlusterVolumeType volumeType, List<GlusterBrickEntity> selectedBricks, List<GlusterBrickEntity> brickList, RemoveBrickModel removeBrickModel) { int stripeCount = removeBrickModel.getStripeCount(); int replicaCount = removeBrickModel.getReplicaCount(); if (selectedBricks.size() % (stripeCount * replicaCount) != 0) { return false; } return true; }
Source:
<code>private void initCoverageTiles(String coverageUrl) { ClientLog.i(LOG_TAG, "initCoverageTiles: " + coverageUrl); mCoverageTilesOverlayLowZoom = new CoverageOverlay(CoverageOverlay.LowResType.LOWER_ZOOM, mRootView.getContext(), coverageUrl, mMap); mCoverageTilesOverlayHighZoom = new CoverageOverlay(CoverageOverlay.LowResType.HIGHER_ZOOM, mRootView.getContext(), coverageUrl, mMap); <START> mCoverageTilesOverlayDefaultZoom = new CoverageOverlay(mRootView.getContext(), coverageUrl, mMap); <END> }</code><technical_language>Instead of another constructor, CoverageOverlay.TileResType.UNMODIFIED_ZOOM ORIGINAL_ZOOM</technical_language>

Target:
private void initCoverageTiles(String coverageUrl) { ClientLog.i(LOG_TAG, "initCoverageTiles: " + coverageUrl); mCoverageTilesOverlayLowZoom = new CoverageOverlay(AbstractMapOverlay.TileResType.LOWER_ZOOM, mRootView.getContext(), coverageUrl, mMap); mCoverageTilesOverlayHighZoom = new CoverageOverlay(AbstractMapOverlay.TileResType.HIGHER_ZOOM, mRootView.getContext(), coverageUrl, mMap); mCoverageTilesOverlayOriginalZoom = new CoverageOverlay(AbstractMapOverlay.TileResType.ORIGINAL_ZOOM, mRootView.getContext(), coverageUrl, mMap); }
Source:
<code>if (UserGroupInformation.isSecurityEnabled()) { ZeppelinConfiguration zConf = ZeppelinConfiguration.create(); String keytab = zConf.getString( ZeppelinConfiguration.ConfVars.ZEPPELIN_SERVER_KERBEROS_KEYTAB); String principal = zConf.getString( ZeppelinConfiguration.ConfVars.ZEPPELIN_SERVER_KERBEROS_PRINCIPAL); if (StringUtils.isBlank(keytab) || StringUtils.isBlank(principal)) { throw new RuntimeException("keytab and principal can not be empty, keytab: " + keytab <START> + ", principal: " + principal); <END> } try { UserGroupInformation.loginUserFromKeytab(principal, keytab); } catch (IOException e) { throw new RuntimeException("Fail to login via keytab:" + keytab + ", principla:" + principal); } }</code><technical_language>is static Logger LOGGER created? log here</technical_language>

Target:
if (UserGroupInformation.isSecurityEnabled()) { ZeppelinConfiguration zConf = ZeppelinConfiguration.create(); String keytab = zConf.getString( ZeppelinConfiguration.ConfVars.ZEPPELIN_SERVER_KERBEROS_KEYTAB); String principal = zConf.getString( ZeppelinConfiguration.ConfVars.ZEPPELIN_SERVER_KERBEROS_PRINCIPAL); if (StringUtils.isBlank(keytab) || StringUtils.isBlank(principal)) { throw new RuntimeException("keytab and principal can not be empty, keytab: " + keytab + ", principal: " + principal); } try { UserGroupInformation.loginUserFromKeytab(principal, keytab); } catch (IOException e) { throw new RuntimeException("Fail to login via keytab:" + keytab + ", principal:" + principal, e); } }
Source:
<code>public static String encryptWithPasscode(String data, String passcode) { String encKey = null; if (ForceApp.APP != null) { encKey = ForceApp.APP.getEncryptionKeyForPasscode(passcode); } <START> return Encryptor.encrypt(data, encKey); <END> }</code><technical_language>So...no test encryption running tests</technical_language>

Target:
public static String encryptWithPasscode(String data, String passcode) { return Encryptor.encrypt(data, ForceApp.APP.getEncryptionKeyForPasscode(passcode)); }
Source:
<code>public void smokeTest() throws InterruptedException { Game game = launcher.getGame(); Player player = game.getPlayers().get(0); assertThat(game.isInProgress()).isFalse(); game.start(); assertThat(game.isInProgress()).isTrue(); assertThat(player.getScore()).isZero(); game.move(player, Direction.EAST); <START> assertThat(player.getScore()).isEqualTo(10); <END> game.move(player, Direction.WEST); assertThat(player.getScore()).isEqualTo(10); move(game, Direction.EAST, 7); assertThat(player.getScore()).isEqualTo(60); move(game, Direction.NORTH, 6); assertThat(player.getScore()).isEqualTo(120); move(game, Direction.WEST, 2); assertThat(player.getScore()).isEqualTo(120); move(game, Direction.NORTH, 2); Thread.sleep(500L); move(game, Direction.WEST, 10); move(game, Direction.EAST, 10); assertThat(player.isAlive()).isFalse(); game.stop(); assertThat(game.isInProgress()).isFalse(); }</code><technical_language>I love tests read stories. Big :+1: for AssertJ</technical_language>

Target:
void smokeTest() throws InterruptedException { Game game = launcher.getGame(); Player player = game.getPlayers().get(0); assertThat(game.isInProgress()).isFalse(); game.start(); assertThat(game.isInProgress()).isTrue(); assertThat(player.getScore()).isZero(); game.move(player, Direction.EAST); assertThat(player.getScore()).isEqualTo(10); game.move(player, Direction.WEST); assertThat(player.getScore()).isEqualTo(10); move(game, Direction.EAST, 7); assertThat(player.getScore()).isEqualTo(60); move(game, Direction.NORTH, 6); assertThat(player.getScore()).isEqualTo(120); move(game, Direction.WEST, 2); assertThat(player.getScore()).isEqualTo(120); move(game, Direction.NORTH, 2); Thread.sleep(500L); move(game, Direction.WEST, 10); move(game, Direction.EAST, 10); assertThat(player.isAlive()).isFalse(); game.stop(); assertThat(game.isInProgress()).isFalse(); }
Source:
<code>private void setListForWhiteSelection(Object treeElement) { List listItemsChecked = new ArrayList(); <START> java.util.Collections.addAll(listItemsChecked, listContentProvider.getElements(treeElement)); <END> checkedStateStore.put(treeElement, listItemsChecked); }</code><technical_language>add contructor here? List listItemsChecked = new ArrayList(Arrays.asList(listContentProvider.getElements(treeElement)));</technical_language>

Target:
private void setListForWhiteSelection(Object treeElement) { List listItemsChecked = new ArrayList(Arrays.asList(listContentProvider.getElements(treeElement))); checkedStateStore.put(treeElement, listItemsChecked); }
Source:
<code>public void loadProvider() { switch (myFhirContext.getVersion().getVersion()) { case DSTU3: myResourceProviderFactory.addSupplier(() -> { myMdmProvider = new MdmProviderDstu3(myFhirContext, myMdmControllerSvc, myMdmMatchFinderSvc, myMdmExpungeSvc, myMdmSubmitSvc); return myMdmProvider; }); break; case R4: myResourceProviderFactory.addSupplier(() -> { <START> myMdmProvider = new MdmProviderR4(myFhirContext, myMdmControllerSvc, myMdmMatchFinderSvc, myMdmExpungeSvc, myMdmSubmitSvc); <END> return myMdmProvider; }); break; default: throw new ConfigurationException("MDM not supported for FHIR version " + myFhirContext.getVersion().getVersion()); } }</code><technical_language>longer MdmProviderDStu3 MdmProviderR4</technical_language>

Target:
public void loadProvider() { switch (myFhirContext.getVersion().getVersion()) { case DSTU3: case R4: myResourceProviderFactory.addSupplier(() -> { myMdmProvider = new MdmProviderDstu3Plus(myFhirContext, myMdmControllerSvc, myMdmMatchFinderSvc, myMdmExpungeSvc, myMdmSubmitSvc); return myMdmProvider; }); break; default: throw new ConfigurationException("MDM not supported for FHIR version " + myFhirContext.getVersion().getVersion()); } }
Source:
<code>private static Map<String, Schema> getOutputSchemas(Schema inputSchema, Conf conf, FailureCollector collector) { Map<String, Schema> outputs = new HashMap<>(); if (inputSchema.getField(conf.field) == null) { <START> collector.addFailure(String.format("Field '%s' must exist in input schema.", conf.field), null) <END> .withConfigProperty(Conf.FIELD); } outputs.put(NULL_PORT, inputSchema); outputs.put(NON_NULL_PORT, conf.modifySchema ? getNonNullSchema(inputSchema, conf.field) : inputSchema); return outputs; }</code><technical_language>in input schema -> in input schema</technical_language>

Target:
private static Map<String, Schema> getOutputSchemas(Schema inputSchema, Conf conf, FailureCollector collector) { Map<String, Schema> outputs = new HashMap<>(); if (inputSchema.getField(conf.field) == null) { collector.addFailure(String.format("Field '%s' must exist in the input schema.", conf.field), null) .withConfigProperty(Conf.FIELD); } outputs.put(NULL_PORT, inputSchema); outputs.put(NON_NULL_PORT, conf.modifySchema ? getNonNullSchema(inputSchema, conf.field, collector) : inputSchema); return outputs; }
Source:
<code>public GroupStructureSynchronizationAlreadyRunningException(Group group) { <START> super(group.toString()); <END> this.group = group; }</code><technical_language>pass message group converted string</technical_language>

Target:
public GroupStructureSynchronizationAlreadyRunningException(Group group) { super("Group structure is already running for the group: " + group.toString()); this.group = group; }
Source:
<code>public ColumnWriteStoreV2( MessageType schema, PageWriteStore pageWriteStore, BloomFilterWriteStore bloomFilterWriteStore, ParquetProperties props) { <START> this.props = props; <END> this.thresholdTolerance = (long)(props.getPageSizeThreshold() * THRESHOLD_TOLERANCE_RATIO); Map<ColumnDescriptor, ColumnWriterV2> mcolumns = new TreeMap<ColumnDescriptor, ColumnWriterV2>(); for (ColumnDescriptor path : schema.getColumns()) { PageWriter pageWriter = pageWriteStore.getPageWriter(path); if (props.isBloomFilterEnabled() && props.getBloomFilterInfo() != null) { BloomFilterWriter bloomFilterWriter = bloomFilterWriteStore.getBloomFilterWriter(path); mcolumns.put(path, new ColumnWriterV2(path, pageWriter, bloomFilterWriter, props)); } else { mcolumns.put(path, new ColumnWriterV2(path, pageWriter, props)); } } this.columns = unmodifiableMap(mcolumns); this.writers = this.columns.values(); this.rowCountForNextSizeCheck = props.getMinRowCountForPageSizeCheck(); }</code><technical_language>Please check props.isBloomFilterEnabled() delegate other constructor if is true</technical_language>

Target:
public ColumnWriteStoreV2(MessageType schema, PageWriteStore pageWriteStore, BloomFilterWriteStore bloomFilterWriteStore, ParquetProperties props) { super(schema, pageWriteStore, bloomFilterWriteStore, props); }
Source:
<code>static File searchPath(final String path, final String... lookFor) { <START> if (path == null) { <END> return null; } for (final String p : path.split(File.pathSeparator)) { for (String command : lookFor) { final File e = new File(p, command); if (e.isFile()) return e.getAbsoluteFile(); } } return null; }</code><technical_language>style nit: curly braces single line blocks</technical_language>

Target:
static File searchPath(final String path, final String... lookFor) { if (path == null) return null; for (final String p : path.split(File.pathSeparator)) { for (String command : lookFor) { final File e = new File(p, command); if (e.isFile()) return e.getAbsoluteFile(); } } return null; }
Source:
<code>public static double getRangeFactor() { <START> return getConfig().getDouble("Properties.Fire.BlueFire.CooldownFactor"); <END> }</code><technical_language>Mistyped config path, Properties.Fire.BlueFire.RangeFactor</technical_language>

Target:
public static double getRangeFactor() { return getConfig().getDouble("Properties.Fire.BlueFire.RangeFactor"); }
Source:
<code>private void addTable(DescribeGlobalSObjectResult objectMetadata) { String name = objectMetadata.getName(); if (normalizeNames) { name = NameUtil.normalizeName(name); } if (!allowedToAdd(name)) { return; } Table table = metadataFactory.addTable(name); FullyQualifiedName fqn = new FullyQualifiedName("sobject", objectMetadata.getName()); table.setProperty(FQN, fqn.toString()); <START> if (isIncludeExtensionMetadata()) { <END> table.setNameInSource(objectMetadata.getName()); } tableMap.put(objectMetadata.getName(), table); table.setProperty(TABLE_CUSTOM, String.valueOf(objectMetadata.isCustom())); if (isIncludeExtensionMetadata()) { table.setProperty(TABLE_SUPPORTS_CREATE, String.valueOf(objectMetadata.isCreateable())); table.setProperty(TABLE_SUPPORTS_DELETE, String.valueOf(objectMetadata.isDeletable())); table.setProperty(TABLE_SUPPORTS_MERGE, String.valueOf(objectMetadata.isMergeable())); table.setProperty(TABLE_SUPPORTS_QUERY, String.valueOf(objectMetadata.isQueryable())); table.setProperty(TABLE_SUPPORTS_REPLICATE, String.valueOf(objectMetadata.isReplicateable())); table.setProperty(TABLE_SUPPORTS_RETRIEVE, String.valueOf(objectMetadata.isRetrieveable())); table.setProperty(TABLE_SUPPORTS_SEARCH, String.valueOf(objectMetadata.isSearchable())); } }</code><technical_language>need rest of translator logic making assumptions nameInSource. set if name (which of time)</technical_language>

Target:
private void addTable(DescribeGlobalSObjectResult objectMetadata) { String name = objectMetadata.getName(); if (normalizeNames) { name = NameUtil.normalizeName(name); } if (!allowedToAdd(name)) { return; } Table table = metadataFactory.addTable(name); FullyQualifiedName fqn = new FullyQualifiedName("sobject", objectMetadata.getName()); table.setProperty(FQN, fqn.toString()); tableMap.put(objectMetadata.getName(), table); table.setProperty(TABLE_CUSTOM, String.valueOf(objectMetadata.isCustom())); if (isIncludeExtensionMetadata()) { table.setNameInSource(objectMetadata.getName()); table.setProperty(TABLE_SUPPORTS_CREATE, String.valueOf(objectMetadata.isCreateable())); table.setProperty(TABLE_SUPPORTS_DELETE, String.valueOf(objectMetadata.isDeletable())); table.setProperty(TABLE_SUPPORTS_MERGE, String.valueOf(objectMetadata.isMergeable())); table.setProperty(TABLE_SUPPORTS_QUERY, String.valueOf(objectMetadata.isQueryable())); table.setProperty(TABLE_SUPPORTS_REPLICATE, String.valueOf(objectMetadata.isReplicateable())); table.setProperty(TABLE_SUPPORTS_RETRIEVE, String.valueOf(objectMetadata.isRetrieveable())); table.setProperty(TABLE_SUPPORTS_SEARCH, String.valueOf(objectMetadata.isSearchable())); } }
Source:
<code>private static synchronized void notifyErrorHandler(int errorCode, String errorMessage, String path) { for (SyncSession syncSession : sessions.values()) { if (path == null || path.equals(syncSession.getConfiguration().getPath())) { <START> syncSession.notifySessionError(errorCode, errorMessage); <END> } } }</code><technical_language>discussions @beeender, I believed agreed need catch exceptions in callbacks OS log logcat instead of throwing them, is close impossible C++ terminate correctly for Java session terminate app (instead of swallowed in JNI causing other crashes). other libraries RxJava similar policies</technical_language>

Target:
private static synchronized void notifyErrorHandler(int errorCode, String errorMessage, String path) { for (SyncSession syncSession : sessions.values()) { if (path == null || path.equals(syncSession.getConfiguration().getPath())) { try { syncSession.notifySessionError(errorCode, errorMessage); } catch (Exception exception) { RealmLog.error(exception); } } } }
Source:
<code>public synchronized void unregisterJob(final String jobName, final String groupName) throws SchedulerException { if (!ifJobExist(jobName, groupName)) { throw new SchedulerException( <START> "can not find job with group name: " + groupName + " in quartz."); <END> } else { this.scheduler.deleteJob(new JobKey(jobName, groupName)); } }</code><technical_language>exception needs modified a bit</technical_language>

Target:
public synchronized void unregisterJob(final String jobName, final String groupName) throws SchedulerException { checkJobExistence(jobName, groupName); this.scheduler.deleteJob(new JobKey(jobName, groupName)); }
Source:
<code>public void handleConsumeOk(String consumerTag) { super.handleConsumeOk(consumerTag); <START> log.info("Consumer tag is now " + consumerTag); <END> }</code><technical_language>debug</technical_language>

Target:
public void handleConsumeOk(String consumerTag) { super.handleConsumeOk(consumerTag); log.debug("Consumer tag is now " + consumerTag); }
Source:
<code>public void onListActionButtonClicked(@NonNull OnboardingPageView view) { <START> onboardingPageView = view; <END> getContext().startActivity(new Intent(getContext(), WikipediaLanguagesActivity.class)); }</code><technical_language>format (need more space)</technical_language>

Target:
public void onListActionButtonClicked(@NonNull OnboardingPageView view) { onboardingPageView = view; requireContext().startActivity(new Intent(getContext(), WikipediaLanguagesActivity.class)); }
Source:
<code>public Object apply(IncomingMessageEnvelope ime) { Assert.notNull(ime, "ime is null"); KV<Object, Object> keyAndMessageKV = KV.of(ime.getKey(), ime.getMessage()); SamzaSqlRelMsgMetadata metadata = <START> new SamzaSqlRelMsgMetadata(ime.getEventTime(), ime.getArrivalSystemNanoTime(),0L); <END> SamzaSqlInputMessage samzaMsg = SamzaSqlInputMessage.of(keyAndMessageKV, metadata); return samzaMsg; }</code><technical_language>Minor: Please add whitespace final argument</technical_language>

Target:
public Object apply(IncomingMessageEnvelope ime) { Assert.notNull(ime, "ime is null"); KV<Object, Object> keyAndMessageKV = KV.of(ime.getKey(), ime.getMessage()); SamzaSqlRelMsgMetadata metadata = new SamzaSqlRelMsgMetadata(ime.getEventTime(), ime.getArrivalTime()); SamzaSqlInputMessage samzaMsg = SamzaSqlInputMessage.of(keyAndMessageKV, metadata); return samzaMsg; }
Source:
<code>public void testAddRemoveDocsToDetachedCollection() { DocumentModel testWorkspace = session.createDocumentModel("/default-domain/workspaces", "testWorkspace", "Workspace"); <START> testWorkspace = session.createDocument(testWorkspace); <END> List<DocumentModel> files = createTestFiles(session, 2); collectionManager.addToNewCollection(COLLECTION_NAME, COLLECTION_DESCRIPTION, files.get(0), session); assertTrue(session.exists(new PathRef(COLLECTION_FOLDER_PATH))); final String newlyCreatedCollectionPath = COLLECTION_FOLDER_PATH + "/" + COLLECTION_NAME; DocumentRef newCollectionRef = new PathRef(newlyCreatedCollectionPath); assertTrue(session.exists(newCollectionRef)); DocumentModel collection = session.getDocument(newCollectionRef); collection.detach(true); collectionManager.addToCollection(collection, files.get(1), session); Collection collectionAdapter = collection.getAdapter(Collection.class); assertEquals(2, collectionAdapter.getCollectedDocumentIds().size()); collectionManager.removeFromCollection(collection, files.get(0), session); collectionManager.removeFromCollection(collection, files.get(1), session); assertEquals(0, collectionAdapter.getCollectedDocumentIds().size()); }</code><technical_language>Unused</technical_language>

Target:
public void testAddRemoveDocsToDetachedCollection() { List<DocumentModel> files = createTestFiles(session, 2); collectionManager.addToNewCollection(COLLECTION_NAME, COLLECTION_DESCRIPTION, files.get(0), session); assertTrue(session.exists(new PathRef(COLLECTION_FOLDER_PATH))); final String newlyCreatedCollectionPath = COLLECTION_FOLDER_PATH + "/" + COLLECTION_NAME; DocumentRef newCollectionRef = new PathRef(newlyCreatedCollectionPath); assertTrue(session.exists(newCollectionRef)); DocumentModel collection = session.getDocument(newCollectionRef); collection.detach(true); collectionManager.addToCollection(collection, files.get(1), session); Collection collectionAdapter = collection.getAdapter(Collection.class); assertEquals(2, collectionAdapter.getCollectedDocumentIds().size()); collectionManager.removeFromCollection(collection, files.get(0), session); collectionManager.removeFromCollection(collection, files.get(1), session); assertEquals(0, collectionAdapter.getCollectedDocumentIds().size()); }
Source:
<code>public void findUserByNameShouldReturnNullWhenNoUserWasFound() { given(userRepository.findByUserName(NOT_REAL_USER_NAME)).willReturn(NULL_USER_ENTITY); UserDTO result = userService.findUserByName(NOT_REAL_USER_NAME); <START> assertNull(result); <END> }</code><technical_language>userRepository invocation is verified</technical_language>

Target:
public void findUserByNameShouldReturnNullWhenNoUserWasFound() { given(userRepository.findByUserName(NOT_REAL_USER_NAME)).willReturn(NULL_USER_ENTITY); UserDTO result = userService.findUserByName(NOT_REAL_USER_NAME); then(userRepository).should().findByUserName(NOT_REAL_USER_NAME); assertNull(result); }
Source:
<code>public final String dumpConfiguration() { if (this.properties.isEmpty()) return "No configuration settings stored"; @SuppressWarnings("rawtypes") Enumeration e = this.properties.propertyNames(); <START> String response = "TSD Configuration:\n"; <END> response += "File [" + this.config_location + "]\n"; while (e.hasMoreElements()) { String key = (String) e.nextElement(); response += "Key [" + key + "] Value [" + this.properties.getProperty(key) + "]\n"; } return response; }</code><technical_language>want cumulate in a StringBuilder here, a plain String</technical_language>

Target:
public final String dumpConfiguration() { if (this.properties.isEmpty()) return "No configuration settings stored"; StringBuilder response = new StringBuilder("TSD Configuration:\n"); response.append("File [" + this.config_location + "]\n"); for (Map.Entry<String, String> entry : this.properties.entrySet()) { response.append("Key [" + entry.getKey() + "] Value ["). append(entry.getValue() + "]\n"); } return response.toString(); }
Source:
<code>private static long getChunkCacheSize(IEclipsePreferences node) { double maxSizeMb = node.getDouble(CHUNK_CACHE_SIZE_MB, CHUNK_CACHE_SIZE_MB_DEFAULT); double maxSizePercent = node.getDouble(CHUNK_CACHE_SIZE_PERCENT, CHUNK_CACHE_SIZE_PERCENT_DEFAULT); maxSizePercent = Math.max(1.0, <START> Math.min(100.0, maxSizePercent)); <END> maxSizeMb = Math.max(maxSizeMb, 1.0); long m1= (long) (Runtime.getRuntime().maxMemory() / 100.0 * maxSizePercent); return Math.min(m1, (long) (maxSizeMb * 1024.0 * 1024.0)); }</code><technical_language>I change is 50 for consistency CDT</technical_language>

Target:
private static long getChunkCacheSize(IEclipsePreferences node) { double maxSizeMb = node.getDouble(CHUNK_CACHE_SIZE_MB, CHUNK_CACHE_SIZE_MB_DEFAULT); double maxSizePercent = node.getDouble(CHUNK_CACHE_SIZE_PERCENT, CHUNK_CACHE_SIZE_PERCENT_DEFAULT); maxSizePercent = Math.max(1.0, Math.min(50.0, maxSizePercent)); maxSizeMb = Math.max(maxSizeMb, 1.0); long m1= (long) (Runtime.getRuntime().maxMemory() / 100.0 * maxSizePercent); return Math.min(m1, (long) (maxSizeMb * 1024.0 * 1024.0)); }
Source:
<code>@Override public Binding<?> getAtInjectBinding(String key, String className, ClassLoader classLoader, boolean mustHaveInjections) { try { Binding<?> result = GeneratedAdapters.initInjectAdapter(className, classLoader); if (result == null) { classLoader = (classLoader != null) ? classLoader : ClassLoader.getSystemClassLoader(); Class<?> c = classLoader.loadClass(className); if (!c.isInterface()) { result = ReflectiveAtInjectBinding.create(c, mustHaveInjections); } } return result; } catch (ClassNotFoundException e) { throw new RuntimeException("Could not find " + className + " needed for binding " + key, e); } catch (RuntimeException e) { <START> logNotFound("Binding", className, e); <END> throw e; } }</code><technical_language>log throw. do both</technical_language>

Target:
@Override public Binding<?> getAtInjectBinding(String key, String className, ClassLoader classLoader, boolean mustHaveInjections) { try { Binding<?> result = GeneratedAdapters.initInjectAdapter(className, classLoader); if (result == null) { classLoader = (classLoader != null) ? classLoader : ClassLoader.getSystemClassLoader(); Class<?> c = classLoader.loadClass(className); if (!c.isInterface()) { result = ReflectiveAtInjectBinding.create(c, mustHaveInjections); } } return result; } catch (ClassNotFoundException e) { throw new RuntimeException("Could not find " + className + " needed for binding " + key, e); } }
Source:
<code>boolean isValueNull(ByteBuffer buf, int position) { <START> return buf.get(position + NULL_OFFSET) == 1; <END> }</code><technical_language>== RHS_NULL</technical_language>

Target:
boolean isValueNull(ByteBuffer buf, int position) { return buf.get(position + NULL_OFFSET) == NullHandling.IS_NULL_BYTE; }
Source:
<code>public void testGetDocContent_longCheckpoint() throws Exception { config.overrideKey("feed.maxUrls", "5"); adaptor.init(context); Date timestamp = new Date(); Checkpoint startCheckpoint = new Checkpoint("document", timestamp, new Id("{AAAAAAAA-0000-0000-0000-000000000004}")); RecordingResponse response = new RecordingResponse(); adaptor.getDocContent( <START> new MockRequest(new DocId("pseudo/" + startCheckpoint)), response); <END> RecordingDocIdPusher pusher = (RecordingDocIdPusher) context.getDocIdPusher(); Checkpoint expectedCheckpoint = new Checkpoint("document", timestamp, new Id("{AAAAAAAA-0000-0000-0000-000000000008}")); List<Record> golden = ImmutableList.of( new Record.Builder( new DocId("guid/{AAAAAAAA-0000-0000-0000-000000000005}")) .build(), new Record.Builder( new DocId("guid/{AAAAAAAA-0000-0000-0000-000000000006}")) .build(), new Record.Builder( new DocId("guid/{AAAAAAAA-0000-0000-0000-000000000007}")) .build(), new Record.Builder( new DocId("guid/{AAAAAAAA-0000-0000-0000-000000000008}")) .build(), new Record.Builder(new DocId("pseudo/" + expectedCheckpoint)) .setCrawlImmediately(true).build()); assertEquals(golden, pusher.getRecords()); }</code><technical_language>newDocId? I tempted a subclass, called "DocId" do wrong thing. sold idea, worth pondering</technical_language>

Target:
public void testGetDocContent_longCheckpoint() throws Exception { config.overrideKey("feed.maxUrls", "5"); adaptor.init(context); Date timestamp = new Date(); Checkpoint startCheckpoint = new Checkpoint("document", timestamp, new Id("{AAAAAAAA-0000-0000-0000-000000000004}")); RecordingResponse response = new RecordingResponse(); adaptor.getDocContent( new MockRequest(newDocId(startCheckpoint)), response); Checkpoint expectedCheckpoint = new Checkpoint("document", timestamp, new Id("{AAAAAAAA-0000-0000-0000-000000000008}")); assertEquals(ImmutableList.of( new Record.Builder(newDocId("{AAAAAAAA-0000-0000-0000-000000000005}")) .build(), new Record.Builder(newDocId("{AAAAAAAA-0000-0000-0000-000000000006}")) .build(), new Record.Builder(newDocId("{AAAAAAAA-0000-0000-0000-000000000007}")) .build(), new Record.Builder(newDocId("{AAAAAAAA-0000-0000-0000-000000000008}")) .build(), new Record.Builder(newDocId(expectedCheckpoint)) .setCrawlImmediately(true).build()), getContextPusher().getRecords()); }
Source:
<code>public void setUp() throws Exception { clearView(); setVerboseBranchMode(false); repositoryFile = createProjectAndCommitToRepository(); createRemoteRepository(repositoryFile); repoView = TestUtil.showView(RepositoriesView.VIEW_ID); repoView.setFocus(); SWTBotHyperlink link = new SWTFormsBot(repoView.bot().getFinder()) .hyperlink("Add an existing local Git repository"); link.setFocus(); <START> link.pressShortcut(org.eclipse.swt.SWT.CR, org.eclipse.swt.SWT.LF); <END> bot.shell("Add Git Repositories"); bot.text().setText(repositoryFile.getPath().substring(0, repositoryFile.getPath().length() - 4)); bot.button("Search").click(); bot.waitWhile(new ICondition() { @Override public boolean test() throws Exception { return bot.tree().getAllItems().length == 0; } @Override public void init(SWTBot aBot) { } @Override public String getFailureMessage() { return "Tree wasn't populated with repository"; } }); bot.tree().getAllItems()[0].check(); bot.button(IDialogConstants.FINISH_LABEL).click(); }</code><technical_language>This fails machine DE_CH keyboard. Besides, CR-LF? Anyway, need UI add a repository view in setup. deleteAllProjects(); clearView(); repositoryFile = createProjectAndCommitToRepository(); createRemoteRepository(repositoryFile); Activator.getDefault().getRepositoryUtil().addConfiguredRepository(repositoryFile); refreshAndWait(); assertHasRepo(repositoryFile); good enough. Also, need add new imported packages in MANIFEST.MF</technical_language>

Target:
public void setUp() throws Exception { deleteAllProjects(); clearView(); repositoryFile = createProjectAndCommitToRepository(); createRemoteRepository(repositoryFile); Activator.getDefault().getRepositoryUtil() .addConfiguredRepository(repositoryFile); refreshAndWait(); assertHasRepo(repositoryFile); }
Source:
<code>private void startProcessMonitor() { this.getTaskExecutor().execute(new Runnable() { @Override public void run() { int result = Integer.MIN_VALUE; try { result = process.waitFor(); if (logger.isInfoEnabled()) { logger.info("tail process terminated with value " + result); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } finally { if (process != null) { process.destroy(); process = null; } } <START> if (isRunning()) { <END> logger.info("Restarting tail process"); runExec(); } } }); }</code><technical_language>do want this continue if thread interrupted above</technical_language>

Target:
private void startProcessMonitor() { this.getTaskExecutor().execute(new Runnable() { @Override public void run() { Process process = OSDelegatingFileTailingMessageProducer.this.process; if (process == null) { if (logger.isDebugEnabled()) { logger.debug("Process destroyed before starting process monitor"); } return; } int result = Integer.MIN_VALUE; try { if (logger.isDebugEnabled()) { logger.debug("Monitoring process " + process); } result = process.waitFor(); if (logger.isInfoEnabled()) { logger.info("tail process terminated with value " + result); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); logger.error("Interrupted - stopping adapter", e); stop(); } finally { destroyProcess(); } if (isRunning()) { if (logger.isInfoEnabled()) { logger.info("Restarting tail process in " + getMissingFileDelay() + " milliseconds"); } getRequiredTaskScheduler().schedule(new Runnable() { @Override public void run() { runExec(); } }, new Date(System.currentTimeMillis() + getMissingFileDelay())); } } }); }
Source:
<code>private InternalCacheEntry localGetCacheEntry(InvocationContext ctx, Object key, boolean isWrite, FlagAffectedCommand command) throws Throwable { <START> if (!isValueAvailableLocally(dm.getReadConsistentHash(), key)) { <END> return null; } InternalCacheEntry ice = dataContainer.get(key); if (ice != null) { if (!ctx.replaceValue(key, ice)) { if (isWrite) entryFactory.wrapEntryForPut(ctx, key, ice, false, command, true); else ctx.putLookedUpEntry(key, ice); } return ice; } return null; }</code><technical_language>check local node is primary owner calling localGetCacheEntry() in remoteGetBeforeWrite()</technical_language>

Target:
private InternalCacheEntry localGetCacheEntry(InvocationContext ctx, Object key, boolean isWrite, FlagAffectedCommand command) throws Throwable { InternalCacheEntry ice = dataContainer.get(key); if (ice != null) { if (!ctx.replaceValue(key, ice)) { if (isWrite) entryFactory.wrapEntryForPut(ctx, key, ice, false, command, true); else ctx.putLookedUpEntry(key, ice); } return ice; } return null; }