auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void init() throws APIManagerIntegrationTestException { super.init(); try { userManagementClient.addUser(TEST_USER_1, TEST_USER_1_PASSWORD, new String[] { "admin" }, "manager"); userManagementClient.addUser(TEST_USER_2, TEST_USER_2_PASSWORD, new String[] { "admin" }, "manager"); } catch (UserAdminUserAdminException e) { log.error("Error while creating the test users"); <START> assertTrue(false, e.getMessage()); <END> } catch (RemoteException e) { log.error("Error while creating the test users"); assertTrue(false, e.getMessage()); } publisherURLHttp = publisherUrls.getWebAppURLHttp(); storeURLHttp = storeUrls.getWebAppURLHttp(); apiPublisher = new APIPublisherRestClient(publisherURLHttp); apiStore = new APIStoreRestClient(storeURLHttp); }</code><technical_language>Assert.fail(e.getMessage())</technical_language>

Target:
public void init() throws APIManagerIntegrationTestException { super.init(); try { userManagementClient.addUser(TEST_USER_1, TEST_USER_1_PASSWORD, new String[] { "admin" }, "manager"); userManagementClient.addUser(TEST_USER_2, TEST_USER_2_PASSWORD, new String[] { "admin" }, "manager"); } catch (UserAdminUserAdminException e) { log.error("Error while creating the test users"); Assert.fail(e.getMessage()); } catch (RemoteException e) { log.error("Error while creating the test users"); Assert.fail(e.getMessage()); } publisherURLHttp = publisherUrls.getWebAppURLHttp(); storeURLHttp = storeUrls.getWebAppURLHttp(); apiPublisher = new APIPublisherRestClient(publisherURLHttp); apiStore = new APIStoreRestClient(storeURLHttp); }
Source:
<code>private AccessToken validateAccessToken(String token) { AccessToken accessToken; try { accessToken = connector.validateAccessToken(new AccessToken.Builder(token).build()); } catch (ConnectionInitializationException e) { LOGGER.warn(String.format("Unable to retrieve access token from auth-server %s: %s", authServerHome, e.getMessage())); throw e; } catch(OsiamRequestException e) { <START> LOGGER.warn("Error when validating access token", e); <END> throw e; } return accessToken; }</code><technical_language>'when' dropped log statement</technical_language>

Target:
private AccessToken validateAccessToken(String token) { AccessToken accessToken; try { accessToken = connector.validateAccessToken(new AccessToken.Builder(token).build()); } catch (ConnectionInitializationException e) { LOGGER.warn(String.format("Unable to retrieve access token from auth-server %s: %s", authServerHome, e.getMessage())); throw e; } catch(OsiamRequestException e) { LOGGER.warn("Error validating access token", e); throw e; } return accessToken; }
Source:
<code>public PoolDTO clone() { PoolDTO copy = super.clone(); OwnerDTO owner = this.getOwner(); copy.owner = owner != null ? owner.clone() : null; CertificateDTO certificate = this.getCertificate(); copy.certificate = certificate != null ? certificate.clone() : null; copy.setAttributes(this.getAttributes()); copy.setCalculatedAttributes(this.getCalculatedAttributes()); copy.setProductAttributes(this.getProductAttributes()); copy.setDerivedProductAttributes(this.getDerivedProductAttributes()); copy.setBranding(this.getBranding()); copy.setProvidedProducts(this.getProvidedProducts()); copy.setDerivedProvidedProducts(this.getDerivedProvidedProducts()); <START> copy.endDate = this.endDate != null ? new Date(this.endDate.getTime()) : null; <END> copy.startDate = this.startDate != null ? new Date(this.startDate.getTime()) : null; return copy; }</code><technical_language>this.endDate.clone() instead guaranteed get class of date back</technical_language>

Target:
public PoolDTO clone() { PoolDTO copy = super.clone(); OwnerDTO owner = this.getOwner(); copy.owner = owner != null ? owner.clone() : null; CertificateDTO certificate = this.getCertificate(); copy.certificate = certificate != null ? certificate.clone() : null; copy.setAttributes(this.getAttributes()); copy.setCalculatedAttributes(this.getCalculatedAttributes()); copy.setProductAttributes(this.getProductAttributes()); copy.setDerivedProductAttributes(this.getDerivedProductAttributes()); copy.setBranding(this.getBranding()); copy.setProvidedProducts(this.getProvidedProducts()); copy.setDerivedProvidedProducts(this.getDerivedProvidedProducts()); copy.endDate = this.endDate != null ? (Date) this.endDate.clone() : null; copy.startDate = this.startDate != null ? (Date) this.startDate.clone() : null; return copy; }
Source:
<code>public static ObjectMapper getMapper() { synchronized <START> (lock) { <END> if (mapper == null) { mapper = new ObjectMapper(); mapper.setDateFormat(new SimpleDateFormat("MMM d, yyyy h:mm:ss aa")); } } return mapper; }</code><technical_language>Ryan mentioned, want implement locks this static methods. guessing is checking mappers for null in order instantiate once, set SimpleDateFormat. else chime in, easy simple way, while keeping methods static, is implement default constructor arguments, call a new static void method constructor called setMappers(). setMappers() is instantiate mapper1 mapper2 ObjectMapper instances. get rid of null checks mappers, instead return respective static get() methods</technical_language>

Target:
public static synchronized ObjectMapper getMapper() { return mapper; }
Source:
<code>public void setBuildDropDownEnabled(boolean enabled) { this.build.disabled = !enabled; this.buildCaret.disabled = !enabled; if(enabled) { <START> this.install.classList.remove("disabled"); <END> } else { this.install.classList.add("disabled"); } }</code><technical_language>suggestion this.install.classList.remove(DISABLED_CLASS);</technical_language>

Target:
public void setBuildDropDownEnabled(boolean enabled) { this.build.disabled = !enabled; this.buildCaret.disabled = !enabled; if (enabled) { this.install.classList.remove(DISABLED_CLASS); } else { this.install.classList.add(DISABLED_CLASS); } }
Source:
<code>public void storeServerMetrics(final String serverId, final ServerMetrics metrics) { final DataInfo dataInfo = new DataInfoImpl(metrics.getNumPartitionBlocks()); final EvaluatorParameters evaluatorParameters = new ServerEvaluatorParameters(serverId, dataInfo, metrics); serverEvalParams.add(evaluatorParameters); try { final URL obj = new URL(this.dolphinURL); final HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); con.setDoOutput(true); con.setDoInput(true); con.connect(); final OutputStream os = con.getOutputStream(); <START> final String param = "workerid=-1&serverid=" + serverId; <END> System.out.println("request with " + param); os.write((param).getBytes()); os.flush(); os.close(); final BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()) ); String inputLine; final StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); } catch (Exception e) { System.out.println(e); } }</code><technical_language>API clean. describe protocol first, figure out improve it</technical_language>

Target:
public void storeServerMetrics(final String serverId, final ServerMetrics metrics) { final DataInfo dataInfo = new DataInfoImpl(metrics.getNumPartitionBlocks()); final EvaluatorParameters evaluatorParameters = new ServerEvaluatorParameters(serverId, dataInfo, metrics); serverEvalParams.add(evaluatorParameters); if (this.dashboardEnabled) { sendMetrics(serverId, metrics.toString()); } }
Source:
<code><START> public static String getEAP6xVersionNoSlotCheck(File location, String metaInfPath, <END> String versionPrefix, String releaseName) { IPath rootPath = new Path(location.getAbsolutePath()); IPath eapDir = rootPath.append(metaInfPath); if( eapDir.toFile().exists()) { IPath manifest = eapDir.append("MANIFEST.MF"); Properties p2 = JBossServerType.loadProperties(manifest.toFile()); String type = p2.getProperty("JBoss-Product-Release-Name"); String version = p2.getProperty("JBoss-Product-Release-Version"); boolean matchesName = releaseName == null || releaseName.equals(type); boolean matchesVersion = versionPrefix == null || version.startsWith(versionPrefix); if( matchesName && matchesVersion ) return version; } return null; }</code><technical_language>is this public</technical_language>

Target:
static String getEAP6xVersionNoSlotCheck(File location, String metaInfPath, String versionPrefix, String releaseName) { IPath rootPath = new Path(location.getAbsolutePath()); IPath eapDir = rootPath.append(metaInfPath); if( eapDir.toFile().exists()) { IPath manifest = eapDir.append("MANIFEST.MF"); Properties p2 = JBossServerType.loadProperties(manifest.toFile()); String type = p2.getProperty("JBoss-Product-Release-Name"); String version = p2.getProperty("JBoss-Product-Release-Version"); boolean matchesName = releaseName == null || releaseName.equals(type); boolean matchesVersion = versionPrefix == null || version.startsWith(versionPrefix); if( matchesName && matchesVersion ) return version; } return null; }
Source:
<code>private boolean checkCanPerformPlugUnPlugDisk() { boolean returnValue = true; <START> if (getVm().getStatus() == VMStatus.Up || getVm().getStatus() == VMStatus.Paused) { <END> setVdsId(getVm().getRunOnVds().getValue()); returnValue = isHotPlugSupported() && isOsSupportingHotPlug() && isInterfaceSupportedForPlugUnPlug(disk); } if (returnValue) { oldVmDevice = getVmDeviceDao().get(new VmDeviceId(disk.getId(), getVmId())); if (getPlugAction() == VDSCommandType.HotPlugDisk && oldVmDevice.getIsPlugged()) { returnValue = false; addCanDoActionMessage(VdcBllMessages.HOT_PLUG_DISK_IS_NOT_UNPLUGGED); } if (getPlugAction() == VDSCommandType.HotUnPlugDisk && !oldVmDevice.getIsPlugged()) { returnValue = false; addCanDoActionMessage(VdcBllMessages.HOT_UNPLUG_DISK_IS_NOT_PLUGGED); } } return returnValue; }</code><technical_language>VmStatus.isUpOrPaused(vm.getStatus()) instead</technical_language>

Target:
private boolean checkCanPerformPlugUnPlugDisk() { boolean returnValue = true; if (getVm().getStatus().isUpOrPaused()) { setVdsId(getVm().getRunOnVds().getValue()); returnValue = isHotPlugSupported() && isOsSupportingHotPlug() && isInterfaceSupportedForPlugUnPlug(disk); } if (returnValue) { oldVmDevice = getVmDeviceDao().get(new VmDeviceId(disk.getId(), getVmId())); if (getPlugAction() == VDSCommandType.HotPlugDisk && oldVmDevice.getIsPlugged()) { returnValue = false; addCanDoActionMessage(VdcBllMessages.HOT_PLUG_DISK_IS_NOT_UNPLUGGED); } if (getPlugAction() == VDSCommandType.HotUnPlugDisk && !oldVmDevice.getIsPlugged()) { returnValue = false; addCanDoActionMessage(VdcBllMessages.HOT_UNPLUG_DISK_IS_NOT_PLUGGED); } } return returnValue; }
Source:
<code>public boolean hasCubicChunks(EntityPlayerMP player) { if (!hasFML(player)) { return false; <START> } <END> NetHandlerPlayServer connection = player.connection; NetworkManager netManager = connection.netManager; Channel channel = netManager.channel(); Attribute<NetworkDispatcher> attr = channel.attr(NetworkDispatcher.FML_DISPATCHER); NetworkDispatcher networkDispatcher = attr.get(); Map<String, String> modList = networkDispatcher.getModList(); return modList.containsKey("cubicchunks"); }</code><technical_language>is this necessary? essentially duplicating work hasCubicChunks is doing. code run FML handshake</technical_language>

Target:
public boolean hasCubicChunks(EntityPlayerMP player) { NetHandlerPlayServer connection = player.connection; if (connection == null) { return false; } NetworkManager netManager = connection.netManager; if (netManager == null) { return false; } Channel channel = netManager.channel(); if (!channel.attr(NetworkRegistry.FML_MARKER).get()) { return false; } Attribute<NetworkDispatcher> attr = channel.attr(NetworkDispatcher.FML_DISPATCHER); NetworkDispatcher networkDispatcher = attr.get(); Map<String, String> modList = networkDispatcher.getModList(); return modList.containsKey("cubicchunks"); }
Source:
<code>public boolean verifyEvidence(final Evidence evidence) throws RealmUnavailableException { Assert.checkNotNullParam("evidence", evidence); if (evidence instanceof PasswordGuessEvidence) { this.subject = null; boolean successfulLogin; final CallbackHandler callbackHandler = createCallbackHandler(principal, (PasswordGuessEvidence) evidence); final Subject subject = new Subject(); final LoginContext context = createLoginContext(loginConfiguration, subject, callbackHandler); log.tracef("Trying to authenticate subject %s using LoginContext %s using JaasSecurityRealm", <START> (principal != null) ? principal.getName() : "null", context.toString()); <END> try { context.login(); successfulLogin = true; this.subject = subject; } catch (LoginException le) { ElytronMessages.log.debugJAASAuthenticationFailure(principal, le); successfulLogin = false; } return successfulLogin; } else { return false; } }</code><technical_language>This null check necessary. Principal a reasonable toString(), tracef handle null arguments. "context" "context.toString()" - this way, if trace enabled, toString() is called</technical_language>

Target:
public boolean verifyEvidence(final Evidence evidence) throws RealmUnavailableException { Assert.checkNotNullParam("evidence", evidence); if (evidence instanceof PasswordGuessEvidence) { this.subject = null; boolean successfulLogin; final CallbackHandler callbackHandler = createCallbackHandler(principal, (PasswordGuessEvidence) evidence); final Subject subject = new Subject(); final LoginContext context = createLoginContext(loginConfiguration, subject, callbackHandler); log.tracef("Trying to authenticate subject %s using LoginContext %s using JaasSecurityRealm", principal, context); try { context.login(); successfulLogin = true; this.subject = subject; } catch (LoginException le) { ElytronMessages.log.debugJAASAuthenticationFailure(principal, le); successfulLogin = false; } return successfulLogin; } else { return false; } }
Source:
<code>public void not_accept_nulls_as_parameter_values() throws NoSuchMethodException { final Constructor constructor = root.getClass() .getDeclaredConstructor(BoundedContext.class, String.class); final NullPointerTester tester = new NullPointerTester(); <START> tester.setDefault(Constructor.class, constructor); <END> tester.setDefault(BoundedContext.class, boundedContext); tester.setDefault(AggregateRoot.class, root); tester.testStaticMethods(Aggregates.class, NullPointerTester.Visibility.PUBLIC); }</code><technical_language>chained calls</technical_language>

Target:
public void not_accept_nulls_as_parameter_values() throws NoSuchMethodException { final Constructor constructor = root.getClass() .getDeclaredConstructor(BoundedContext.class, String.class); final NullPointerTester tester = new NullPointerTester(); tester.setDefault(Constructor.class, constructor) .setDefault(BoundedContext.class, boundedContext) .setDefault(AggregateRoot.class, root) .testStaticMethods(Aggregates.class, NullPointerTester.Visibility.PACKAGE); }
Source:
<code>public void testCreateValid() throws IOException { HttpPut putRequest = new HttpPut(WebServerHelper.getUri("/v1/reports")); putRequest.setHeader(new BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json")); <START> putRequest.setEntity(new StringEntity(loadResource("testCreateValid"))); <END> try (CloseableHttpResponse response = WebServerHelper.getClient().execute(putRequest)) { assertEquals(Http.Status.NO_CONTENT, response.getStatusLine().getStatusCode()); } final Report writtenReport = OBJECT_MAPPER.readValue(loadResource("testCreateValid"), models.view.reports.Report.class); final String reportId = writtenReport.getId().toString(); HttpGet getRequest = new HttpGet(WebServerHelper.getUri("/v1/reports/" + reportId)); try (CloseableHttpResponse response = WebServerHelper.getClient().execute(getRequest)) { assertEquals(Http.Status.OK, response.getStatusLine().getStatusCode()); final Report returnedReport = OBJECT_MAPPER.readValue(response.getEntity().getContent(), models.view.reports.Report.class); assertEquals(writtenReport, returnedReport); } }</code><technical_language>^ specific fields test needs set for condition explicitly set in test. This data relates test is spelled out in test (it's non-obvious reading JSON relevant part of JSON blob is a test)</technical_language>

Target:
public void testCreateValid() throws IOException { final Report report = Report.fromInternal(TestBeanFactory.createReportBuilder().build()); final HttpPut putRequest = new HttpPut(WebServerHelper.getUri("/v1/reports")); putRequest.setHeader(new BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json")); putRequest.setEntity(new StringEntity(OBJECT_MAPPER.writeValueAsString(report))); try (CloseableHttpResponse response = WebServerHelper.getClient().execute(putRequest)) { assertEquals(Http.Status.NO_CONTENT, response.getStatusLine().getStatusCode()); } final String reportId = report.getId().toString(); final HttpGet getRequest = new HttpGet(WebServerHelper.getUri("/v1/reports/" + reportId)); try (CloseableHttpResponse response = WebServerHelper.getClient().execute(getRequest)) { assertEquals(Http.Status.OK, response.getStatusLine().getStatusCode()); final Report returnedReport = WebServerHelper.readContentAs(response, models.view.reports.Report.class); assertEquals(report, returnedReport); } }
Source:
<code>PendingRow(BatchMutateContext context) { <START> lastContext = context; <END> }</code><technical_language>slightly cleaner if initialize count 1 in constructor itself</technical_language>

Target:
PendingRow(BatchMutateContext context) { count = 1; lastContext = context; }
Source:
<code>static Iterator<String> getFilteredReferences(String targetNames, Collection<String> required) { List inputList = new ArrayList<>(); inputList.addAll(Arrays.asList(targetNames)); <START> return new FilteredStringsIterator(inputList, required); <END> }</code><technical_language>rewritten Arrays.asList()</technical_language>

Target:
static Iterator<String> getFilteredReferences(String targetNames, Collection<String> required) { return new FilteredStringsIterator(Arrays.asList(targetNames), required); }
Source:
<code>public void testStartNoAutoCreateThenAutoCreate() throws Exception { ClusteringServiceConfiguration creationConfigBad = ClusteringServiceConfigurationBuilder.cluster(URI.create(CLUSTER_URI_BASE + "my-application")) .defaultServerResource("defaultResource") .resourcePool("sharedPrimary", 16, MemoryUnit.MB, "serverResource1") .resourcePool("sharedSecondary", 16, MemoryUnit.MB, "serverResource2") .resourcePool("sharedTertiary", 32, MemoryUnit.MB) .build(); DefaultClusteringService creationServiceBad = new DefaultClusteringService(creationConfigBad); try { creationServiceBad.start(null); fail("Expecting IllegalStateException"); } catch (IllegalStateException e) { } List<ObservableEhcacheActiveEntity> activeEntitiesBad = observableEhcacheServerEntityService.getServedActiveEntities(); assertThat(activeEntitiesBad.size(), is(0)); ClusteringServiceConfiguration creationConfigGood = ClusteringServiceConfigurationBuilder.cluster(URI.create(CLUSTER_URI_BASE + "my-application?auto-create")) .defaultServerResource("defaultResource") .resourcePool("sharedPrimary", 16, MemoryUnit.MB, "serverResource1") .resourcePool("sharedSecondary", 16, MemoryUnit.MB, "serverResource2") .resourcePool("sharedTertiary", 32, MemoryUnit.MB) .build(); DefaultClusteringService creationServiceGood = new DefaultClusteringService(creationConfigGood); try { creationServiceGood.start(null); } catch (Exception e) { <START> fail("There should not be an error on start"); <END> } }</code><technical_language>method throws Exception instead of catching failing</technical_language>

Target:
public void testStartNoAutoCreateThenAutoCreate() throws Exception { ClusteringServiceConfiguration creationConfigBad = ClusteringServiceConfigurationBuilder.cluster(URI.create(CLUSTER_URI_BASE + "my-application")) .defaultServerResource("defaultResource") .resourcePool("sharedPrimary", 16, MemoryUnit.MB, "serverResource1") .resourcePool("sharedSecondary", 16, MemoryUnit.MB, "serverResource2") .resourcePool("sharedTertiary", 32, MemoryUnit.MB) .build(); DefaultClusteringService creationServiceBad = new DefaultClusteringService(creationConfigBad); try { creationServiceBad.start(null); fail("Expecting IllegalStateException"); } catch (IllegalStateException e) { } List<ObservableEhcacheActiveEntity> activeEntitiesBad = observableEhcacheServerEntityService.getServedActiveEntities(); assertThat(activeEntitiesBad.size(), is(0)); ClusteringServiceConfiguration creationConfigGood = ClusteringServiceConfigurationBuilder.cluster(URI.create(CLUSTER_URI_BASE + "my-application?auto-create")) .defaultServerResource("defaultResource") .resourcePool("sharedPrimary", 16, MemoryUnit.MB, "serverResource1") .resourcePool("sharedSecondary", 16, MemoryUnit.MB, "serverResource2") .resourcePool("sharedTertiary", 32, MemoryUnit.MB) .build(); DefaultClusteringService creationServiceGood = new DefaultClusteringService(creationConfigGood); creationServiceGood.start(null); }
Source:
<code>public static BoundType toBoundType(FrameBound.Type type) { switch (type) { case UNBOUNDED_PRECEDING: return UNBOUNDED_PRECEDING; case PRECEDING: return PRECEDING; case CURRENT_ROW: return CURRENT_ROW; case FOLLOWING: return FOLLOWING; case UNBOUNDED_FOLLOWING: return UNBOUNDED_FOLLOWING; default: <START> throw new UnsupportedOperationException(format("unrecognized window frame type %s", type)); <END> } }</code><technical_language>nit: perhaps, add a word bound in message</technical_language>

Target:
public static BoundType toBoundType(FrameBound.Type type) { switch (type) { case UNBOUNDED_PRECEDING: return UNBOUNDED_PRECEDING; case PRECEDING: return PRECEDING; case CURRENT_ROW: return CURRENT_ROW; case FOLLOWING: return FOLLOWING; case UNBOUNDED_FOLLOWING: return UNBOUNDED_FOLLOWING; default: throw new UnsupportedOperationException(format("unrecognized frame bound type %s", type)); } }
Source:
<code>public void execute(int iterationId) { try { StorageHelperDirector.getInstance().getItem(getStorageDomain().getStorageType()) .connectStorageToDomainByVdsId(getStorageDomain(), getVdss().get(iterationId).getId()); } catch (RuntimeException e) { <START> log.errorFormat("Failed to connect host {0} to storage server (name: {1}, id: {2}). Exception: {3}", <END> getVdss().get(iterationId).getName(), getStorageDomain().getName(), getStorageDomain().getId(), e); } }</code><technical_language>name/id misleading - name/id of storage server. Please replace domain name/id</technical_language>

Target:
public void execute(int iterationId) { VDS vds = getVdss().get(iterationId); try { StorageHelperDirector.getInstance().getItem(getStorageDomain().getStorageType()) .connectStorageToDomainByVdsId(getStorageDomain(), vds.getId()); } catch (RuntimeException e) { log.errorFormat("Failed to connect host {0} to storage domain (name: {1}, id: {2}). Exception: {3}", vds.getName(), getStorageDomain().getName(), getStorageDomain().getId(), e); } }
Source:
<code>public static String getAliceLibraryVersion() { if (!aliceLibraryVersion.equals("")) { return aliceLibraryVersion; } else { try { <START> String gitCommand = "git show"; <END> Process gitGetter = Runtime.getRuntime().exec(gitCommand); Scanner s = new Scanner(gitGetter.getInputStream(), "UTF-8"); if (s.hasNextLine()) { String fullCommitLine = s.nextLine(); String pattern = "commit (\\d+)"; aliceLibraryVersion = fullCommitLine.replaceAll(pattern, "$1"); return aliceLibraryVersion; } return "Couldn't get hash of most recent commit"; } catch (IOException e) { e.printStackTrace(); return "Couldn't load Git status"; } } }</code><technical_language>Git show potentially get messy. in fingerprint.py</technical_language>

Target:
public static String getAliceLibraryVersion() { if (!aliceLibraryVersion.equals("")) { return aliceLibraryVersion; } else { try { String gitCommand = "git log -1 --format=%h"; Process gitGetter = Runtime.getRuntime().exec(gitCommand); Scanner s = new Scanner(gitGetter.getInputStream(), "UTF-8"); if (s.hasNextLine()) { aliceLibraryVersion = s.nextLine(); return aliceLibraryVersion; } return "Couldn't get hash of most recent commit"; } catch (IOException e) { e.printStackTrace(); return "Couldn't load Git status"; } } }
Source:
<code>public static LocalizedString process(LocalizedString origin) { <START> LocalizedString result = new LocalizedString(); <END> for (Locale l : origin.getLocales()) { result = result.with(l, process(origin.getContent(l))); } return result; }</code><technical_language>a LocalizedString.Builder, is a more efficient instantiate multiple locales of a LocalizedString</technical_language>

Target:
public static LocalizedString process(LocalizedString origin) { return origin.map(Component::process); }
Source:
<code>public String getMimetypeFromFilenameWithBlobMimetypeFallback(String filename, Blob blob, String defaultMimetype) throws MimetypeDetectionException { try { return getMimetypeFromFilename(filename); } catch (MimetypeNotFoundException e) { String mimeTypeName = blob.getMimeType(); MimetypeEntry mimetypeEntry = getMimetypeEntryByName(mimeTypeName); if (mimetypeEntry != null) { return mimeTypeName; } else { <START> return getMimetypeFromBlobWithDefault(blob, defaultMimetype); <END> } } }</code><technical_language>be: // failed detect mimetype extension: // fallback blob defined mimetype String mimeTypeName = blob.getMimeType(); if (isMimetypeEntry(mimeTypeName)) { return mimeTypeName; } // failed detect mimetype blob: // fallback calculate mimetype blob content return getMimetypeFromBlobWithDefault(blob, defaultMimetype); protected boolean isMimetypeEntry(String name) { return mimetypeByNormalisedRegistry.containsKey(name); }</technical_language>

Target:
public String getMimetypeFromFilenameWithBlobMimetypeFallback(String filename, Blob blob, String defaultMimetype) throws MimetypeDetectionException { try { return getMimetypeFromFilename(filename); } catch (MimetypeNotFoundException e) { String mimeTypeName = blob.getMimeType(); if (isMimetypeEntry(mimeTypeName)) { return mimeTypeName; } else { return getMimetypeFromBlobWithDefault(blob, defaultMimetype); } } }
Source:
<code>public List<PostEventResultTask> splitTask() { <START> return ImmutableList.of(this); <END> }</code><technical_language>need splitting</technical_language>

Target:
public List<PostEventResultTask> splitTask() { if (events.size() > 1) { int splitPoint = events.size() / 2; return ImmutableList.of( new PostEventResultTask(currentAgentId, events.subList(0, splitPoint)), new PostEventResultTask(currentAgentId, events.subList(splitPoint, events.size()))); } return ImmutableList.of(this); }
Source:
<code>public void logHttp() { Connector connector = newConnector("HTTP/1.1", "http"); when(tomcat.getService().findConnectors()).thenReturn(new Connector[] {connector}); underTest.log(tomcat); <START> verify(logger).info(eq("HTTP connector enabled on port {}"), anyInt()); <END> verifyNoMoreInteractions(logger); }</code><technical_language>eq(1234)</technical_language>

Target:
public void logHttp() { Connector connector = newConnector("HTTP/1.1", "http"); when(tomcat.getService().findConnectors()).thenReturn(new Connector[] {connector}); underTest.log(tomcat); verify(logger).info(eq("HTTP connector enabled on port {}"), eq(1234)); verifyNoMoreInteractions(logger); }
Source:
<code>protected void run(EventEnvelope event) { <START> checkState(isActive(), "Notifying by a non-activated subscription."); <END> SubscriptionUpdate update = createSubscriptionUpdate(event); notifyAction.accept(update); }</code><technical_language>error message more. consider listing some details caused failure in particular</technical_language>

Target:
protected void run(EventEnvelope event) { checkState(isActive(), "Dispatched an event of type %s to the non-active subscription with ID %s", TypeUrl.of(event.getMessage()), subscription.getId().getValue()); SubscriptionUpdate update = createSubscriptionUpdate(event); notifyAction.accept(update); }
Source:
<code><START> public void tearDown() throws Exception { <END> fc.delete(testRootDirPath, true); }</code><technical_language>@After; handle case fc == null</technical_language>

Target:
public void tearDown() throws Exception { if (fc != null) { fc.delete(testRootDirPath, true); } }
Source:
<code><START> public Mono<Void> forceCloseHandle(String handleId) { <END> return withContext(context -> forceCloseHandleWithResponse(handleId, context)).flatMap(FluxUtil::toMono); }</code><technical_language>Wrap this try-catch return error in Mono.error(). Do for other public methods return Mono/Flux/PagedFlux</technical_language>

Target:
public Mono<Void> forceCloseHandle(String handleId) { try { return withContext(context -> forceCloseHandleWithResponse(handleId, context)).flatMap(FluxUtil::toMono); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
<code>public void edit(final VmInterfaceModel iface) { driver.edit(iface); networkFilterParameterWidget.edit(iface.getNetworkFilterParameterListModel()); <START> networkFilterParameterWidget.setEnabled(iface.isNetworkFilterParameterWidgetVisible()); <END> networkFilterParameterWidget.setVisible(iface.isNetworkFilterParameterWidgetVisible()); hideMacWhenNotEnabled(iface); iface.getMAC().getPropertyChangedEvent().addListener((ev, sender, args) -> { if ("IsAvailable".equals(args.propertyName)) { hideMacWhenNotEnabled(iface); } }); }</code><technical_language>getIsChangeable for this (of need set properly)</technical_language>

Target:
public void edit(final VmInterfaceModel iface) { driver.edit(iface); networkFilterParameterWidget.edit(iface.getNetworkFilterParameterListModel()); networkFilterParameterWidget.setEnabled(iface.getNetworkFilterParameterListModel().getIsAvailable()); networkFilterParameterWidget.setVisible(iface.getNetworkFilterParameterListModel().getIsAvailable()); hideMacWhenNotEnabled(iface); iface.getMAC().getPropertyChangedEvent().addListener((ev, sender, args) -> { if ("IsAvailable".equals(args.propertyName)) { hideMacWhenNotEnabled(iface); } }); }
Source:
<code>private void copyFiles() { try { String xmlSourceFolder = "src/test/resources/"; String catalogLargeFile = "catalogLarge.xml"; String catalogSmallFile = "catalogSmall.xml"; FileUtils.copyFile(new File(xmlSourceFolder + catalogLargeFile), new File(SOURCE_FOLDER_PATH + catalogLargeFile)); FileUtils.copyFile(new File(xmlSourceFolder + catalogSmallFile), new File(SOURCE_FOLDER_PATH + catalogSmallFile)); } catch (IOException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>If copy fails, fail test case? suppressed? reason for suppressing</technical_language>

Target:
public void copyFiles() throws IOException { URL largeXMLUrl = this.getClass().getResource("/" + CATALOG_LARGE_XML_FILE_NAME); URL smallXMLUrl = this.getClass().getResource("/" + CATALOG_SMALL_XML_FILE_NAME); FileUtils.copyFile(new File(largeXMLUrl.getFile()), new File(sourceFolder, CATALOG_LARGE_XML_FILE_NAME)); FileUtils.copyFile(new File(smallXMLUrl.getFile()), new File(sourceFolder, CATALOG_SMALL_XML_FILE_NAME)); }
Source:
<code>FileStoreAttributeCache(Path file) throws IOException, InterruptedException { if (!Files.exists(file)) { throw new FileNotFoundException(file.toString()); } Path dir = Files.isDirectory(file) ? file : file.getParent(); Path probe = dir.resolve("probe-timestamp-resolution"); Files.createFile(probe); try { FileTime startTime = Files.getLastModifiedTime(probe); FileTime actTime = startTime; long sleepTime = 64; while (actTime.compareTo(startTime) <= 0) { TimeUnit.NANOSECONDS.sleep(sleepTime); try (OutputStream fos = Files.newOutputStream(probe)) { } actTime = Files.getLastModifiedTime(probe); <START> sleepTime = sleepTime * 2; <END> } fsTimestampResolution = Duration.between(startTime.toInstant(), actTime.toInstant()); } finally { Files.delete(probe); } }</code><technical_language>this limited some maximum, say, a second? a 2s granularity, touch file some 25-26 times, sleepTime > 1s</technical_language>

Target:
FileStoreAttributeCache(Path file) throws IOException, InterruptedException { if (!Files.exists(file)) { throw new FileNotFoundException(file.toString()); } Path dir = Files.isDirectory(file) ? file : file.getParent(); Path probe = dir.resolve("probe-timestamp-resolution"); Files.createFile(probe); try { FileTime startTime = Files.getLastModifiedTime(probe); FileTime actTime = startTime; long sleepTime = 64; while (actTime.compareTo(startTime) <= 0) { TimeUnit.NANOSECONDS.sleep(sleepTime); try (OutputStream fos = Files.newOutputStream(probe)) { } actTime = Files.getLastModifiedTime(probe); if (sleepTime < 100_000_000L) { sleepTime = sleepTime * 2; } } fsTimestampResolution = Duration.between(startTime.toInstant(), actTime.toInstant()); } finally { Files.delete(probe); } }
Source:
<code>protected Reader getReader() { <START> logger.info("this.script: " + this.script); <END> return new StringReader(script); }</code><technical_language>please remove this log a getter</technical_language>

Target:
protected Reader getReader() { return new StringReader(script); }
Source:
<code>public void writeCrashReport(final File file) throws JSONException { HockeyLog.debug("Writing unhandled exception to: " + file.getAbsolutePath()); BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(file)); writeHeader(writer, FIELD_APP_PACKAGE, appPackage); writeHeader(writer, FIELD_APP_VERSION_CODE, appVersionCode); writeHeader(writer, FIELD_APP_VERSION_NAME, appVersionName); writeHeader(writer, FIELD_OS_VERSION, osVersion); writeHeader(writer, FIELD_OS_BUILD, osBuild); writeHeader(writer, FIELD_DEVICE_MANUFACTURER, deviceManufacturer); writeHeader(writer, FIELD_DEVICE_MODEL, deviceModel); writeHeader(writer, FIELD_THREAD_NAME, threadName); writeHeader(writer, FIELD_CRASH_REPORTER_KEY, reporterKey); writeHeader(writer, FIELD_APP_START_DATE, JSONDateUtils.toString(appStartDate)); writeHeader(writer, FIELD_APP_CRASH_DATE, JSONDateUtils.toString(appCrashDate)); if (isXamarinException) { writeHeader(writer, FIELD_FORMAT, FIELD_FORMAT_VALUE); } writer.write("\n"); if (throwableStackTrace.length() > STACKTRACE_MAX_LENGTH) { <START> throwableStackTrace = throwableStackTrace.substring(0, throwableStackTrace.lastIndexOf('\n', STACKTRACE_MAX_LENGTH - 1) + 1); <END> } writer.write(throwableStackTrace); writer.flush(); } catch (IOException e) { HockeyLog.error("Error saving crash report!", e); } finally { try { if (writer != null) { writer.close(); } } catch (IOException e1) { HockeyLog.error("Error saving crash report!", e1); } } }</code><technical_language>Truncate generating reduce memory usage</technical_language>

Target:
public void writeCrashReport(final File file) throws JSONException { HockeyLog.debug("Writing unhandled exception to: " + file.getAbsolutePath()); BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(file)); writeHeader(writer, FIELD_APP_PACKAGE, appPackage); writeHeader(writer, FIELD_APP_VERSION_CODE, appVersionCode); writeHeader(writer, FIELD_APP_VERSION_NAME, appVersionName); writeHeader(writer, FIELD_OS_VERSION, osVersion); writeHeader(writer, FIELD_OS_BUILD, osBuild); writeHeader(writer, FIELD_DEVICE_MANUFACTURER, deviceManufacturer); writeHeader(writer, FIELD_DEVICE_MODEL, deviceModel); writeHeader(writer, FIELD_THREAD_NAME, threadName); writeHeader(writer, FIELD_CRASH_REPORTER_KEY, reporterKey); writeHeader(writer, FIELD_APP_START_DATE, JSONDateUtils.toString(appStartDate)); writeHeader(writer, FIELD_APP_CRASH_DATE, JSONDateUtils.toString(appCrashDate)); if (isXamarinException) { writeHeader(writer, FIELD_FORMAT, FIELD_FORMAT_VALUE); } writer.write("\n"); writer.write(throwableStackTrace); writer.flush(); } catch (IOException e) { HockeyLog.error("Error saving crash report!", e); } finally { try { if (writer != null) { writer.close(); } } catch (IOException e1) { HockeyLog.error("Error saving crash report!", e1); } } }
Source:
<code>protected void assertValues(TestDescriptor d, String id, String name, String desc) { <START> Assert.assertEquals(id, d.id); <END> Assert.assertEquals(name, d.name); Assert.assertEquals(desc, d.desc); }</code><technical_language>import static Assert static methods</technical_language>

Target:
protected void assertValues(TestDescriptor d, String id, String name, String desc) { assertEquals(id, d.id); assertEquals(name, d.name); assertEquals(desc, d.desc); }
Source:
<code>public void setUp() throws Exception { tmp = File.createTempFile("jgit_test_", "_tmp"); CleanupThread.deleteOnShutdown(tmp); if (!tmp.delete() || !tmp.mkdir()) { throw new IOException("Cannot create " + tmp); } mockSystemReader = new MockSystemReader(); SystemReader.setInstance(mockSystemReader); FS.getFileStoreAttributes(tmp.toPath().getParent()); FileBasedConfig jgitConfig = new FileBasedConfig( new File(tmp, "jgitconfig"), FS.DETECTED); <START> jgitConfig.save(); <END> FileBasedConfig systemConfig = new FileBasedConfig( new File(tmp, "systemgitconfig"), FS.DETECTED); FileBasedConfig userConfig = new FileBasedConfig( new File(tmp, "usergitconfig"), FS.DETECTED); userConfig.setBoolean(ConfigConstants.CONFIG_GC_SECTION, null, ConfigConstants.CONFIG_KEY_AUTODETACH, false); userConfig.save(); mockSystemReader.setJGitConfig(jgitConfig); mockSystemReader.setSystemGitConfig(systemConfig); mockSystemReader.setUserGitConfig(userConfig); ceilTestDirectories(getCeilings()); author = new PersonIdent("J. Author", "jauthor@example.com"); committer = new PersonIdent("J. Committer", "jcommitter@example.com"); final WindowCacheConfig c = new WindowCacheConfig(); c.setPackedGitLimit(128 * WindowCacheConfig.KB); c.setPackedGitWindowSize(8 * WindowCacheConfig.KB); c.setPackedGitMMAP(useMMAP); c.setDeltaBaseCacheLimit(8 * WindowCacheConfig.KB); c.install(); }</code><technical_language>this</technical_language>

Target:
public void setUp() throws Exception { tmp = File.createTempFile("jgit_test_", "_tmp"); CleanupThread.deleteOnShutdown(tmp); if (!tmp.delete() || !tmp.mkdir()) { throw new IOException("Cannot create " + tmp); } mockSystemReader = new MockSystemReader(); SystemReader.setInstance(mockSystemReader); FS.getFileStoreAttributes(tmp.toPath().getParent()); FileBasedConfig jgitConfig = new FileBasedConfig( new File(tmp, "jgitconfig"), FS.DETECTED); FileBasedConfig systemConfig = new FileBasedConfig(jgitConfig, new File(tmp, "systemgitconfig"), FS.DETECTED); FileBasedConfig userConfig = new FileBasedConfig(systemConfig, new File(tmp, "usergitconfig"), FS.DETECTED); userConfig.setBoolean(ConfigConstants.CONFIG_GC_SECTION, null, ConfigConstants.CONFIG_KEY_AUTODETACH, false); userConfig.save(); mockSystemReader.setJGitConfig(jgitConfig); mockSystemReader.setSystemGitConfig(systemConfig); mockSystemReader.setUserGitConfig(userConfig); ceilTestDirectories(getCeilings()); author = new PersonIdent("J. Author", "jauthor@example.com"); committer = new PersonIdent("J. Committer", "jcommitter@example.com"); final WindowCacheConfig c = new WindowCacheConfig(); c.setPackedGitLimit(128 * WindowCacheConfig.KB); c.setPackedGitWindowSize(8 * WindowCacheConfig.KB); c.setPackedGitMMAP(useMMAP); c.setDeltaBaseCacheLimit(8 * WindowCacheConfig.KB); c.install(); }
Source:
<code>public boolean match(final Message msg) { long m; try { if (msg instanceof IMAPMessage) { <START> m = ((IMAPMessage) msg).getModSeq(); <END> } else { return false; } } catch (MessagingException e) { return false; } return m >= modSeq; }</code><technical_language>u return here</technical_language>

Target:
public boolean match(final Message msg) { throw new UnsupportedOperationException("This method should not be used. Only for override purpose."); }
Source:
<code>public void start(Context context) { if (locationManager == null) { locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); } try { locationManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, minTime, minDistance, this); } catch (java.lang.SecurityException ex) { Log.i(TAG, "fail to request location update, ignore", ex); } catch (IllegalArgumentException ex) { Log.d(TAG, "network provider does not exist, " + ex.getMessage()); } try { <START> locationManager.requestLocationUpdates( <END> LocationManager.GPS_PROVIDER, minTime, minDistance, this); } catch (java.lang.SecurityException ex) { Log.i(TAG, "fail to request location update, ignore", ex); } catch (IllegalArgumentException ex) { Log.d(TAG, "gps provider does not exist " + ex.getMessage()); } coordinateJsonObject = new JsonObject(); jsonObject = new JsonObject(); startJsonDataLogging(); }</code><technical_language>Do want request updates NETWORK GPS? opposed GPS fallback NETWORK such</technical_language>

Target:
public void start(Context context) { if (locationManager == null) { locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); } if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) { if (getRecorderListener() != null) { String errorMsg = context.getString(R.string.rsb_system_feature_gps_text); getRecorderListener().onFail(this, new IllegalStateException(errorMsg)); } return; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { PackageManager pm = context.getPackageManager(); int hasPerm = pm.checkPermission(Manifest.permission.ACCESS_FINE_LOCATION, context.getPackageName()); if (hasPerm != PackageManager.PERMISSION_GRANTED) { if (getRecorderListener() != null) { String errorMsg = context.getString(R.string.rsb_permission_location_desc); getRecorderListener().onFail(this, new IllegalStateException(errorMsg)); } return; } } try { locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, minTime, minDistance, this); } catch (java.lang.SecurityException ex) { Log.i(TAG, "fail to request location update, ignore", ex); } catch (IllegalArgumentException ex) { Log.d(TAG, "gps provider does not exist " + ex.getMessage()); } coordinateJsonObject = new JsonObject(); jsonObject = new JsonObject(); startJsonDataLogging(); }
Source:
<code>public boolean onCreateOptionsMenu(Menu menu) { MenuItem buttonSettings = menu.add(R.string.title_settings); buttonSettings.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); buttonSettings.setOnMenuItemClickListener(new MenuItem. OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { Intent settingsIntent = new Intent(AddEntryActivity.this, SettingsActivity.class); settingsIntent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsFragment.class.getName()); settingsIntent.putExtra(PreferenceActivity.EXTRA_NO_HEADERS, true); AddEntryActivity.this.startActivity(settingsIntent); return false; } }); MenuItem buttonSignout = menu.add(R.string.title_signout); buttonSignout.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); buttonSignout.setOnMenuItemClickListener(new MenuItem. OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { <START> ApiInterface.getInstance().logOut(); <END> Intent logOut = new Intent(AddEntryActivity.this, LoginActivity.class); logOut.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(logOut); return false; } }); return true; }</code><technical_language>Remove trailing whitespace here</technical_language>

Target:
public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.items, menu); return super.onCreateOptionsMenu(menu); }
Source:
<code>public Map<TaskName, Set<SystemStreamPartition>> group(final Set<SystemStreamPartition> ssps) { Map<TaskName, Set<SystemStreamPartition>> groupedMap = new HashMap<>(); if (ssps == null) { throw new SamzaException("ssp set cannot be null!"); } if (ssps.size() == 0) { throw new SamzaException("Cannot process stream task with no input system stream partitions"); } <START> if (isPassthroughJobCoordinator) { <END> final TaskName taskName = new TaskName(String.format("Task-%d", containerId)); groupedMap.put(taskName, ssps); } else { IntStream.range(0, taskCount).forEach(i -> { final TaskName taskName = new TaskName(String.format("Task-%s", String.valueOf(i))); groupedMap.put(taskName, ssps); }); } return groupedMap; }</code><technical_language>@prateekm I chatting, proposed a grouper - AllSspToAllTaskGrouper cleaner for this scenario. way, muddle existing Grouper implementation</technical_language>

Target:
public Map<TaskName, Set<SystemStreamPartition>> group(final Set<SystemStreamPartition> ssps) { Map<TaskName, Set<SystemStreamPartition>> groupedMap = new HashMap<>(); if (ssps == null) { throw new SamzaException("ssp set cannot be null!"); } if (ssps.size() == 0) { throw new SamzaException("Cannot process stream task with no input system stream partitions"); } processorNames.forEach(processorName -> { final TaskName taskName = new TaskName(String.format("Task-%s", processorName)); groupedMap.put(taskName, ssps); }); return groupedMap; }
Source:
<code>static StatsSnapshot convertQuotaToStatsSnapshot(Map<String, Map<String, Long>> quotaMap) { Map<String, StatsSnapshot> accountValidSizeMap = new HashMap<>(); long totalSize = 0; <START> for (Map.Entry<String, Map<String, Long>> entry : quotaMap.entrySet()) { <END> long subTotalSize = 0; Map<String, StatsSnapshot> containerValidSizeMap = new HashMap<>(); for (Map.Entry<String, Long> innerEntry : entry.getValue().entrySet()) { subTotalSize += innerEntry.getValue(); containerValidSizeMap.put(innerEntry.getKey(), new StatsSnapshot(innerEntry.getValue(), null)); } totalSize += subTotalSize; accountValidSizeMap.put(entry.getKey(), new StatsSnapshot(subTotalSize, containerValidSizeMap)); } return new StatsSnapshot(totalSize, accountValidSizeMap); }</code><technical_language>name this accountEntry containerEntry more readable</technical_language>

Target:
static StatsSnapshot convertQuotaToStatsSnapshot(Map<String, Map<String, Long>> quotaMap) { Map<String, StatsSnapshot> accountValidSizeMap = new HashMap<>(); long totalSize = 0; for (Map.Entry<String, Map<String, Long>> accountEntry : quotaMap.entrySet()) { long subTotalSize = 0; Map<String, StatsSnapshot> containerValidSizeMap = new HashMap<>(); for (Map.Entry<String, Long> containerEntry : accountEntry.getValue().entrySet()) { subTotalSize += containerEntry.getValue(); containerValidSizeMap.put(containerEntry.getKey(), new StatsSnapshot(containerEntry.getValue(), null)); } totalSize += subTotalSize; accountValidSizeMap.put(accountEntry.getKey(), new StatsSnapshot(subTotalSize, containerValidSizeMap)); } return new StatsSnapshot(totalSize, accountValidSizeMap); }
Source:
<code>NativeSchemaIndexAccessor<DurationSchemaKey,NativeSchemaValue> makeAccessorWithSamplingConfig( IndexSamplingConfig samplingConfig ) throws IOException { <START> TemporalIndexFiles.FileLayout<DurationSchemaKey> fileLayout = new TemporalIndexFiles.FileLayout<>( getIndexFile(), layout, ValueGroup.LOCAL_DATE_TIME ); <END> return new TemporalIndexAccessor.PartAccessor<>( pageCache, fs, fileLayout, IMMEDIATE, monitor, schemaIndexDescriptor, indexId, samplingConfig ); }</code><technical_language>Copy pasta: ValueGroup.LOCAL_DATE_TIME, ValueGroup.DURATION</technical_language>

Target:
NativeSchemaIndexAccessor<DurationSchemaKey,NativeSchemaValue> makeAccessorWithSamplingConfig( IndexSamplingConfig samplingConfig ) throws IOException { TemporalIndexFiles.FileLayout<DurationSchemaKey> fileLayout = new TemporalIndexFiles.FileLayout<>( getIndexFile(), layout, ValueGroup.DURATION ); return new TemporalIndexAccessor.PartAccessor<>( pageCache, fs, fileLayout, IMMEDIATE, monitor, schemaIndexDescriptor, indexId, samplingConfig ); }
Source:
<code>public void setEndDate(Date endDate) { this.endDate = endDate != null ? (Date) endDate.clone() : null; <START> } <END></code><technical_language>Hii @ribhavsharma, this extra brace is causing build fail, kindly correct :)</technical_language>

Target:
public void setEndDate(Date endDate) { this.endDate = endDate != null ? new Date(endDate.getTime()) : null; }
Source:
<code>private void pulseDigging() { float hardness = digging.getMaterialValues().getHardness() * 1000; hardness *= 5; <START> long duration = System.currentTimeMillis() - diggingStarted; <END> double completion = (double) duration / hardness; int stage = (int) (completion * 10); if (stage > 9) stage = 9; broadcastBlockBreakAnimation(digging, stage); }</code><technical_language>base this world thread ticking, instead of system time in milliseconds</technical_language>

Target:
private void pulseDigging() { ++diggingTicks; float hardness = digging.getMaterialValues().getHardness() * 20; hardness *= 5; double completion = (double) diggingTicks / hardness; int stage = (int) (completion * 10); if (stage > 9) stage = 9; broadcastBlockBreakAnimation(digging, stage); }