auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testEmbeddedAnnotationWithServerTemplateOCPStorage() { <START> System.setProperty(CFG_KIE_CONTROLLER_OCP_ENABLED, "true"); <END> final ProcessAnnotatedType annotatedType = createAnnotatedType(ServerTemplateOCPStorage.class); extension.processEmbeddedController(annotatedType); verify(annotatedType, never()).veto(); }</code><technical_language>this is fragile for jenkins... this code more flexible? do is create in bean a constructor get a map parameter, manually instantiate want map. original constructor, get System.getProperties() parameter next controller. avoid jenkins failures</technical_language>

Target:
public void testEmbeddedAnnotationWithServerTemplateOCPStorage() { ControllerUtils.getConfigProps().put(CFG_KIE_CONTROLLER_OCP_ENABLED, "true"); final ProcessAnnotatedType annotatedType = createAnnotatedType(ServerTemplateOCPStorage.class); extension.processEmbeddedController(annotatedType); verify(annotatedType, never()).veto(); }
Source:
<code>public void assertRegexUrlPatternMap() { RegexUrlPatternMap<Integer> urlPatternMap = new RegexUrlPatternMap<>(); urlPatternMap.put("/app/{jobName}", 1); urlPatternMap.put("/app/list", 2); urlPatternMap.put("/app/{jobName}/disable", 3); urlPatternMap.put("/app/{jobName}/enable", 4); MappingContext<Integer> mappingContext = urlPatternMap.match("/app/myJob"); assertNotNull(mappingContext); <START> assertEquals("/app/{jobName}", mappingContext.pattern()); <END> assertEquals(Integer.valueOf(1), mappingContext.payload()); mappingContext = urlPatternMap.match("/app/list"); assertNotNull(mappingContext); assertEquals("/app/list", mappingContext.pattern()); assertEquals(Integer.valueOf(2), mappingContext.payload()); mappingContext = urlPatternMap.match("/job/list"); assertNull(mappingContext); }</code><technical_language>assertThat</technical_language>

Target:
public void assertRegexUrlPatternMap() { RegexUrlPatternMap<Integer> urlPatternMap = new RegexUrlPatternMap<>(); urlPatternMap.put("/app/{jobName}", 1); urlPatternMap.put("/app/list", 2); urlPatternMap.put("/app/{jobName}/disable", 3); urlPatternMap.put("/app/{jobName}/enable", 4); MappingContext<Integer> mappingContext = urlPatternMap.match("/app/myJob"); assertNotNull(mappingContext); assertThat(mappingContext.pattern(), is("/app/{jobName}")); assertThat(mappingContext.payload(), is(1)); mappingContext = urlPatternMap.match("/app/list"); assertNotNull(mappingContext); assertThat(mappingContext.pattern(), is("/app/list")); assertThat(mappingContext.payload(), is(2)); mappingContext = urlPatternMap.match("/job/list"); assertNull(mappingContext); }
Source:
<code>private void verifyStateStore(final KafkaStreams streams, final Set<KeyValue<Long, Long>> expectedStoreContent) throws InterruptedException { final ReadOnlyKeyValueStore<Long, Long> store = IntegrationTestUtils <START> .getStore(300000L, storeName, streams, QueryableStoreTypes.keyValueStore()); <END> assertNotNull(store); final KeyValueIterator<Long, Long> it = store.all(); while (it.hasNext()) { assertTrue(expectedStoreContent.remove(it.next())); } assertTrue(expectedStoreContent.isEmpty()); }</code><technical_language>suggestion .getStore(300_000L, storeName, streams, QueryableStoreTypes.keyValueStore());</technical_language>

Target:
private void verifyStateStore(final KafkaStreams streams, final Set<KeyValue<Long, Long>> expectedStoreContent) throws InterruptedException { final ReadOnlyKeyValueStore<Long, Long> store = IntegrationTestUtils .getStore(300_000L, storeName, streams, QueryableStoreTypes.keyValueStore()); assertNotNull(store); final KeyValueIterator<Long, Long> it = store.all(); while (it.hasNext()) { assertTrue(expectedStoreContent.remove(it.next())); } assertTrue(expectedStoreContent.isEmpty()); }
Source:
<code>private void verifyCertificateChain(final List<X509Certificate> certificates) throws GeneralSecurityException, AuthenticationException { X509Certificate issuerCert = getSelfSignedCert(certificates); final TrustAnchor trustAnchor = new TrustAnchor(issuerCert, null); <START> PKIXParameters pkixParameters = new PKIXParameters(Collections.singleton(trustAnchor)); <END> pkixParameters.setRevocationEnabled(false); final CertPath certPath = CertificateFactory.getInstance("X.509") .generateCertPath(certificates); final CertPathValidator certPathValidator = CertPathValidator.getInstance("PKIX"); certPathValidator.validate(certPath, pkixParameters); }</code><technical_language>final</technical_language>

Target:
private void verifyCertificateChain(final List<X509Certificate> certificates) throws GeneralSecurityException, AuthenticationException { final X509Certificate issuerCert = getSelfSignedCert(certificates); final TrustAnchor trustAnchor = new TrustAnchor(issuerCert, null); final PKIXParameters pkixParameters = new PKIXParameters(Collections.singleton(trustAnchor)); pkixParameters.setRevocationEnabled(false); final CertPath certPath = CertificateFactory.getInstance("X.509") .generateCertPath(certificates); final CertPathValidator certPathValidator = CertPathValidator.getInstance("PKIX"); certPathValidator.validate(certPath, pkixParameters); }
Source:
<code>public ProfileGenericDataResponse getProfileGenericDataResponse( @OrganisationIdentification final String organisationIdentification, @RequestPayload final ProfileGenericDataAsyncRequest request) throws OsgpException { LOGGER.debug("Incoming ProfileGenericDataAsyncRequest for meter: {}.", request.getDeviceIdentification()); ProfileGenericDataResponse response = null; try { final MeterResponseData meterResponseData = this.monitoringService .dequeueProfileGenericDataResponse(request.getCorrelationUid()); <START> this.throwExceptionIfResultNotOk(meterResponseData, "retrieving the periodic meter reads"); <END> response = this.monitoringMapper.map(meterResponseData.getMessageData(), ProfileGenericDataResponse.class); } catch (final Exception e) { this.handleRetrieveException(e, request, organisationIdentification); } return response; }</code><technical_language>Incorrect exception message</technical_language>

Target:
public ProfileGenericDataResponse getProfileGenericDataResponse( @OrganisationIdentification final String organisationIdentification, @RequestPayload final ProfileGenericDataAsyncRequest request) throws OsgpException { LOGGER.debug("Incoming ProfileGenericDataAsyncRequest for meter: {}.", request.getDeviceIdentification()); ProfileGenericDataResponse response = null; try { final MeterResponseData meterResponseData = this.monitoringService .dequeueProfileGenericDataResponse(request.getCorrelationUid()); this.throwExceptionIfResultNotOk(meterResponseData, "retrieving profile generic data"); response = this.monitoringMapper.map(meterResponseData.getMessageData(), ProfileGenericDataResponse.class); } catch (final Exception e) { this.handleRetrieveException(e, request, organisationIdentification); } return response; }
Source:
<code>public void generateProvisionTrue() throws Exception { configProperties.put("provision", "true"); InvocationContext context = new InvocationContext(mappingModels, configProperties); assertEquals(true, boschIOTSuiteGenerator.generate(modelProvider(), <START> context) instanceof SingleGenerationResult); <END> }</code><technical_language>check if returns a provisioning script file</technical_language>

Target:
public void generateProvisionTrue() throws Exception { configProperties.put("provision", "true"); InvocationContext context = new InvocationContext(mappingModels, configProperties); SingleGenerationResult singleGenerationResult = (SingleGenerationResult) boschIOTSuiteGenerator.generate(modelProvider(), context); assertEquals("Provisioning_MySensor.postman.json", singleGenerationResult.getFileName()); }
Source:
<code>public static String signOpenSSHCertificate( String name, String hostname, String principal ) throws IOException { EngineLocalConfig config = EngineLocalConfig.getInstance(); if ( !new OpenSslCAWrapper().signOpenSSHCertificate( new File(new File(config.getUsrDir(), "bin"), "pki-enroll-openssh-cert.sh"), name, hostname, principal ) ) { throw new RuntimeException("OpenSSH certificate enrollment failed"); } return new String(Files.readAllBytes( <START> new File(new File(config.getPKIDir(), "certs"), String.format("%s-cert.pub", name)).toPath())); <END> }</code><technical_language>This too</technical_language>

Target:
public static String signOpenSSHCertificate( String name, String hostname, String principal ) throws IOException { EngineLocalConfig config = EngineLocalConfig.getInstance(); if ( !new OpenSslCAWrapper().signOpenSSHCertificate( new File(new File(config.getUsrDir(), "bin"), "pki-enroll-openssh-cert.sh"), name, hostname, principal ) ) { throw new RuntimeException("OpenSSH certificate enrollment failed"); } return new String(Files.readAllBytes( Paths.get(config.getPKIDir().getPath(), "certs", String.format("%s-cert.pub", name)))); }
Source:
<code>public void onMediaUploadProgress(final String localMediaId, final float progress) { if(!isAdded() || content == null || !mAztecReady) { return; } <START> float maxProgressForLocalMediaId = mUploadingMediaProgressMax.get(localMediaId); <END> if (progress > maxProgressForLocalMediaId) { synchronized (AztecEditorFragment.this) { maxProgressForLocalMediaId = progress; mUploadingMediaProgressMax.put(localMediaId, maxProgressForLocalMediaId); try { AztecText.AttributePredicate localMediaIdPredicate = ImagePredicate.getLocalMediaIdPredicate(localMediaId); content.setOverlayLevel(localMediaIdPredicate, 1, (int) (progress * 10000)); content.refreshText(); } catch (IndexOutOfBoundsException ex) { AppLog.d(AppLog.T.EDITOR, localMediaId + " - not found trying to update progress "); } } } }</code><technical_language>This throw NPE if localMediaId exist in mUploadingMediaProgressMax (HashMap.get() return a null Float, crash unboxing a float)</technical_language>

Target:
public void onMediaUploadProgress(final String localMediaId, final float progress) { if(!isAdded() || content == null || !mAztecReady || TextUtils.isEmpty(localMediaId)) { return; } if (mUploadingMediaProgressMax.get(localMediaId) == null) { return; } float maxProgressForLocalMediaId = mUploadingMediaProgressMax.get(localMediaId); if (progress > maxProgressForLocalMediaId) { synchronized (AztecEditorFragment.this) { maxProgressForLocalMediaId = progress; mUploadingMediaProgressMax.put(localMediaId, maxProgressForLocalMediaId); try { AztecText.AttributePredicate localMediaIdPredicate = ImagePredicate.getLocalMediaIdPredicate(localMediaId); content.setOverlayLevel(localMediaIdPredicate, 1, (int) (progress * 10000)); content.refreshText(); } catch (IndexOutOfBoundsException ex) { AppLog.d(AppLog.T.EDITOR, localMediaId + " - not found trying to update progress "); } } } }
Source:
<code>public UniformGranularitySpec( @JsonProperty("segmentGranularity") Granularity segmentGranularity, @JsonProperty("queryGranularity") QueryGranularity queryGranularity, @JsonProperty("intervals") List<Interval> inputIntervals ) { this.segmentGranularity = segmentGranularity == null ? DEFAULT_SEGMENT_GRANULARITY : segmentGranularity; this.queryGranularity = queryGranularity == null ? DEFAULT_QUERY_GRANULARITY : queryGranularity; if (inputIntervals != null) { List<Interval> granularIntervals = Lists.newArrayList(); for (Interval inputInterval : inputIntervals) { <START> for (Interval interval : segmentGranularity.getIterable(inputInterval)) { <END> granularIntervals.add(trim(inputInterval, interval)); } } this.inputIntervals = ImmutableList.copyOf(inputIntervals); this.wrappedSpec = new ArbitraryGranularitySpec(queryGranularity, granularIntervals); } else { this.inputIntervals = null; this.wrappedSpec = null; } }</code><technical_language>I wondering trim interval? I guess overlaps in intervals returned segmentGranularity.getIterable() continous inputInterval. Correct if I wrong</technical_language>

Target:
public UniformGranularitySpec( @JsonProperty("segmentGranularity") Granularity segmentGranularity, @JsonProperty("queryGranularity") QueryGranularity queryGranularity, @JsonProperty("intervals") List<Interval> inputIntervals ) { this.segmentGranularity = segmentGranularity == null ? DEFAULT_SEGMENT_GRANULARITY : segmentGranularity; this.queryGranularity = queryGranularity == null ? DEFAULT_QUERY_GRANULARITY : queryGranularity; if (inputIntervals != null) { List<Interval> granularIntervals = Lists.newArrayList(); for (Interval inputInterval : inputIntervals) { Iterables.addAll(granularIntervals, this.segmentGranularity.getIterable(inputInterval)); } this.inputIntervals = ImmutableList.copyOf(inputIntervals); this.wrappedSpec = new ArbitraryGranularitySpec(queryGranularity, granularIntervals); } else { this.inputIntervals = null; this.wrappedSpec = null; } }
Source:
<code>public ActivationKey updateActivationKey( @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId, ActivationKey key) { ActivationKey toUpdate = activationKeyCurator.verifyAndLookupKey(activationKeyId); toUpdate.setName(key.getName()); String serviceLevel = key.getServiceLevel(); if (serviceLevel != null) { serviceLevelValidator.validate(toUpdate.getOwner(), serviceLevel); } <START> toUpdate.setServiceLevel(serviceLevel); <END> activationKeyCurator.merge(toUpdate); return toUpdate; }</code><technical_language>If consumer a service level set a previous key, this unset if next is null/empty. java if (!StringUtils.isBlank(serviceLevel)) { serviceLevelValidator.validate(toUpdate.getOwner(), serviceLevel); toUpdate.setServiceLevel(serviceLevel); }</technical_language>

Target:
public ActivationKey updateActivationKey( @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId, ActivationKey key) { ActivationKey toUpdate = activationKeyCurator.verifyAndLookupKey(activationKeyId); toUpdate.setName(key.getName()); String serviceLevel = key.getServiceLevel(); if (serviceLevel != null) { serviceLevelValidator.validate(toUpdate.getOwner(), serviceLevel); toUpdate.setServiceLevel(serviceLevel); } activationKeyCurator.merge(toUpdate); return toUpdate; }
Source:
<code>private INDArray asMatrix(BytePointer bytes, long length) throws IOException { PIXA pixa; pixa = pixaReadMemMultipageTiff(bytes, length); INDArray data; INDArray currentD; INDArrayIndex[] index = null; switch (this.multiPageMode) { case MINIBATCH: <START> data = Nd4j.create(pixa.n(), 1, 1, pixa.pix(0).h(), pixa.pix(0).w()); <END> break; case CHANNELS: data = Nd4j.create(1, pixa.n(), 1, pixa.pix(0).h(), pixa.pix(0).w()); break; case FIRST: data = Nd4j.create(1, 1, 1, pixa.pix(0).h(), pixa.pix(0).w()); PIX pix = pixa.pix(0); currentD = asMatrix(convert(pix)); pixDestroy(pix); index = new INDArrayIndex[]{NDArrayIndex.point(0), NDArrayIndex.point(0), NDArrayIndex.point(0), NDArrayIndex.all(), NDArrayIndex.all()}; data.put(index , currentD.get(NDArrayIndex.all(), NDArrayIndex.all(), NDArrayIndex.all(), NDArrayIndex.all())); return data; default: throw new UnsupportedOperationException("Unsupported MultiPageMode: " + multiPageMode); } for (int i = 0; i < pixa.n(); i++) { PIX pix = pixa.pix(i); currentD = asMatrix(convert(pix)); pixDestroy(pix); switch (this.multiPageMode) { case MINIBATCH: index = new INDArrayIndex[]{NDArrayIndex.point(i),NDArrayIndex.all(), NDArrayIndex.all(),NDArrayIndex.all(),NDArrayIndex.all()}; break; case CHANNELS: index = new INDArrayIndex[]{NDArrayIndex.all(), NDArrayIndex.point(i), NDArrayIndex.all(), NDArrayIndex.all(),NDArrayIndex.all()}; break; default: throw new UnsupportedOperationException("Unsupported MultiPageMode: " + multiPageMode); } data.put(index , currentD.get(NDArrayIndex.all(), NDArrayIndex.all(), NDArrayIndex.all(),NDArrayIndex.all())); } return data; }</code><technical_language>want set depth number of channels instead of "1, 1"</technical_language>

Target:
private INDArray asMatrix(BytePointer bytes, long length) throws IOException { PIXA pixa; pixa = pixaReadMemMultipageTiff(bytes, length); INDArray data; INDArray currentD; INDArrayIndex[] index = null; switch (this.multiPageMode) { case MINIBATCH: data = Nd4j.create(pixa.n(), 1, 1, pixa.pix(0).h(), pixa.pix(0).w()); break; case FIRST: data = Nd4j.create(1, 1, 1, pixa.pix(0).h(), pixa.pix(0).w()); PIX pix = pixa.pix(0); currentD = asMatrix(convert(pix)); pixDestroy(pix); index = new INDArrayIndex[]{NDArrayIndex.point(0), NDArrayIndex.point(0), NDArrayIndex.point(0), NDArrayIndex.all(), NDArrayIndex.all()}; data.put(index , currentD.get(NDArrayIndex.all(), NDArrayIndex.all(), NDArrayIndex.all(), NDArrayIndex.all())); return data; default: throw new UnsupportedOperationException("Unsupported MultiPageMode: " + multiPageMode); } for (int i = 0; i < pixa.n(); i++) { PIX pix = pixa.pix(i); currentD = asMatrix(convert(pix)); pixDestroy(pix); switch (this.multiPageMode) { case MINIBATCH: index = new INDArrayIndex[]{NDArrayIndex.point(i),NDArrayIndex.all(), NDArrayIndex.all(),NDArrayIndex.all(),NDArrayIndex.all()}; break; default: throw new UnsupportedOperationException("Unsupported MultiPageMode: " + multiPageMode); } data.put(index , currentD.get(NDArrayIndex.all(), NDArrayIndex.all(), NDArrayIndex.all(),NDArrayIndex.all())); } return data; }
Source:
<code>private void createSymlink(File downloadedOCBinary) { try { <START> Files.deleteIfExists(OCBinaryFile.get().getFile().toPath()); <END> Files.createSymbolicLink(OCBinaryFile.get().getFile().toPath(), Paths.get(downloadedOCBinary.getAbsolutePath())); } catch (IOException e) { throw new OpenShiftToolsException(NLS.bind("Could not symlink {0} to {1}:\n{3}", new Object[] { OCBinaryFile.get().getFile().getAbsolutePath(), downloadedOCBinary.getAbsolutePath(), e })); } }</code><technical_language>this succeed, createSymlink run if oc binary file exist removing file is pointless, if exist</technical_language>

Target:
private void createSymlink(File downloadedOCBinary) { try { Files.createSymbolicLink(OCBinaryFile.get().getFile().toPath(), Paths.get(downloadedOCBinary.getAbsolutePath())); } catch (IOException e) { throw new OpenShiftToolsException(NLS.bind("Could not symlink {0} to {1}:\n{2}", new Object[] { OCBinaryFile.get().getFile().getAbsolutePath(), downloadedOCBinary.getAbsolutePath(), e })); } }
Source:
<code>public void insertPastState(long stateStartTime, long stateEndTime, int quark, ITmfStateValue value) throws TimeRangeException { <START> fRwl.writeLock().lock(); <END> fCurrentChunk.add(new HTInterval(stateStartTime, stateEndTime, quark, (TmfStateValue) value)); fRwl.writeLock().unlock(); if (fCurrentChunk.size() >= INTERVAL_CHUNK_SIZE) { try { intervalQueue.put(fCurrentChunk); fCurrentChunk = new ArrayList<>(INTERVAL_CHUNK_SIZE); } catch (InterruptedException e) { Activator.getDefault().logError("State system interrupted", e); } } }</code><technical_language>pattern take/release a lock be: lock.lock() try { // do stuff } finally { lock.unlock(); } This guarantee release lock, in event of a runtime exception. implement Closeable locks some point, some projects do, enforces correct usage. Java's locks not... Also, method (as is right now) in lock, reference new</technical_language>

Target:
public void insertPastState(long stateStartTime, long stateEndTime, int quark, ITmfStateValue value) throws TimeRangeException { fCurrentChunk.add(new HTInterval(stateStartTime, stateEndTime, quark, (TmfStateValue) value)); if (fCurrentChunk.size() >= INTERVAL_CHUNK_SIZE) { try { intervalQueue.put(fCurrentChunk); fCurrentChunk = new ArrayList<>(INTERVAL_CHUNK_SIZE); } catch (InterruptedException e) { Activator.getDefault().logError("State system interrupted", e); } } }
Source:
<code>private static String toHtml(SpannableStringBuilder builder, AztecParser parser) { clearMetaSpans(builder); parser.syncVisualNewlinesOfBlockElements(builder); Format.postProcessSpannedText(builder, true); <START> return EndOfBufferMarkerAdder.removeEndOfTextMarker(parser.toHtml(builder, false, false)); <END> }</code><technical_language>I @JvmOverloads annotation in Aztec method in Kotlin allow Java side call method new extra parameter). Check out [this answer SO](<LINK_0></technical_language>

Target:
private static String toHtml(SpannableStringBuilder builder, AztecParser parser) { clearMetaSpans(builder); parser.syncVisualNewlinesOfBlockElements(builder); Format.postProcessSpannedText(builder, true); return EndOfBufferMarkerAdder.removeEndOfTextMarker(parser.toHtml(builder, false)); }
Source:
<code><START> public void addChannel(Channel channel) { <END> channelMap.put(channel.getChannelIdentifier(), channel); }</code><technical_language>try add a channel twice? I return boolean success/failure here. Res: Done, a return type of boolean success</technical_language>

Target:
public boolean addChannel(Channel channel) { if (channelMap.containsKey(channel)){ return false; } else{ channelMap.put(channel.getChannelIdentifier(), channel); return true; } }
Source:
<code>public void whenFlowIdIsPresentDoNotOverride() throws Exception { final EventType eventType = buildDefaultEventType(); final JSONObject event = buildBusinessEvent(); event.getJSONObject("metadata").put("flow_id", "something"); final BatchItem batch = createBatchItem(event); <START> final String flowId = randomString(); <END> FlowIdUtils.push(flowId); strategy.enrich(batch, eventType); assertThat(batch.getEvent().getJSONObject("metadata").getString("flow_id"), equalTo("something")); }</code><technical_language>is cleat generate id</technical_language>

Target:
public void whenFlowIdIsPresentDoNotOverride() throws Exception { final EventType eventType = buildDefaultEventType(); final JSONObject event = buildBusinessEvent(); event.getJSONObject("metadata").put("flow_id", "something"); final BatchItem batch = createBatchItem(event); FlowIdUtils.push("something-else"); strategy.enrich(batch, eventType); assertThat(batch.getEvent().getJSONObject("metadata").getString("flow_id"), equalTo("something")); }
Source:
<code>public void dummyCustomerApiTest() { Tenant tenant = new Tenant("testTenant", 2); <START> Throttler timer = new ThrottleTimerImpl(100); <END> B2BService service = new B2BService(timer); long counter = 0; for (int i = 0; i < 5; i++) { service.dummyCustomerApi(tenant); counter = CallsCount.getCount(tenant.getName()); } Assert.assertTrue("Counter limit must be reached", counter == 2); }</code><technical_language>reason change 10 100</technical_language>

Target:
public void dummyCustomerApiTest() { Tenant tenant = new Tenant("testTenant", 2); Throttler timer = new ThrottleTimerImpl(100); B2BService service = new B2BService(timer); for (int i = 0; i < 5; i++) { service.dummyCustomerApi(tenant); } long counter = CallsCount.getCount(tenant.getName()); Assert.assertTrue("Counter limit must be reached", counter == 2); }
Source:
<code>public void handleModifyEvent(CatalogModifyEvent event) throws CatalogException { <START> if (event.getSource() instanceof PublishedInfo) { <END> Date dateModified = new Date(); PublishedInfo info = (PublishedInfo) event.getSource(); info.getMetadata().put(PublishedInfo.TIME_MODIFIED, dateModified); updateModifyEventMetadata(event, PublishedInfo.TIME_MODIFIED, dateModified); } else if (event.getSource() instanceof StyleInfo) { StyleInfo info = (StyleInfo) event.getSource(); info.getMetadata().put(PublishedInfo.TIME_MODIFIED, new Date()); updateModifyEventMetadata( event, PublishedInfo.TIME_MODIFIED, info.getMetadata().get(PublishedInfo.TIME_MODIFIED, Date.class)); } else if (event.getSource() instanceof StoreInfo) { StoreInfo info = (StoreInfo) event.getSource(); info.getMetadata().put(PublishedInfo.TIME_MODIFIED, new Date()); updateModifyEventMetadata( event, PublishedInfo.TIME_MODIFIED, info.getMetadata().get(PublishedInfo.TIME_MODIFIED, Date.class)); } LOGGER.finest(event.toString()); }</code><technical_language>If a common interface catalog info this if avoid I think</technical_language>

Target:
public void handleModifyEvent(CatalogModifyEvent event) throws CatalogException { if (event.getSource() instanceof PublishedInfo || event.getSource() instanceof StyleInfo || event.getSource() instanceof PublishedInfo || event.getSource() instanceof StoreInfo || event.getSource() instanceof WorkspaceInfo) { CatalogInfo info = (CatalogInfo) event.getSource(); Date dateModified = new Date(); info.setDateModified(dateModified); } LOGGER.finest(event.toString() + " :handleModifyEvent"); }
Source:
<code>public Location resolveCurrentLocation() throws LocationDefinitionErrorException { int numberOfTries = 0; do { URL whatIsMyCity; try { whatIsMyCity = new URL("<LINK_0>"); } catch (MalformedURLException e) { ++numberOfTries; continue; } try { <START> BufferedReader in = new BufferedReader(new InputStreamReader( <END> whatIsMyCity.openStream())); String currentInfo; StringBuilder responseStrBuilder = new StringBuilder(); while ((currentInfo = in.readLine()) != null) { responseStrBuilder.append(currentInfo); } JSONObject locationInfo = new JSONObject(responseStrBuilder.toString()); String[] coordinates = locationInfo .getString("loc").split(","); Location result = new Location( Double.parseDouble(coordinates[0]), Double.parseDouble(coordinates[1])); result.setName(locationInfo.getString("city")); return result; } catch (IOException | JSONException e) { ++numberOfTries; } } while (numberOfTries < TwitterStream.MAX_NUMBER_OF_TRIES); throw new LocationDefinitionErrorException(LOCATION_DEFINITION_ERROR); }</code><technical_language>try-with-resources</technical_language>

Target:
public Location resolveCurrentLocation() throws LocationDefinitionErrorException, MalformedURLException { int numberOfTries = 0; do { URL whatIsMyCity; whatIsMyCity = new URL("<LINK_0>"); try (BufferedReader in = new BufferedReader(new InputStreamReader( whatIsMyCity.openStream()))) { String currentInfo; StringBuilder responseStrBuilder = new StringBuilder(); while ((currentInfo = in.readLine()) != null) { responseStrBuilder.append(currentInfo); } JSONObject locationInfo = new JSONObject(responseStrBuilder.toString()); String[] coordinates = locationInfo .getString("loc").split(","); Location result = new Location( Double.parseDouble(coordinates[0]), Double.parseDouble(coordinates[1]), locationInfo.getString("city")); return result; } catch (IOException | JSONException e) { ++numberOfTries; } } while (numberOfTries < TwitterStream.MAX_NUMBER_OF_TRIES); throw new LocationDefinitionErrorException(LOCATION_DEFINITION_ERROR); }
Source:
<code>private CheckResult checkResult(AsyncReporter<Span> asyncReporter) { ExecutorService executor = Executors.newSingleThreadExecutor(); Callable<CheckResult> task = asyncReporter::check; Future<CheckResult> future = executor.submit(task); try { return future.get(1, TimeUnit.SECONDS); } catch (Exception ex) { <START> if (log.isDebugEnabled()) { <END> log.debug("An exception took place when trying to retrieve the check result. Will return null.", ex); } return null; } finally { future.cancel(true); executor.shutdown(); } }</code><technical_language>if this is startup, I people talking this want higher debug, warn</technical_language>

Target:
private CheckResult checkResult(AsyncReporter<Span> asyncReporter) { ExecutorService executor = Executors.newSingleThreadExecutor(); Callable<CheckResult> task = asyncReporter::check; Future<CheckResult> future = executor.submit(task); try { return future.get(1, TimeUnit.SECONDS); } catch (Exception ex) { log.warn( "An exception took place when trying to retrieve the check result. Will return null.", ex); return null; } finally { future.cancel(true); executor.shutdown(); } }
Source:
<code>public void toJson() throws Exception { <START> String jsonString = "{" + "\"action\":\"hangup\"" + "}"; <END> assertEquals(jsonString, callModifier.toJson()); }</code><technical_language>reason for defining this string literals</technical_language>

Target:
public void toJson() throws Exception { String jsonString = "{\"action\":\"hangup\"}"; assertEquals(jsonString, callModifier.toJson()); }
Source:
<code>public void unbindConsumers(String inputChannelName) { <START> this.binder.unbindProducers(inputChannelName); <END> }</code><technical_language>this calling unbindConsumers</technical_language>

Target:
public void unbindConsumers(String inputChannelName) { this.binder.unbindConsumers (inputChannelName); }
Source:
<code>public String getDescription() { if (open) { return DESCRIPTION_REOPENED; } else { return DESCRIPTION_CLOSED; <START> } <END> }</code><technical_language>remove else clause here</technical_language>

Target:
public String getDescription() { return isOpen ? DESCRIPTION_REOPENED : DESCRIPTION_CLOSED; }
Source:
<code>public void onResume() { super.onResume(); <START> if (!hasTabsChanged) { if (viewPager.getOffscreenPageLimit() != tabsList.size()) { viewPager.setOffscreenPageLimit(tabsList.size()); } } else { setupTabs(); } <END> }</code><technical_language>Invert condition in if: suggestion if (hasTabsChanged) { setupTabs(); } else { if (viewPager.getOffscreenPageLimit() != tabsList.size()) { viewPager.setOffscreenPageLimit(tabsList.size()); } }</technical_language>

Target:
public void onResume() { super.onResume(); if (hasTabsChanged) setupTabs(); }
Source:
<code>protected final void addConnections() { ((ServerWebSocketInitializer) getSocketInitailizerInstance()).setSslContext(sslCtx); boss = new NioEventLoopGroup(2, new RenamingThreadFactoryProxy("boss", Executors.defaultThreadFactory())); workers = new NioEventLoopGroup(NUMBER_EVENT_WORKERS, new RenamingThreadFactoryProxy("worker", Executors.defaultThreadFactory())); server.group(boss, workers); server.channel(NioServerSocketChannel.class); server.handler(new LoggingHandler(LogLevel.INFO)); server.option(ChannelOption.SO_SNDBUF, SIZE_OF_SEND_BUFFER); server.option(ChannelOption.SO_RCVBUF, SIZE_OF_RCV_BUFFER); server.childOption(ChannelOption.SO_RCVBUF, SIZE_OF_RCV_BUFFER); <START> server.childOption(ChannelOption.SO_SNDBUF, SIZE_OF_SEND_BUFFER); <END> server.option(ChannelOption.TCP_NODELAY, true); final ServerWebSocketInitializer socketInitializer = (ServerWebSocketInitializer) this.getSocketInitailizerInstance(); socketInitializer.initChannel(serverFactory); timeoutExecutor = new TimeoutExecutor(1, MAX_TIMEOUT_POOL_SIZE); timeoutChecker = new TimeoutChecker(); timeoutChecker.setTimeoutExecutor(timeoutExecutor); timeoutChecker.startChecking(serverFactory.getRpcClientRegistry()); if (this.isLocal()) { serverFactory.registerConnectionEventListener(localRpcEventLogger); } server.childHandler(serverFactory); server.localAddress(serverInfo.getPort()); }</code><technical_language>picky, swap this line above? for option childOption sets send buffer receive buffer</technical_language>

Target:
protected final void addConnections() { ((ServerWebSocketInitializer) getSocketInitailizerInstance()).setSslContext(sslContext); boss = new NioEventLoopGroup(2, new RenamingThreadFactoryProxy("boss", Executors.defaultThreadFactory())); workers = new NioEventLoopGroup(NUMBER_EVENT_WORKERS, new RenamingThreadFactoryProxy("worker", Executors.defaultThreadFactory())); server.group(boss, workers); server.channel(NioServerSocketChannel.class); server.handler(new LoggingHandler(LogLevel.INFO)); server.option(ChannelOption.SO_SNDBUF, SIZE_OF_SEND_BUFFER); server.option(ChannelOption.SO_RCVBUF, SIZE_OF_RCV_BUFFER); server.childOption(ChannelOption.SO_SNDBUF, SIZE_OF_SEND_BUFFER); server.childOption(ChannelOption.SO_RCVBUF, SIZE_OF_RCV_BUFFER); server.option(ChannelOption.TCP_NODELAY, true); final ServerWebSocketInitializer socketInitializer = (ServerWebSocketInitializer) this.getSocketInitailizerInstance(); socketInitializer.initChannel(serverFactory); timeoutExecutor = new TimeoutExecutor(1, MAX_TIMEOUT_POOL_SIZE); timeoutChecker = new TimeoutChecker(); timeoutChecker.setTimeoutExecutor(timeoutExecutor); timeoutChecker.startChecking(serverFactory.getRpcClientRegistry()); if (this.isLocal()) { serverFactory.registerConnectionEventListener(localRpcEventLogger); } server.childHandler(serverFactory); server.localAddress(peerInfo.getPort()); }
Source:
<code>public void onNext(final CompletedEvaluator completedEvaluator) { <START> LOG.log(Level.INFO, "CompletedEvaluator: {0}", completedEvaluator); <END> }</code><technical_language>I FINE enough</technical_language>

Target:
public void onNext(final CompletedEvaluator completedEvaluator) { LOG.log(Level.FINE, "CompletedEvaluator: {0}", completedEvaluator); }
Source:
<code>public boolean equals(Object obj) { if (obj == null) { return false; } <START> super.equals(obj); <END> BrickProfileDetails brickDetails = (BrickProfileDetails) obj; if (brickDetails.getBrickId() == null) { return false; } if (!(ObjectUtils.objectsEqual(getBrickId(), brickDetails.getBrickId()))) { return false; } return true; }</code><technical_language>return be... if (!super.equals(obj)) { return false }</technical_language>

Target:
public boolean equals(Object obj) { if (obj == null) { return false; } if(!super.equals(obj)) { return false; } BrickProfileDetails brickDetails = (BrickProfileDetails) obj; if (brickDetails.getBrickId() == null) { return false; } if (!(ObjectUtils.objectsEqual(getBrickId(), brickDetails.getBrickId()))) { return false; } return true; }
Source:
<code>public Object visitComputeCommand(InvocationContext ctx, ComputeCommand command) throws Throwable { <START> return updateStoreStatistics(ctx, command); <END> }</code><technical_language>work correctly if command a remove, unchanged</technical_language>

Target:
public Object visitComputeCommand(InvocationContext ctx, ComputeCommand command) throws Throwable { boolean statisticsEnabled = getStatisticsEnabled(command); if (!statisticsEnabled || !ctx.isOriginLocal()) return invokeNext(ctx, command); long start = timeService.time(); return invokeNextAndFinally(ctx, command, (rCtx, rCommand, rv, t) -> { if (rv == null && command.isSuccessful()) { increaseRemoveMisses(); } else if (command.isSuccessful()) { long intervalMilliseconds = timeService.timeDuration(start, TimeUnit.MILLISECONDS); StripeB stripe = counters.stripeForCurrentThread(); counters.add(StripeB.storeTimesFieldUpdater, stripe, intervalMilliseconds); counters.increment(StripeB.storesFieldUpdater, stripe); } }); }
Source:
<code>protected boolean loadFromSystemProperty(String propertyKey, String... expectedExtensions) { String configSystemProperty = System.getProperty(propertyKey); if (configSystemProperty == null) { <START> LOGGER.finest("Could not find 'hazelcast.config' System property"); <END> return false; } if (expectedExtensions != null && expectedExtensions.length > 0 && !isExpectedExtensionConfigured(configSystemProperty, expectedExtensions)) { return false; } LOGGER.info("Loading configuration " + configSystemProperty + " from System property 'hazelcast.config'"); if (configSystemProperty.startsWith("classpath:")) { loadSystemPropertyClassPathResource(configSystemProperty); } else { loadSystemPropertyFileResource(configSystemProperty); } return true; }</code><technical_language>Minor: include of propertyKey in message equal hazelcast.config</technical_language>

Target:
protected boolean loadFromSystemProperty(String propertyKey, String... expectedExtensions) { try { String configSystemProperty = System.getProperty(propertyKey); if (configSystemProperty == null) { LOGGER.finest(String.format("Could not find '%s' System property", propertyKey)); return false; } if (expectedExtensions != null && expectedExtensions.length > 0 && !isExpectedExtensionConfigured(configSystemProperty, expectedExtensions)) { return false; } LOGGER.info(String.format("Loading configuration '%s' from System property '%s'", configSystemProperty, propertyKey)); if (configSystemProperty.startsWith("classpath:")) { loadSystemPropertyClassPathResource(configSystemProperty); } else { loadSystemPropertyFileResource(configSystemProperty); } return true; } catch (RuntimeException e) { throw new HazelcastException(e); } }
Source:
<code>public Writer write(Writer writer, int indentFactor, int indent) throws JSONException { try { <START> boolean hasComma = false; <END> final int length = this.length(); writer.write('{'); if (length == 1) { final Entry<String,?> entry = this.entrySet().iterator().next(); final String key = entry.getKey(); writer.write(quote(key)); writer.write(':'); if (indentFactor > 0) { writer.write(' '); } try{ writeValue(writer, entry.getValue(), indentFactor, indent); } catch (Exception e) { throw new JSONException("Unable to write JSONObject value for key: " + key, e); } } else if (length != 0) { final int newIndent = indent + indentFactor; for (final Entry<String,?> entry : this.entrySet()) { if (hasComma) { writer.write(','); } if (indentFactor > 0) { writer.write('\n'); } indent(writer, newIndent); final String key = entry.getKey(); writer.write(quote(key)); writer.write(':'); if (indentFactor > 0) { writer.write(' '); } try { writeValue(writer, entry.getValue(), indentFactor, newIndent); } catch (Exception e) { throw new JSONException("Unable to write JSONObject value for key: " + key, e); } hasComma = true; } if (indentFactor > 0) { writer.write('\n'); } indent(writer, indent); } writer.write('}'); return writer; } catch (IOException exception) { throw new JSONException(exception); } }</code><technical_language>here, needsComma a fit</technical_language>

Target:
public Writer write(Writer writer, int indentFactor, int indent) throws JSONException { try { boolean needsComma = false; final int length = this.length(); writer.write('{'); if (length == 1) { final Entry<String,?> entry = this.entrySet().iterator().next(); final String key = entry.getKey(); writer.write(quote(key)); writer.write(':'); if (indentFactor > 0) { writer.write(' '); } try{ writeValue(writer, entry.getValue(), indentFactor, indent); } catch (Exception e) { throw new JSONException("Unable to write JSONObject value for key: " + key, e); } } else if (length != 0) { final int newIndent = indent + indentFactor; for (final Entry<String,?> entry : this.entrySet()) { if (needsComma) { writer.write(','); } if (indentFactor > 0) { writer.write('\n'); } indent(writer, newIndent); final String key = entry.getKey(); writer.write(quote(key)); writer.write(':'); if (indentFactor > 0) { writer.write(' '); } try { writeValue(writer, entry.getValue(), indentFactor, newIndent); } catch (Exception e) { throw new JSONException("Unable to write JSONObject value for key: " + key, e); } needsComma = true; } if (indentFactor > 0) { writer.write('\n'); } indent(writer, indent); } writer.write('}'); return writer; } catch (IOException exception) { throw new JSONException(exception); } }
Source:
<code>public void checkAttributeValue(PerunSessionImpl perunSession, User user, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { <START> List<String> value = (List<String>) attribute.getValue(); <END> for(String address : value) { if(!address.matches(IPv4_PATTERN) && !address.matches(IPv6_PATTERN) && !address.matches(IPv6_PATTERN_SHORT)) throw new WrongAttributeValueException(attribute, "IP address is not in the correct format."); } }</code><technical_language>simple method "valueAsList"</technical_language>

Target:
public void checkAttributeValue(PerunSessionImpl perunSession, User user, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { List<String> value = attribute.valueAsList(); for (String address : value) { if (!address.matches(IPv4_PATTERN) && !address.matches(IPv6_PATTERN) && !address.matches(IPv6_PATTERN_SHORT)) throw new WrongAttributeValueException(attribute, "IP address is not in the correct format."); } }
Source:
<code><START> private void translateHeader(Entry<CharSequence, CharSequence> entry) throws Http2Exception { <END> final CharSequence name = entry.getKey(); final CharSequence value = entry.getValue(); AsciiString translatedName = translations.get(name); if (translatedName != null) { output.add(translatedName, AsciiString.of(value)); } else if (!Http2Headers.PseudoHeaderName.isPseudoHeader(name)) { if (name.length() == 0 || name.charAt(0) == ':') { throw streamError(streamId, PROTOCOL_ERROR, "Invalid HTTP/2 header '%s' encountered in translation to HTTP/1.x", name); } if (COOKIE.equals(name)) { if (cookies == null) { cookies = InternalThreadLocalMap.get().stringBuilder(); } else if (cookies.length() > 0) { cookies.append("; "); } cookies.append(value); } else { output.add(name, value); } } }</code><technical_language>@kevinoliver for nit-picking if fold this method translateHeaders StringBuilder local variable remove declaration of private StringBuilder cookies. IMHO this preferable</technical_language>

Target:
private void translateHeader(Entry<CharSequence, CharSequence> entry) throws Http2Exception { }
Source:
<code>public static void writeJobIdToFile(String hadoopJobIdFileName, String hadoopJobId) { if (hadoopJobId != null && hadoopJobIdFileName != null) { try { HadoopDruidIndexerConfig.JSON_MAPPER.writeValue( new OutputStreamWriter(new FileOutputStream(new File(hadoopJobIdFileName)), StandardCharsets.UTF_8), hadoopJobId ); log.info("MR job id [%s] is written to the file [%s]", hadoopJobId, hadoopJobIdFileName); } catch (IOException e) { log.warn(e, "Error writing job id [%s] to the file [%s]", hadoopJobId, hadoopJobIdFileName); } } else { <START> log.info("Either job Id or File Name is null for the submitted job. Skipping writing the file [%s]", hadoopJobIdFileName); <END> } }</code><technical_language>nit: suggest "job id" "filename" capitalization</technical_language>

Target:
public static void writeJobIdToFile(String hadoopJobIdFileName, String hadoopJobId) { if (hadoopJobId != null && hadoopJobIdFileName != null) { try { HadoopDruidIndexerConfig.JSON_MAPPER.writeValue( new OutputStreamWriter(new FileOutputStream(new File(hadoopJobIdFileName)), StandardCharsets.UTF_8), hadoopJobId ); log.info("MR job id [%s] is written to the file [%s]", hadoopJobId, hadoopJobIdFileName); } catch (IOException e) { log.warn(e, "Error writing job id [%s] to the file [%s]", hadoopJobId, hadoopJobIdFileName); } } else { log.info("Either job id or file name is null for the submitted job. Skipping writing the file [%s]", hadoopJobIdFileName); } }
Source:
<code>public Iterable<InstanceInZone> listNodesByIds(final Iterable<String> ids) { return filter(listNodes(), new Predicate<InstanceInZone>() { @Override public boolean apply(InstanceInZone instance) { <START> return contains(ids, instance.getInstance().getName()); <END> } }); }</code><technical_language>Rename var instanceInZone? instanceInZone.getInstance(). reads a more clearly</technical_language>

Target:
public Iterable<InstanceInZone> listNodesByIds(final Iterable<String> ids) { return filter(listNodes(), new Predicate<InstanceInZone>() { @Override public boolean apply(InstanceInZone instanceInZone) { return contains(ids, instanceInZone.getInstance().getName()); } }); }
Source:
<code>public static Instance ofEndpoint(String endpoint, String name, String userName, String password, boolean verify) throws IOException { boolean possible_integ = true; if (endpoint == null) { endpoint = System.getenv(Util.ICP4D_DEPLOYMENT_URL); if (endpoint == null) { possible_integ = false; endpoint = System.getenv(Util.STREAMS_REST_URL); if (endpoint == null) { return null; } } } if (possible_integ && name == null) name = System.getenv(Util.STREAMS_INSTANCE_ID); <START> StreamsConnection conn = null; <END> Instance instance = null; if (name != null) { conn = createIntegratedConnection(endpoint, name, userName, password, verify); if (!verify) { conn.allowInsecureHosts(true); } instance = conn.getInstance(name); } else { conn = createStandaloneConnection(endpoint, userName, password, verify); if (!verify) { conn.allowInsecureHosts(true); } List<Instance> instances = conn.getInstances(); if (instances.size() != 1) { return null; } instance = instances.get(0); } return instance; }</code><technical_language>initialize null - is set in paths setting null correctly a compile error if set</technical_language>

Target:
public static Instance ofEndpoint(String endpoint, String name, String userName, String password, boolean verify) throws IOException { boolean possible_integ = true; if (endpoint == null) { endpoint = System.getenv(Util.ICP4D_DEPLOYMENT_URL); if (endpoint == null) { possible_integ = false; endpoint = System.getenv(Util.STREAMS_REST_URL); if (endpoint == null) { return null; } } } if (possible_integ && name == null) name = System.getenv(Util.STREAMS_INSTANCE_ID); StreamsConnection conn; Instance instance = null; if (name != null) { conn = createIntegratedConnection(endpoint, name, userName, password, verify); if (!verify) { conn.allowInsecureHosts(true); } instance = conn.getInstance(name); } else { conn = createStandaloneConnection(endpoint, userName, password, verify); if (!verify) { conn.allowInsecureHosts(true); } List<Instance> instances = conn.getInstances(); if (instances.size() != 1) { return null; } instance = instances.get(0); } return instance; }
Source:
<code>public void init() { boolean disablePublish = Boolean.parseBoolean(properties.getProperty(DISABLE_PUBLISH_FILTERING_PROP, DISABLE_PUBLISH_FILTERING_ENV, "false")); boolean resetCache = Boolean.parseBoolean(properties.getProperty(RESET_PUBLISH_CACHE_PROP, RESET_PUBLISH_CACHE_ENV, "true")); if (!disablePublish) { if (resetCache) { msgLog.warnClearPublishCache(); <START> publishCache.clear(); <END> } msgLog.infoInitPublishCache(); initialCacheUpdate(); definitions.registerListener(events -> { events.stream().forEach(e -> { String tenantId = e.getTargetTenantId(); String triggerId = e.getTargetId(); TriggerKey triggerKey = new TriggerKey(tenantId, triggerId); Set<String> oldDataIds = dataIdsCache.get(triggerKey); removePublishCache(tenantId, triggerId, oldDataIds); if (e.getType().equals(TRIGGER_CONDITION_CHANGE)) { Set<String> newDataIds = e.getDataIds(); dataIdsCache.put(triggerKey, newDataIds); addPublishCache(tenantId, triggerId, newDataIds); } }); }, TRIGGER_CONDITION_CHANGE, TRIGGER_REMOVE); } else { msgLog.warnDisabledPublishCache(); } }</code><technical_language>clean dataIdsCache</technical_language>

Target:
public void init() { boolean disablePublish = Boolean.parseBoolean(properties.getProperty(DISABLE_PUBLISH_FILTERING_PROP, DISABLE_PUBLISH_FILTERING_ENV, "false")); boolean resetCache = Boolean.parseBoolean(properties.getProperty(RESET_PUBLISH_CACHE_PROP, RESET_PUBLISH_CACHE_ENV, "true")); if (!disablePublish) { if (resetCache) { msgLog.warnClearPublishCache(); publishCache.clear(); publishDataIdsCache.clear(); } msgLog.infoInitPublishCache(); initialCacheUpdate(); definitions.registerListener(events -> { events.stream().forEach(e -> { String tenantId = e.getTargetTenantId(); String triggerId = e.getTargetId(); TriggerKey triggerKey = new TriggerKey(tenantId, triggerId); Set<String> oldDataIds = publishDataIdsCache.get(triggerKey); removePublishCache(tenantId, triggerId, oldDataIds); if (e.getType().equals(TRIGGER_CONDITION_CHANGE)) { Set<String> newDataIds = e.getDataIds(); publishDataIdsCache.put(triggerKey, newDataIds); addPublishCache(tenantId, triggerId, newDataIds); } }); }, TRIGGER_CONDITION_CHANGE, TRIGGER_REMOVE); } else { msgLog.warnDisabledPublishCache(); } }
Source:
<code>public BasicReplicator(Replication replication) { this.replication = replication; <START> this.state = State.PENDING; <END> }</code><technical_language>reason do: this(replication, NULL_ID)</technical_language>

Target:
public BasicReplicator(Replication replication) { this(replication, NULL_ID); }
Source:
<code>public String resolveServer(final int hash) { try { if (!initialized) { synchronized (this) { <START> sender.get().sendRoutingTableRequestMsg(); <END> this.wait(INITIALIZATION_TIMEOUT_MS); } } } catch (final InterruptedException e) { throw new RuntimeException("Failed to initialize routing table for resolving server", e); } final int blockId = hash % numTotalBlocks; return storeIdToEndpointId.get(blockIdToStoreId.get(blockId)); }</code><technical_language>request in earlier time in phase of PS setup, check wait here</technical_language>

Target:
public String resolveServer(final int hash) { try { if (!initialized) { synchronized (this) { this.wait(INITIALIZATION_TIMEOUT_MS); } } } catch (final InterruptedException e) { throw new RuntimeException("Failed to initialize routing table for resolving server", e); } final int blockId = hash % numTotalBlocks; return storeIdToEndpointId.get(blockIdToStoreId.get(blockId)); }