auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void cleanupLaunchLocal(ILaunch launch) throws DebugException { if (launch instanceof GdbLaunch) { final GdbLaunch gdbLaunch = (GdbLaunch)launch; Query<Object> launchShutdownQuery = new Query<Object>() { @Override protected void execute(DataRequestMonitor<Object> rm) { gdbLaunch.shutdownSession(rm); } }; gdbLaunch.getSession().getExecutor().execute(launchShutdownQuery); try { launchShutdownQuery.get(); } catch (InterruptedException e) { <START> throw new DebugException( new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "InterruptedException while shutting down debugger launch " + launch, e)); END> } catch (ExecutionException e) { throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error in shutting down debugger launch " + launch, e)); } } }</code><technical_language>I approach in general, internal non-API GdbPlugin -- in this case TCF Plugin creates error message plugin ID here</technical_language>

Target:
protected void cleanupLaunchLocal(ILaunch launch) throws DebugException { if (launch instanceof GdbLaunch) { final GdbLaunch gdbLaunch = (GdbLaunch)launch; Query<Object> launchShutdownQuery = new Query<Object>() { @Override protected void execute(DataRequestMonitor<Object> rm) { gdbLaunch.shutdownSession(rm); } }; gdbLaunch.getSession().getExecutor().execute(launchShutdownQuery); try { launchShutdownQuery.get(); } catch (InterruptedException e) { throw new DebugException( new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), DebugException.INTERNAL_ERROR, "InterruptedException while shutting down debugger launch " + launch, e)); } catch (ExecutionException e) { throw new DebugException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), DebugException.REQUEST_FAILED, "Error in shutting down debugger launch " + launch, e)); } } }
Source:
<code>public void changeRealmTokenAlgorithm() throws Exception { TokenSignatureUtil.registerKeyProvider("master", "P-256", adminClient, testContext); TokenSignatureUtil.changeRealmTokenSignatureProvider("master", adminClient, Algorithm.ES256); Keycloak adminClient = AdminClientUtil.createAdminClient(suiteContext.isAdapterCompatTesting(), suiteContext.getAuthServerInfo().getContextRoot().toString()); <START> try { <END> AccessTokenResponse accessToken = adminClient.tokenManager().getAccessToken(); TokenVerifier<AccessToken> verifier = TokenVerifier.create(accessToken.getToken(), AccessToken.class); assertEquals(Algorithm.ES256, verifier.getHeader().getAlgorithm().name()); assertNotNull(adminClient.realms().findAll()); String whoAmiUrl = suiteContext.getAuthServerInfo().getContextRoot().toString() + "/auth/admin/master/console/whoami"; JsonNode jsonNode = SimpleHttp.doGet(whoAmiUrl, client).auth(accessToken.getToken()).asJson(); assertNotNull(jsonNode.get("realm")); assertNotNull(jsonNode.get("userId")); } finally { adminClient.close(); } }</code><technical_language>try resources (applies other places too)</technical_language>

Target:
public void changeRealmTokenAlgorithm() throws Exception { TokenSignatureUtil.registerKeyProvider("master", "P-256", adminClient, testContext); TokenSignatureUtil.changeRealmTokenSignatureProvider("master", adminClient, Algorithm.ES256); try (Keycloak adminClient = AdminClientUtil.createAdminClient(suiteContext.isAdapterCompatTesting(), suiteContext.getAuthServerInfo().getContextRoot().toString())) { AccessTokenResponse accessToken = adminClient.tokenManager().getAccessToken(); TokenVerifier<AccessToken> verifier = TokenVerifier.create(accessToken.getToken(), AccessToken.class); assertEquals(Algorithm.ES256, verifier.getHeader().getAlgorithm().name()); assertNotNull(adminClient.realms().findAll()); String whoAmiUrl = suiteContext.getAuthServerInfo().getContextRoot().toString() + "/auth/admin/master/console/whoami"; JsonNode jsonNode = SimpleHttp.doGet(whoAmiUrl, client).auth(accessToken.getToken()).asJson(); assertNotNull(jsonNode.get("realm")); assertNotNull(jsonNode.get("userId")); } }
Source:
<code>public Result invoke(List<VDS> sourceHosts, List<VDS> destinationHosts, VmDao vmDao) { List<VDS> validDestinationHosts; for (VDS sourceHost : sourceHosts){ <START> log.debug("Get all migratable vms from host '{}'", sourceHost.getName()); <END> List<VM> migratableVmsOnHost = getMigratableVmsRunningOnVds(vmDao, sourceHost.getId()); if (migratableVmsOnHost != null && !migratableVmsOnHost.isEmpty()){ Collections.sort(migratableVmsOnHost, VmCpuUsageComparator.INSTANCE); for (VM vmToMigrate : migratableVmsOnHost){ if (vmToMigrate != null){ log.debug("Validate if vm '{}' not over utilized CPU and memory of destination hosts", vmToMigrate.getName()); validDestinationHosts = getValidHosts( destinationHosts, cluster, vmToMigrate, highCpuUtilization, requiredMemory ); if (!validDestinationHosts.isEmpty()){ return new Result(vmToMigrate, validDestinationHosts); } } } } } return null; }</code><technical_language>Artyom, this is useful all, scheduling a VM other logs</technical_language>

Target:
public Result invoke(List<VDS> sourceHosts, List<VDS> destinationHosts, VmDao vmDao) { List<VDS> validDestinationHosts; for (VDS sourceHost : sourceHosts){ List<VM> migratableVmsOnHost = getMigratableVmsRunningOnVds(vmDao, sourceHost.getId()); if (migratableVmsOnHost != null && !migratableVmsOnHost.isEmpty()){ Collections.sort(migratableVmsOnHost, VmCpuUsageComparator.INSTANCE); for (VM vmToMigrate : migratableVmsOnHost){ if (vmToMigrate != null){ validDestinationHosts = getValidHosts( destinationHosts, cluster, vmToMigrate, highCpuUtilization, requiredMemory ); if (!validDestinationHosts.isEmpty()){ log.debug("Vm '{}' selected for migration", vmToMigrate.getName()); return new Result(vmToMigrate, validDestinationHosts); } } } } } return null; }
Source:
<code>public void release() { RCLogger.i(TAG, "release()"); if (audioManager != null) { audioManager.close(); audioManager = null; } <START> <END> state = DeviceState.OFFLINE; isServiceAttached = false; isServiceInitialized = false; }</code><technical_language>close() signaling client device state is set offline</technical_language>

Target:
public void release() { RCLogger.i(TAG, "release()"); if (audioManager != null) { audioManager.close(); audioManager = null; } signalingClient.close(); state = DeviceState.OFFLINE; isServiceAttached = false; isServiceInitialized = false; }
Source:
<code>public void testMultipleDynamicFormsSameType() throws Exception { if (!endToEndTestEnabled()) { return; } try { createNewNote(); setTextOfParagraph(1, "%spark println(\"Howdy \"+z.select(\"fruits\", Seq((\"1\",\"Apple\")," + "(\"2\",\"Orange\"),(\"3\",\"Peach\")))); println(\"Howdy \"+z.select(\"planets\", " + "Seq((\"1\",\"Venus\"),(\"2\",\"Earth\"),(\"3\",\"Mars\"))))"); runParagraph(1); waitForParagraph(1, "FINISHED"); collector.checkThat("Output text should not display any of the options in select form", driver.findElement(By.xpath(getParagraphXPath(1) + " CoreMatchers.equalTo("Howdy \nHowdy ")); Select dropDownMenu = new Select(driver.findElement(By.xpath((getParagraphXPath(1) + " dropDownMenu.selectByVisibleText("Apple"); collector.checkThat("After selection in drop down menu, output should not display any of the options", driver.findElement(By.xpath(getParagraphXPath(1) + " CoreMatchers.equalTo("Howdy \nHowdy ")); runParagraph(1); waitForParagraph(1, "FINISHED"); <START> collector.checkThat("Only after paragraph run we should see the new output including the selected option", <END> driver.findElement(By.xpath(getParagraphXPath(1) + " CoreMatchers.equalTo("Howdy 1\nHowdy ")); deleteTestNotebook(driver); } catch (Exception e) { handleException("Exception in ParagraphActionsIT while testSingleDynamicFormTextInput ", e); } }</code><technical_language>"Only paragraph run new output ~" -> "Only running paragraph, new output ~"</technical_language>

Target:
public void testMultipleDynamicFormsSameType() throws Exception { if (!endToEndTestEnabled()) { return; } try { createNewNote(); setTextOfParagraph(1, "%spark println(\"Howdy \"+z.select(\"fruits\", Seq((\"1\",\"Apple\")," + "(\"2\",\"Orange\"),(\"3\",\"Peach\")))); println(\"Howdy \"+z.select(\"planets\", " + "Seq((\"1\",\"Venus\"),(\"2\",\"Earth\"),(\"3\",\"Mars\"))))"); runParagraph(1); waitForParagraph(1, "FINISHED"); collector.checkThat("Output text should not display any of the options in select form", driver.findElement(By.xpath(getParagraphXPath(1) + " CoreMatchers.equalTo("Howdy \nHowdy ")); Select dropDownMenu = new Select(driver.findElement(By.xpath("(" + (getParagraphXPath(1) + " dropDownMenu.selectByVisibleText("Apple"); collector.checkThat("After selection in drop down menu, output should display the new option we selected", driver.findElement(By.xpath(getParagraphXPath(1) + " CoreMatchers.equalTo("Howdy 1\nHowdy ")); driver.findElement(By.xpath(getParagraphXPath(1) + " clickAndWait(By.xpath(getParagraphXPath(1) + " Select sameDropDownMenu = new Select(driver.findElement(By.xpath("(" + (getParagraphXPath(1) + " sameDropDownMenu.selectByVisibleText("Earth"); waitForParagraph(1, "FINISHED"); collector.checkThat("After 'Run on selection change' checkbox is unchecked, the paragraph should not run if selecting a different option", driver.findElement(By.xpath(getParagraphXPath(1) + " CoreMatchers.equalTo("Howdy 1\nHowdy ")); deleteTestNotebook(driver); } catch (Exception e) { handleException("Exception in ParagraphActionsIT while testMultipleDynamicFormsSameType ", e); } }
Source:
<code>public static ErrorMessageFactory shouldBeEqualByComparingFieldByFieldRecursive(Object actual, Object other, List<Difference> differences) { List<String> descriptionOfDifferences = new ArrayList<>(differences.size()); for (Difference difference : differences) { descriptionOfDifferences.add(format("%nPath to difference: <%s>%nexpected: <%s>%nbut was: <%s>", join(difference.getPath(), "."), difference.getOther(), difference.getActual())); } <START> return new ShouldBeEqualByComparingFieldByFieldRecursive("Expecting: <%s>%nto equal to: <%s>%nwhen recursively comparing field by field, but found the following difference(s):%n" <END> + join(descriptionOfDifferences, format("%n")), actual, other); }</code><technical_language>equal</technical_language>

Target:
public static ErrorMessageFactory shouldBeEqualByComparingFieldByFieldRecursive(Object actual, Object other, List<Difference> differences) { List<String> descriptionOfDifferences = new ArrayList<>(differences.size()); for (Difference difference : differences) { descriptionOfDifferences.add(format("%nPath to difference: <%s>%nexpected: <%s>%nbut was: <%s>", join(difference.getPath()).with("."), difference.getOther(), difference.getActual())); } return new ShouldBeEqualByComparingFieldByFieldRecursive("Expecting: <%s>%nto be equal to: <%s>%nwhen recursively comparing field by field, but found the following difference(s):%n" + join(descriptionOfDifferences).with(format("%n")), actual, other); }
Source:
<code>protected void deactivateGLEntries(GeneralLedgerEntry entry, Document document, Integer capitalAssetLineNumber) { CapitalAssetInformation capitalAssetInformation = findCapitalAssetInformation(entry.getDocumentNumber(), capitalAssetLineNumber); if (ObjectUtils.isNotNull(capitalAssetInformation)) { List<CapitalAssetAccountsGroupDetails> groupAccountingLines = capitalAssetInformation.getCapitalAssetAccountsGroupDetails(); Collection<GeneralLedgerEntry> documentGlEntries = findAllGeneralLedgerEntry(entry.getDocumentNumber()); <START> if (LOG.isDebugEnabled()) { <END> LOG.debug("deactivateGLEntries, entry.getDocumentNumber(): " + entry.getDocumentNumber() + " documentGlEntries.size(): " + documentGlEntries.size()); } for (CapitalAssetAccountsGroupDetails accountingLine : groupAccountingLines) { Collection<GeneralLedgerEntry> glEntries = findMatchingGeneralLedgerEntries(documentGlEntries, accountingLine); if (LOG.isDebugEnabled()) { LOG.debug("deactivateGLEntries, accountingLine: " + accountingLine + " glEntries.size(): " + glEntries.size()); } for (GeneralLedgerEntry glEntry : glEntries) { KualiDecimal lineAmount = accountingLine.getAmount(); createGeneralLedgerEntryAsset(glEntry, document, capitalAssetLineNumber); updateTransactionSumbitGlEntryAmount(glEntry, lineAmount); } } } }</code><technical_language>I code cleaner more clear if remove debug logging</technical_language>

Target:
protected void deactivateGLEntries(GeneralLedgerEntry entry, Document document, Integer capitalAssetLineNumber) { CapitalAssetInformation capitalAssetInformation = findCapitalAssetInformation(entry.getDocumentNumber(), capitalAssetLineNumber); if (ObjectUtils.isNotNull(capitalAssetInformation)) { List<CapitalAssetAccountsGroupDetails> groupAccountingLines = capitalAssetInformation.getCapitalAssetAccountsGroupDetails(); Collection<GeneralLedgerEntry> documentGlEntries = findAllGeneralLedgerEntry(entry.getDocumentNumber()); for (CapitalAssetAccountsGroupDetails accountingLine : groupAccountingLines) { Collection<GeneralLedgerEntry> glEntries = findMatchingGeneralLedgerEntries(documentGlEntries, accountingLine); for (GeneralLedgerEntry glEntry : glEntries) { KualiDecimal lineAmount = accountingLine.getAmount(); createGeneralLedgerEntryAsset(glEntry, document, capitalAssetLineNumber); updateTransactionSumbitGlEntryAmount(glEntry, lineAmount); } } } }
Source:
<code>public Serializable execute(TaskResult... results) throws IOException { File file = new File(outputPath); containerURL = AzureStorageConnectorUtils.createContainerURL(accountName, accountKey, containerName); <START> if (blobName != null && !blobName.isEmpty()) { <END> if ((outputPath.lastIndexOf('/') == outputPath.length() - 1)) { createDirIfNotExists(file); String azureBlobLocalRelativePath = Paths.get(outputPath, Paths.get(blobName).getFileName().toString()) .toString(); downloadBlob(new File(azureBlobLocalRelativePath), blobName); } else { downloadBlob(file, blobName); } } else { createDirIfNotExists(file); downloadContainerBlobs(containerURL); } return (Serializable) Arrays.asList(outputPath); }</code><technical_language>blobName a Optional<String> replace by: if(blobName.isPresent())</technical_language>

Target:
public Serializable execute(TaskResult... results) throws IOException { File file = new File(outputPath); containerURL = AzureStorageConnectorUtils.createContainerURL(storageAccount, accountKey, containerName); if (optionalBlobName.isPresent()) { if (outputPath.lastIndexOf('/') == outputPath.length() - 1) { createDirIfNotExists(file); String azureBlobLocalRelativePath = Paths.get(outputPath, Paths.get(optionalBlobName.get()) .getFileName() .toString()) .toString(); downloadBlob(new File(azureBlobLocalRelativePath), optionalBlobName.get()); } else { downloadBlob(file, optionalBlobName.get()); } } else { createDirIfNotExists(file); downloadContainerBlobs(containerURL); } return (Serializable) Arrays.asList(outputPath); }
Source:
<code>public static List<Interval> breakIntervalsAtBandMultiples(final List<Interval> intervals, final int bandMultiple) { final List<Interval> brokenUpIntervals = new ArrayList<Interval>(); for (final Interval i : intervals) { final int startIndex = i.getStart() / bandMultiple; final int endIndex = i.getEnd() / bandMultiple; <START> if (startIndex == endIndex) { <END> brokenUpIntervals.add(i); } else { brokenUpIntervals.addAll(breakIntervalAtBandMultiples(i, bandMultiple)); } } return brokenUpIntervals; }</code><technical_language>Danger! End of interval start (empty intervals) account for that. (also below)</technical_language>

Target:
public static List<Interval> breakIntervalsAtBandMultiples(final List<Interval> intervals, final int bandMultiple) { final List<Interval> brokenUpIntervals = new ArrayList<Interval>(); for (final Interval interval : intervals) { if (interval.getEnd() >= interval.getStart()) { final int startIndex = interval.getStart() / bandMultiple; final int endIndex = interval.getEnd() / bandMultiple; if (startIndex == endIndex) { brokenUpIntervals.add(interval); } else { brokenUpIntervals.addAll(breakIntervalAtBandMultiples(interval, bandMultiple)); } } else { brokenUpIntervals.add(interval); } } return brokenUpIntervals; }
Source:
<code>public void build() { List<String> args = new ArrayList<String>(); if (this.configName != null) { args.add("--spring.config.name=" + this.configName); } if (this.input != null) { args.add("--spring.cloud.stream.bindings.input=" + this.input); } if (this.output != null) { <START> args.add("--spring.cloud.stream.binding.output=" + this.output); <END> } this.builder.run(args.toArray(new String[0])); }</code><technical_language>binding -> bindings</technical_language>

Target:
public void build() { List<String> args = new ArrayList<String>(); if (this.configName != null) { args.add("--spring.config.name=" + this.configName); } if (this.input != null) { args.add("--spring.cloud.stream.bindings.input=" + this.input); } if (this.output != null) { args.add("--spring.cloud.stream.bindings.output=" + this.output); } this.builder.run(args.toArray(new String[0])); }
Source:
<code>private void destroyLookedUpResource(final Context globalContext, final String id, final String name) throws NamingException { <START> final String ctx = name.substring(0, name.lastIndexOf("/")); <END> final String objName = name.substring(ctx.length() + 1); final NamingEnumeration<Binding> bindings = globalContext.listBindings(ctx); while (bindings.hasMoreElements()) { final Binding binding = bindings.nextElement(); if (!binding.getName().equals(objName)) { continue; } if (DestroyableResource.class.isInstance(binding.getObject())) { final DestroyableResource destroyableResource = DestroyableResource.class.cast(binding.getObject()); destroyableResource.destroyResource(); globalContext.unbind(name); return; } if (!LazyObjectReference.class.isInstance(binding.getObject())) { continue; } final LazyObjectReference<?> ref = LazyObjectReference.class.cast(binding.getObject()); if (!ref.isInitialized()) { globalContext.unbind(name); removeResourceInfo(id); return; } } final Object object = globalContext.lookup(name); final String clazz; if (object == null) { clazz = "?"; } else { clazz = object.getClass().getName(); } destroyResource(id, clazz, object); globalContext.unbind(name); }</code><technical_language>more safety here, lastIndexOf -1 etc. I before, worth it</technical_language>

Target:
private void destroyLookedUpResource(final Context globalContext, final String id, final String name) throws NamingException { final Object object; try { object = globalContext.lookup(name); } catch (final NamingException e) { final String ctx = name.substring(0, name.lastIndexOf("/")); final String objName = name.substring(ctx.length() + 1); final NamingEnumeration<Binding> bindings = globalContext.listBindings(ctx); while (bindings.hasMoreElements()) { final Binding binding = bindings.nextElement(); if (!binding.getName().equals(objName)) { continue; } if (!LazyObjectReference.class.isInstance(binding.getObject())) { continue; } final LazyObjectReference<?> ref = LazyObjectReference.class.cast(binding.getObject()); if (! ref.isInitialized()) { globalContext.unbind(name); removeResourceInfo(name); return; } } throw e; } final String clazz; if (object == null) { clazz = "?"; } else { clazz = object.getClass().getName(); } destroyResource(id, clazz, object); globalContext.unbind(name); }
Source:
<code>private boolean checkAppElementByBundleSymbolicNameAndClass(String bundleSymbolicName, String className) { Collection<BundleWiring> wirings = findWirings(bundleSymbolicName, bundleContext); <START> if (!isBundleClassAvailable(wirings, className)) { <END> return false; } return true; }</code><technical_language>Return of boolean literal statements wrapped if-then-else simplified. Noncompliant Code Example if (expression) { return true; } else { return false; } Compliant Solution return expression;</technical_language>

Target:
private boolean checkAppElementByBundleSymbolicNameAndClass(String bundleSymbolicName, String className) { Collection<BundleWiring> wirings = findWirings(bundleSymbolicName, bundleContext); return isBundleClassAvailable(wirings, className); }
Source:
<code>public boolean add(Flow flow, ManagedWildcardFlow wildFlow) { <START> org.midonet.odp.FlowMatch match = flow.getMatch(); <END> if (log.isDebugEnabled() && dpFlowTable.containsKey(match)) { log.debug("Tried to add a duplicate DP flow"); } wildFlow.dpFlows().add(match); dpFlowTable.put(match, wildFlow); log.debug("Added flow with match that matches wildcard flow {}", flow.getMatch(), wildFlow.getMatch()); if (wildFlow.getIdleExpirationMillis() > 0) { if (null == flow.getLastUsedTime()) wildFlow.setLastUsedTimeMillis(System.currentTimeMillis()); else if (flow.getLastUsedTime() > wildFlow.getLastUsedTimeMillis()) wildFlow.setLastUsedTimeMillis(flow.getLastUsedTime()); } return true; }</code><technical_language>fq names</technical_language>

Target:
public boolean add(Flow flow, ManagedWildcardFlow wildFlow) { FlowMatch match = flow.getMatch(); if (log.isDebugEnabled() && dpFlowTable.containsKey(match)) { log.debug("Tried to add a duplicate DP flow"); } wildFlow.dpFlows().add(match); dpFlowTable.put(match, wildFlow); log.debug("Added flow with match that matches wildcard flow {}", flow.getMatch(), wildFlow.getMatch()); if (wildFlow.getIdleExpirationMillis() > 0) { if (null == flow.getLastUsedTime()) wildFlow.setLastUsedTimeMillis(System.currentTimeMillis()); else if (flow.getLastUsedTime() > wildFlow.getLastUsedTimeMillis()) wildFlow.setLastUsedTimeMillis(flow.getLastUsedTime()); } return true; }
Source:
<code>public Optional<Handler> buildHandler(Class<?> sqlObjectType, Method method) { if (!WITH_HANDLE.equals(method)) { return Optional.empty(); } return Optional.of((t, a, h) -> h.invokeInContext( <START> new ExtensionMethod(sqlObjectType, method), <END> h.getConfig(), () -> ((HandleCallback<?, RuntimeException>) a[0]).withHandle(h.getHandle()))); }</code><technical_language>this simply works shifting getHandle() call ondemand scope, handle is closed ondemand methods return, proxy invocation handle is live, right</technical_language>

Target:
public Optional<Handler> buildHandler(Class<?> sqlObjectType, Method method) { if (!WITH_HANDLE.equals(method)) { return Optional.empty(); } ExtensionMethod extensionMethod = new ExtensionMethod(sqlObjectType, method); return Optional.of((t, a, h) -> h.invokeInContext( extensionMethod, h.getConfig(), () -> ((HandleCallback<?, RuntimeException>) a[0]).withHandle(h.getHandle()))); }
Source:
<code>public void testTransformNullMetacard() throws CatalogTransformerException { RtfQueryResponseAndMetacardTransformer transformer = createTransformer(); assertThat("Transformer cannot be null", transformer, notNullValue()); Metacard nullCard = null; <START> transformer.transform(nullCard, new HashMap<>()); <END> }</code><technical_language>Collections.emptyMap()</technical_language>

Target:
public void testTransformNullMetacard() throws CatalogTransformerException, MimeTypeParseException { RtfQueryResponseAndMetacardTransformer transformer = createTransformer(); Metacard nullCard = null; transformer.transform(nullCard, Collections.emptyMap()); }
Source:
<code>public void testDecodingSingleCookieV0() { String cookieString = "myCookie=myValue;expires=" + DateFormatter.format(new Date(System.currentTimeMillis() + 50000)) <START> + ";path=/apathsomewhere;domain=.adomainsomewhere;secure;SameSite=None"; <END> Cookie cookie = ClientCookieDecoder.STRICT.decode(cookieString); assertNotNull(cookie); assertEquals("myValue", cookie.value()); assertEquals(".adomainsomewhere", cookie.domain()); assertNotEquals("maxAge should be defined when parsing cookie " + cookieString, Long.MIN_VALUE, cookie.maxAge()); assertTrue("maxAge should be about 50ms when parsing cookie " + cookieString, cookie.maxAge() >= 40 && cookie.maxAge() <= 60); assertEquals("/apathsomewhere", cookie.path()); assertTrue(cookie.isSecure()); assertThat(cookie, is(instanceOf(DefaultCookie.class))); assertEquals("None", ((DefaultCookie) cookie).sameSite()); }</code><technical_language>above, I is a wire, in storage model</technical_language>

Target:
public void testDecodingSingleCookieV0() { String cookieString = "myCookie=myValue;expires=" + DateFormatter.format(new Date(System.currentTimeMillis() + 50000)) + ";path=/apathsomewhere;domain=.adomainsomewhere;secure;SameSite=None"; Cookie cookie = ClientCookieDecoder.STRICT.decode(cookieString); assertNotNull(cookie); assertEquals("myValue", cookie.value()); assertEquals(".adomainsomewhere", cookie.domain()); assertNotEquals("maxAge should be defined when parsing cookie " + cookieString, Long.MIN_VALUE, cookie.maxAge()); assertTrue("maxAge should be about 50ms when parsing cookie " + cookieString, cookie.maxAge() >= 40 && cookie.maxAge() <= 60); assertEquals("/apathsomewhere", cookie.path()); assertTrue(cookie.isSecure()); assertThat(cookie, is(instanceOf(DefaultCookie.class))); assertEquals(SameSite.None, ((DefaultCookie) cookie).sameSite()); }
Source:
<code>public int compare(final Account account1, final Account account2) { <START> if (account1.getPreferredEmail() != null && !account1.getPreferredEmail().isEmpty() <END> && account2.getPreferredEmail() != null && !account2.getPreferredEmail().isEmpty()) { return account1.getPreferredEmail().compareTo( account2.getPreferredEmail()); } if (account1.getFullName() != null && !account1.getFullName().isEmpty() && account2.getFullName() != null && !account2.getFullName().isEmpty()) { return account1.getFullName().compareTo(account2.getFullName()); } return Integer.valueOf(account1.getId().get()).compareTo( Integer.valueOf(account2.getId().get())); }</code><technical_language>I simplify null/empty checks for strings is do ! "".equals(...email). If pattern..</technical_language>

Target:
public int compare(final Account account1, final Account account2) { if (isSet(account1.getPreferredEmail()) && isSet(account2.getPreferredEmail())) { return account1.getPreferredEmail().compareTo( account2.getPreferredEmail()); } if (isSet(account1.getFullName()) && isSet(account2.getFullName())) { return account1.getFullName().compareTo(account2.getFullName()); } return Integer.valueOf(account1.getId().get()).compareTo( Integer.valueOf(account2.getId().get())); }
Source:
<code>public boolean hasIndicatedSections(String courseId) throws EntityDoesNotExistException{ List<StudentAttributes> studentList = getStudentsForCourse(courseId); for(StudentAttributes student : studentList) { <START> if(!student.section.equals("None")){ <END> return true; } } return false; }</code><technical_language>"None" is a magic string. Define somewhere</technical_language>

Target:
public boolean hasIndicatedSections(String courseId) throws EntityDoesNotExistException{ coursesLogic.verifyCourseIsPresent(courseId); List<StudentAttributes> studentList = getStudentsForCourse(courseId); for(StudentAttributes student : studentList) { if(!student.section.equals(Const.DEFAULT_SECTION)){ return true; } } return false; }
Source:
<code><START> protected String getConfigurationFileName() { <END> return "configWithSessionVariables.ini"; }</code><technical_language>this private - this class</technical_language>

Target:
private String getConfigurationFileName() { return "configWithSessionVariables.ini"; }
Source:
<code>public int removeTaskFromDbByTaskId(final Guid taskId) throws RuntimeException { return TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Integer>() { @Override public Integer runInTransaction() { AsyncTasks asyncTask = DbFacade.getInstance().getAsyncTaskDao().get(taskId); int retVal = DbFacade.getInstance().getAsyncTaskDao().remove(taskId); if (asyncTask != null && !Guid.isNullOrEmpty(asyncTask.getCommandId())) { CommandEntity cmdEntity = coco.getCommandEntity(asyncTask.getCommandId()); if (cmdEntity != null && !cmdEntity.isCallBackEnabled()) { coco.removeCommand(asyncTask.getCommandId()); <START> if (!Guid.isNullOrEmpty(asyncTask.getRootCommandId()) && <END> !coco.hasCommandEntitiesWithRootCommandId(asyncTask.getRootCommandId())) { coco.removeCommand(asyncTask.getRootCommandId()); } } } return retVal; } }); }</code><technical_language>ok, i confused, u do getRootCommandId? is check in line 177 correct</technical_language>

Target:
public int removeTaskFromDbByTaskId(final Guid taskId) throws RuntimeException { return TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Integer>() { @Override public Integer runInTransaction() { AsyncTask asyncTask = DbFacade.getInstance().getAsyncTaskDao().get(taskId); int retVal = DbFacade.getInstance().getAsyncTaskDao().remove(taskId); if (asyncTask != null && !Guid.isNullOrEmpty(asyncTask.getCommandId())) { CommandEntity cmdEntity = coco.getCommandEntity(asyncTask.getCommandId()); if (cmdEntity != null && !cmdEntity.isCallBackEnabled()) { coco.removeCommand(asyncTask.getCommandId()); if (!Guid.isNullOrEmpty(asyncTask.getRootCommandId()) && !coco.hasCommandEntitiesWithRootCommandId(asyncTask.getRootCommandId())) { coco.removeCommand(asyncTask.getRootCommandId()); } } } return retVal; } }); }
Source:
<code>private String pushImages() throws IOException { final StringBuilder resultBuilder = new StringBuilder(); for (String tagToUse : tagsToUse) { if (!tagToUse.toLowerCase().equals(tagToUse)) { listener.getLogger().println("ERROR: Docker will refuse to push tag name " + tagToUse + " because it uses upper case."); } Identifier identifier = Identifier.fromCompoundString(tagToUse); PushImageResultCallback resultCallback = new PushImageResultCallback() { public void onNext(PushResponseItem item) { <START> resultBuilder.append(item.toString()); <END> super.onNext(item); } }; getClient().pushImageCmd(identifier).exec(resultCallback).awaitSuccess(); } return resultBuilder.toString(); }</code><technical_language>same, print listener</technical_language>

Target:
private void pushImages() throws IOException { for (String tagToUse : tagsToUse) { if (!tagToUse.toLowerCase().equals(tagToUse)) { listener.getLogger().println("ERROR: Docker will refuse to push tag name " + tagToUse + " because it uses upper case."); } Identifier identifier = Identifier.fromCompoundString(tagToUse); PushImageResultCallback resultCallback = new PushImageResultCallback() { public void onNext(PushResponseItem item) { listener.getLogger().println(item.toString()); super.onNext(item); } }; getClient().pushImageCmd(identifier).exec(resultCallback).awaitSuccess(); } }
Source:
<code>private static Map<TableReference, SweepStrategy> getSweepStrategiesForWarmingCache( KeyValueService kvs, CacheWarming cacheWarming) { switch (cacheWarming) { case FULL: return Maps.transformValues(kvs.getMetadataForTables(), SweepStrategyManagers::getSweepStrategy); <START> case LIMITED: return Maps.transformValues( kvs.getLimitedMetadataForTables(50), SweepStrategyManagers::getSweepStrategy); <END> case NONE: default: return Collections.emptyMap(); } }</code><technical_language>is in a separate LIMITED mode FULL NONE? If set cache warm based requests, behavior see? pick 50? 50 tables want cached</technical_language>

Target:
private static Map<TableReference, SweepStrategy> getSweepStrategiesForWarmingCache( KeyValueService kvs, CacheWarming cacheWarming) { switch (cacheWarming) { case FULL: return Maps.transformValues(kvs.getMetadataForTables(), SweepStrategyManagers::getSweepStrategy); case NONE: default: return Collections.emptyMap(); } }
Source:
<code>public void checkVolumesTab() { String volumeName = "project"; <START> String newVolumeName = "projects"; <END> String volumePath = "/project"; String newVolumePath = "/projects"; workspaceDetails.selectTabInWorkspaceMenu(VOLUMES); workspacesVolumes.clickOnAddVolumeButton(); workspacesVolumes.enterVolumeName(volumeName); workspacesVolumes.enterVolumePath(volumePath); workspaceDetails.clickOnAddButtonInDialogWindow(); workspacesVolumes.checkVolumeExists(volumeName, volumePath); clickOnSaveButton(); workspacesVolumes.clickOnEditVolumeButton(volumeName); workspacesVolumes.enterVolumeName(newVolumeName); workspacesVolumes.enterVolumePath(newVolumePath); workspaceDetails.clickOnUpdateButtonInDialogWindow(); workspacesVolumes.checkVolumeExists(newVolumeName, newVolumePath); clickOnSaveButton(); workspacesVolumes.clickOnRemoveVolumeButton(newVolumeName); workspaceDetails.clickOnDeleteButtonInDialogWindow(); workspacesVolumes.waitVolumeNotExists(newVolumeName); clickOnSaveButton(); }</code><technical_language>New name differ significantly, avoid confusion</technical_language>

Target:
public void checkVolumesTab() { String volumeName = "prj"; String volumePath = "/" + volumeName; String renamedVolumeName = "project"; String renamedVolumePath = "/" + renamedVolumeName; workspaceDetails.selectTabInWorkspaceMenu(VOLUMES); workspacesVolumes.clickOnAddVolumeButton(); workspacesVolumes.enterVolumeName(volumeName); workspacesVolumes.enterVolumePath(volumePath); workspaceDetails.clickOnAddButtonInDialogWindow(); assertTrue(workspacesVolumes.checkVolumeExists(volumeName, volumePath)); clickOnSaveButton(); workspacesVolumes.clickOnEditVolumeButton(volumeName); workspacesVolumes.enterVolumeName(renamedVolumeName); workspacesVolumes.enterVolumePath(renamedVolumePath); workspaceDetails.clickOnUpdateButtonInDialogWindow(); assertTrue(workspacesVolumes.checkVolumeExists(renamedVolumeName, renamedVolumePath)); clickOnSaveButton(); workspacesVolumes.clickOnRemoveVolumeButton(renamedVolumeName); workspaceDetails.clickOnDeleteButtonInDialogWindow(); workspacesVolumes.waitVolumeNotExists(renamedVolumeName); clickOnSaveButton(); }
Source:
<code>public static void copy(String message, File source, File target) { if (!source.exists()) return; target.getParentFile().mkdirs(); if (source.isDirectory()) { if (target.exists() && target.isFile()) target.delete(); if (!target.exists()) target.mkdirs(); File[] children = source.listFiles(); for (File <START> children1 : <END> children) { copy(message, children1, new File(target, children1.getName())); } return; } try (InputStream input = new BufferedInputStream(new FileInputStream(source)); OutputStream output = new BufferedOutputStream(new FileOutputStream(target))) { byte[] buffer = new byte[8192]; int bytesRead = 0; while ((bytesRead = input.read(buffer)) != -1) output.write(buffer, 0, bytesRead); } catch (IOException e) { fail(message + ": " + e); } }</code><technical_language>child</technical_language>

Target:
public static void copy(String message, File source, File target) { if (!source.exists()) return; target.getParentFile().mkdirs(); if (source.isDirectory()) { if (target.exists() && target.isFile()) target.delete(); if (!target.exists()) target.mkdirs(); File[] children = source.listFiles(); for (File child : children) { copy(message, child, new File(target, child.getName())); } return; } try (InputStream input = new BufferedInputStream(new FileInputStream(source)); OutputStream output = new BufferedOutputStream(new FileOutputStream(target))) { byte[] buffer = new byte[8192]; int bytesRead = 0; while ((bytesRead = input.read(buffer)) != -1) output.write(buffer, 0, bytesRead); } catch (IOException e) { fail(message + ": " + e); } }
Source:
<code>public String format(String json) { String result = null; if (json != null){ Gson gson = new GsonBuilder().setPrettyPrinting().create(); JsonParser jsonParser = new JsonParser(); if (json.startsWith("{")) { <START> return gson.toJson(jsonParser.parse(json).getAsJsonObject()); <END> } else if (json.startsWith("[")) { result = gson.toJson(jsonParser.parse(json).getAsJsonArray()); } } return result; }</code><technical_language>Please return if branch reduce code duplication branches</technical_language>

Target:
public String format(String json) { String result = null; if (json != null){ Gson gson = new GsonBuilder().setPrettyPrinting().create(); JsonParser jsonParser = new JsonParser(); if (json.startsWith("{")) { result = gson.toJson(jsonParser.parse(json).getAsJsonObject()); } else if (json.startsWith("[")) { result = gson.toJson(jsonParser.parse(json).getAsJsonArray()); } } return result; }
Source:
<code>public int writeTruncatedObject(ByteBuffer output) throws IOException { <START> output.position(PBDSegment.ENTRY_HEADER_BYTES); <END> int bytesWritten = PBDUtils.writeDeferredSerialization(output, m_ds); m_crc32.update(bytesWritten); m_crc32.update(PBDSegment.NO_FLAGS); output.position(PBDSegment.ENTRY_HEADER_BYTES); m_crc32.update(output); output.putLong(PBDSegment.ENTRY_HEADER_CRC_OFFSET, m_crc32.getValue()); output.putInt(PBDSegment.ENTRY_HEADER_TOTAL_BYTES_OFFSET, bytesWritten); output.putInt(PBDSegment.ENTRY_HEADER_FLAG_OFFSET, PBDSegment.NO_FLAGS); if (m_truncationCallback != null) { m_truncationCallback.bytesWritten(bytesWritten); } return bytesWritten; }</code><technical_language>Is guaranteed buffer passed in written starting position 0 this line header writes require it</technical_language>

Target:
public int writeTruncatedObject(ByteBuffer output) throws IOException { output.position(PBDSegment.ENTRY_HEADER_BYTES); int bytesWritten = MiscUtils.writeDeferredSerialization(output, m_ds); output.position(PBDSegment.ENTRY_HEADER_BYTES); ByteBuffer header = output.duplicate(); header.position(PBDSegment.ENTRY_HEADER_CRC_OFFSET); PBDUtils.writeEntryHeader(m_crc32, header, output, bytesWritten, PBDSegment.NO_FLAGS); if (m_truncationCallback != null) { m_truncationCallback.bytesWritten(bytesWritten); } return bytesWritten; }
Source:
<code>public void initialize(Context context) { context.registerSyntaxNodeConsumer(PyElementTypes.REPR_EXPRESSION, ctx -> { PyReprExpression node = (PyReprExpression) ctx.syntaxNode(); <START> ctx.addIssue(node.getNode().getPsi(), "Use \"repr\" instead."); <END> }); }</code><technical_language>ctx.addIssue(ctx.syntaxNode(), "Use \"repr\" instead.")</technical_language>

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(PyElementTypes.REPR_EXPRESSION, ctx -> ctx.addIssue(ctx.syntaxNode(), "Use \"repr\" instead.")); }
Source:
<code>private void fillContextMenu(IMenuManager manager) { manager.add(openAction); IPluginModelBase selectedPluginModel = getSelectedPluginModel(); if (selectedPluginModel != null) { Action dependenciesAction = new OpenPluginDependenciesAction(selectedPluginModel); manager.add(dependenciesAction); <START> dependenciesAction.setText(PDEUIMessages.PluginsView_openDependencies); <END> dependenciesAction.setImageDescriptor(PDEPluginImages.DESC_CALLEES); } manager.add(new Separator()); manager.add(copyAction); }</code><technical_language>please move setText icon OpenPluginDependenciesAction remove PluginsView</technical_language>

Target:
private void fillContextMenu(IMenuManager manager) { manager.add(fOpenAction); IPluginModelBase selectedPluginModel = getSelectedPluginModel(); if (selectedPluginModel != null) { Action dependenciesAction = new OpenPluginDependenciesAction(selectedPluginModel); manager.add(dependenciesAction); } manager.add(new Separator()); manager.add(fCopyAction); }
Source:
<code>private static TmfCommonXAxisModel extractModelFromChart(Chart chart) { ILineSeries readSeries = (ILineSeries) chart.getSeriesSet().getSeries(READ_SERIES_NAME); ILineSeries writeSeries = (ILineSeries) chart.getSeriesSet().getSeries(WRITE_SERIES_NAME); assertNotNull(readSeries); assertNotNull(writeSeries); double[] xRead = readSeries.getXSeries(); double[] yRead = readSeries.getYSeries(); double[] xWrite = writeSeries.getXSeries(); double[] yWrite = writeSeries.getYSeries(); <START> assertTrue(Arrays.equals(xRead, <END> xWrite)); @NonNull Map<@NonNull String, @NonNull IYModel> yModels = new LinkedHashMap<>(); yModels.put(READ_SERIES_NAME, new YModel(READ_SERIES_NAME, yRead)); yModels.put(WRITE_SERIES_NAME, new YModel(WRITE_SERIES_NAME, yWrite)); long[] x = Longs.toArray(Doubles.asList(xRead)); assertNotNull(x); return new TmfCommonXAxisModel(TITLE, x, yModels); }</code><technical_language>add a message like: series x axis values smth</technical_language>

Target:
private static TmfCommonXAxisModel extractModelFromChart(Chart chart) { ILineSeries readSeries = (ILineSeries) chart.getSeriesSet().getSeries(READ_SERIES_NAME); ILineSeries writeSeries = (ILineSeries) chart.getSeriesSet().getSeries(WRITE_SERIES_NAME); assertNotNull(readSeries); assertNotNull(writeSeries); double[] xRead = readSeries.getXSeries(); double[] yRead = readSeries.getYSeries(); double[] xWrite = writeSeries.getXSeries(); double[] yWrite = writeSeries.getYSeries(); assertTrue("Series should have the same x axis values", Arrays.equals(xRead, xWrite)); @NonNull Map<@NonNull String, @NonNull IYModel> yModels = new LinkedHashMap<>(); yModels.put(READ_SERIES_NAME, new YModel(READ_SERIES_NAME, Objects.requireNonNull(yRead))); yModels.put(WRITE_SERIES_NAME, new YModel(WRITE_SERIES_NAME, Objects.requireNonNull(yWrite))); long[] x = Longs.toArray(Doubles.asList(xRead)); assertNotNull(x); return new TmfCommonXAxisModel(TITLE, x, yModels); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.switch_logs: mSyncthingLog = !mSyncthingLog; if (mSyncthingLog) { item.setTitle(R.string.log_android_title); } else { <START> item.setTitle(R.string.log_syncthing_title); <END> } updateLog(); return true; default: return super.onOptionsItemSelected(item); } }</code><technical_language>works a ternary operator: setTitle((cond) ? title1 : title2)</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.switch_logs: mSyncthingLog = !mSyncthingLog; item.setTitle(mSyncthingLog ? R.string.log_android_title : R.string.log_syncthing_title); updateLog(); return true; default: return super.onOptionsItemSelected(item); } }
Source:
<code>default Component getHelperComponent() { Optional<Element> element = getElement().getChildren() .filter(child -> "helper".equals(child.getAttribute("slot"))) .findFirst(); <START> if (element.isPresent()) { <END> return element.get().getComponent().orElse(null); } return null; }</code><technical_language>I this is necessary for readability adds more lines, mapping Stream map(Element::get) findFirst() return component.orElse(null);</technical_language>

Target:
default Component getHelperComponent() { Optional<Component> component = getElement().getChildren() .filter(child -> "helper".equals(child.getAttribute("slot"))) .map(Element::getComponent) .findFirst().orElse(Optional.empty()); return component.orElse(null); }
Source:
<code>public boolean validate() throws IOException, ServletException { String urlParameters = "?api_key=" + apiKey; HttpURLConnection conn = null; boolean status = true; try { conn = getHttpURLConnection(new URL(url + VALIDATE + urlParameters)); conn.setRequestMethod("GET"); BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8")); StringBuilder result = new StringBuilder(); String line; while ((line = rd.readLine()) != null) { result.append(line); } rd.close(); JSONObject json = (JSONObject) JSONSerializer.toJSON(result.toString()); if (!json.getBoolean("valid")) { status = false; } } catch (Exception e) { if (conn != null && conn.getResponseCode() == HTTP_FORBIDDEN) { <START> logger.severe("Hmmm, your API key may be invalid. We received a 403 error."); <END> StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); logger.severe(sw.toString()); } else { StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); logger.severe(String.format("Client error: %s", sw.toString())); } status = false; } finally { if (conn != null) { conn.disconnect(); } } return status; }</code><technical_language>For consistency, move this human readable line stackTrace one? (In a couple other places too)</technical_language>

Target:
public boolean validate() throws IOException, ServletException { String urlParameters = "?api_key=" + apiKey; HttpURLConnection conn = null; boolean status = true; try { conn = getHttpURLConnection(new URL(url + VALIDATE + urlParameters)); conn.setRequestMethod("GET"); BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8")); StringBuilder result = new StringBuilder(); String line; while ((line = rd.readLine()) != null) { result.append(line); } rd.close(); JSONObject json = (JSONObject) JSONSerializer.toJSON(result.toString()); if (!json.getBoolean("valid")) { status = false; } } catch (Exception e) { if (conn != null && conn.getResponseCode() == HTTP_FORBIDDEN) { logger.severe("Hmmm, your API key may be invalid. We received a 403 error."); DatadogUtilities.severe(logger, e, null); } else { DatadogUtilities.severe(logger, e, "Client error: "); } status = false; } finally { if (conn != null) { conn.disconnect(); } } return status; }
Source:
<code>private BlobStoreCompactor getCompactor(Log log, DiskIOScheduler ioScheduler) throws IOException, StoreException { closeOrExceptionInduced = false; if (doDirectIO) { state.properties.put("store.compaction.enable.direct.io", "true"); } if (withUndelete) { state.properties.put("store.compaction.filter", "IndexSegmentValidEntryWithUndelete"); } <START> if (alwaysEnableTargetIndexDuplicateChecking) { state.properties.put(StoreConfig.storeAlwaysEnableTargetIndexDuplicateCheckingName, "true"); } else { state.properties.put(StoreConfig.storeAlwaysEnableTargetIndexDuplicateCheckingName, "false"); } <END> StoreConfig config = new StoreConfig(new VerifiableProperties(state.properties)); metricRegistry = new MetricRegistry(); StoreMetrics metrics = new StoreMetrics(metricRegistry); return new BlobStoreCompactor(tempDirStr, STORE_ID, STORE_KEY_FACTORY, config, metrics, metrics, ioScheduler, StoreTestUtils.DEFAULT_DISK_SPACE_ALLOCATOR, log, state.time, state.sessionId, state.incarnationId, accountService); }</code><technical_language>simplify this if-else follows? state.properties.put(StoreConfig.storeAlwaysEnableTargetIndexDuplicateCheckingName, Boolean.toString(alwaysEnableTargetIndexDuplicateChecking));</technical_language>

Target:
private BlobStoreCompactor getCompactor(Log log, DiskIOScheduler ioScheduler) throws IOException, StoreException { closeOrExceptionInduced = false; if (doDirectIO) { state.properties.put("store.compaction.enable.direct.io", "true"); } if (withUndelete) { state.properties.put("store.compaction.filter", "IndexSegmentValidEntryWithUndelete"); } state.properties.put(StoreConfig.storeAlwaysEnableTargetIndexDuplicateCheckingName, Boolean.toString(alwaysEnableTargetIndexDuplicateChecking)); StoreConfig config = new StoreConfig(new VerifiableProperties(state.properties)); metricRegistry = new MetricRegistry(); StoreMetrics metrics = new StoreMetrics(metricRegistry); return new BlobStoreCompactor(tempDirStr, STORE_ID, STORE_KEY_FACTORY, config, metrics, metrics, ioScheduler, StoreTestUtils.DEFAULT_DISK_SPACE_ALLOCATOR, log, state.time, state.sessionId, state.incarnationId, accountService); }
Source:
<code><START> public void postAction() <END></code><technical_language>This need public protected</technical_language>

Target:
protected void postAction()
Source:
<code>public void onModelFound(Request request) { <START> if (!request.getState().equals(Request.State.PENDING)) finish(); <END> else { onPendingRequest(request); } }</code><technical_language>Request.State.OPEN</technical_language>

Target:
public void onModelFound(Request request) { if (!request.getState().equals(Request.State.OPEN)) finish(); else { onOpenRequest(request); } }
Source:
<code>public void put(K k, V v, Metadata metadata) { boolean l1Entry = false; if (metadata instanceof L1WriteSynchronizer.L1Metadata) { metadata = ((L1WriteSynchronizer.L1Metadata) metadata).metadata(); l1Entry = true; } InternalCacheEntry<K, V> e = entries.get(k); if (trace) { log.tracef("Creating new ICE for writing. Existing=%s, metadata=%s, new value=%s", e, metadata, v); } if (e != null) { e = entryFactory.update(e, v, metadata); } else { e = entryFactory.create(k, v, metadata); } if (trace) log.tracef("Store %s in container", e); <START> e.setL1Entry(l1Entry); <END> extendedMap.putAndActivate(e); }</code><technical_language>Do need flag entries? implement isL1Entry() metadata instanceof L1Metadata</technical_language>

Target:
public void put(K k, V v, Metadata metadata) { boolean l1Entry = false; if (metadata instanceof L1Metadata) { metadata = ((L1Metadata) metadata).metadata(); l1Entry = true; } InternalCacheEntry<K, V> e = entries.get(k); if (trace) { log.tracef("Creating new ICE for writing. Existing=%s, metadata=%s, new value=%s", e, metadata, v); } if (l1Entry) { e = entryFactory.createL1(k, v, metadata); } else if (e != null) { e = entryFactory.update(e, v, metadata); } else { e = entryFactory.create(k, v, metadata); } if (trace) log.tracef("Store %s in container", e); extendedMap.putAndActivate(e); }