auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void destroy() { <START> executorService.shutdown(); <END> }</code><technical_language>shutdownNow</technical_language>

Target:
public void destroy() { executorService.shutdownNow(); }
Source:
<code>public DiningSessionListAdapter(Context ctx, List<DiningSession> sessions) { <START> super(ctx, R.layout.listitem_restaurant_request_bot, sessions); <END> mContext = ctx; }</code><technical_language>bottom top</technical_language>

Target:
public DiningSessionListAdapter(Context ctx, List<DiningSession> sessions) { super(ctx, R.layout.listitem_restaurant_request_top, sessions); mContext = ctx; }
Source:
<code>public void testList() throws StripeException { <START> final OrderCollection orders = Order.list(null); <END> assertNotNull(orders); assertEquals(1, orders.getData().size()); verifyRequest( APIResource.RequestMethod.GET, "/v1/orders" ); }</code><technical_language>called resources</technical_language>

Target:
public void testList() throws StripeException { final Map<String, Object> params = new HashMap<String, Object>(); params.put("limit", 1); final OrderCollection orders = Order.list(params); assertNotNull(orders); verifyRequest( APIResource.RequestMethod.GET, "/v1/orders", params ); }
Source:
<code>private boolean canUpdateCompatibilityVersionOrCpu() { allForCluster = vdsDao.getAllForCluster(oldCluster.getId()); List<VDS> upVdss = allForCluster.stream() .filter(v -> v.getStatus() == VDSStatus.Up) .collect(Collectors.toList()); boolean valid = true; <START> String lowerVersionHosts = ""; <END> String lowCpuHosts = ""; String incompatibleEmulatedMachineHosts = ""; for (VDS vds : upVdss) { if (!VersionSupport.checkClusterVersionSupported( getCluster().getCompatibilityVersion(), vds)) { valid = false; lowerVersionHosts = lowerVersionHosts.concat(vds.getName() + ", "); } if (getCluster().supportsVirtService() && missingServerCpuFlags(vds) != null) { valid = false; lowCpuHosts = lowCpuHosts.concat(vds.getName() + ", "); } if (!isSupportedEmulatedMachinesMatchClusterLevel(vds)) { valid = false; incompatibleEmulatedMachineHosts = incompatibleEmulatedMachineHosts.concat(vds.getName() + ", "); } } if (!lowerVersionHosts.isEmpty()) { addValidationVarAndMessage("host", lowerVersionHosts.replaceAll(", $", ""), EngineMessage.CLUSTER_CANNOT_UPDATE_COMPATIBILITY_VERSION_WITH_LOWER_HOSTS); } if (!lowCpuHosts.isEmpty()) { addValidationVarAndMessage("host", lowCpuHosts.replaceAll(", $", ""), EngineMessage.CLUSTER_CANNOT_UPDATE_CPU_WITH_LOWER_HOSTS); } if (!incompatibleEmulatedMachineHosts.isEmpty()) { addValidationVarAndMessage("host", incompatibleEmulatedMachineHosts.replaceAll(", $", ""), EngineMessage.CLUSTER_CANNOT_UPDATE_COMPATIBILITY_VERSION_WITH_INCOMPATIBLE_EMULATED_MACHINE); } return valid; }</code><technical_language>talking Martin, is List instead of String. String concatenation get expensive. need String convert list String String.join</technical_language>

Target:
private boolean canUpdateCompatibilityVersionOrCpu() { allForCluster = vdsDao.getAllForCluster(oldCluster.getId()); List<VDS> upVdss = allForCluster.stream() .filter(v -> v.getStatus() == VDSStatus.Up) .collect(Collectors.toList()); boolean valid = true; List<String> lowerVersionHosts = new ArrayList<>(); List<String> lowCpuHosts = new ArrayList<>(); List<String> incompatibleEmulatedMachineHosts = new ArrayList<>(); for (VDS vds : upVdss) { if (!VersionSupport.checkClusterVersionSupported( getCluster().getCompatibilityVersion(), vds)) { valid = false; lowerVersionHosts.add(vds.getName()); } if (getCluster().supportsVirtService() && missingServerCpuFlags(vds) != null) { valid = false; lowCpuHosts.add(vds.getName()); } if (!isSupportedEmulatedMachinesMatchClusterLevel(vds)) { valid = false; incompatibleEmulatedMachineHosts.add(vds.getName()); } } if (!lowerVersionHosts.isEmpty()) { addValidationVarAndMessage("host", String.join(", ", lowerVersionHosts), EngineMessage.CLUSTER_CANNOT_UPDATE_COMPATIBILITY_VERSION_WITH_LOWER_HOSTS); } if (!lowCpuHosts.isEmpty()) { addValidationVarAndMessage("host", String.join(", ", lowCpuHosts), EngineMessage.CLUSTER_CANNOT_UPDATE_CPU_WITH_LOWER_HOSTS); } if (!incompatibleEmulatedMachineHosts.isEmpty()) { addValidationVarAndMessage("host", String.join(", ", incompatibleEmulatedMachineHosts), EngineMessage.CLUSTER_CANNOT_UPDATE_COMPATIBILITY_VERSION_WITH_INCOMPATIBLE_EMULATED_MACHINE); } return valid; }
Source:
<code>private void verifyPreemption(int numStarvedAppContainers) throws InterruptedException { for (int i = 0; i < 1000; i++) { if (greedyApp.getLiveContainers().size() == 2 * numStarvedAppContainers) { break; } Thread.sleep(10); } assertEquals("Incorrect # of containers on the greedy app", 2 * numStarvedAppContainers, greedyApp.getLiveContainers().size()); assertEquals("Incorrect # of preempted containers in QueueMetrics", 8 - 2 * numStarvedAppContainers, greedyApp.getQueue().getMetrics().getAggregatePreemptedContainers()); for (RMNode rmNode : rmNodes) { FSSchedulerNode node = (FSSchedulerNode) scheduler.getNodeTracker().getNode(rmNode.getNodeID()); if (node.getContainersForPreemption().size() > 0) { assertTrue(node.getPreemptionList().keySet().contains(starvingApp)); } } sendEnoughNodeUpdatesToAssignFully(); assertEquals("Starved app is not assigned the right # of containers", numStarvedAppContainers, starvingApp.getLiveContainers().size()); for (RMNode rmNode : rmNodes) { FSSchedulerNode node = (FSSchedulerNode) scheduler.getNodeTracker().getNode(rmNode.getNodeID()); if (node.getContainersForPreemption().size() > 0) { <START> assertTrue(!node.getPreemptionList().keySet().contains(starvingApp)); <END> } } }</code><technical_language>assertFalse</technical_language>

Target:
private void verifyPreemption(int numStarvedAppContainers) throws InterruptedException { for (int i = 0; i < 1000; i++) { if (greedyApp.getLiveContainers().size() == 2 * numStarvedAppContainers) { break; } Thread.sleep(10); } assertEquals("Incorrect # of containers on the greedy app", 2 * numStarvedAppContainers, greedyApp.getLiveContainers().size()); assertEquals("Incorrect # of preempted containers in QueueMetrics", 8 - 2 * numStarvedAppContainers, greedyApp.getQueue().getMetrics().getAggregatePreemptedContainers()); for (RMNode rmNode : rmNodes) { FSSchedulerNode node = (FSSchedulerNode) scheduler.getNodeTracker().getNode(rmNode.getNodeID()); if (node.getContainersForPreemption().size() > 0) { assertTrue("node should be reserved for the starvingApp", node.getPreemptionList().keySet().contains(starvingApp)); } } sendEnoughNodeUpdatesToAssignFully(); assertEquals("Starved app is not assigned the right # of containers", numStarvedAppContainers, starvingApp.getLiveContainers().size()); for (RMNode rmNode : rmNodes) { FSSchedulerNode node = (FSSchedulerNode) scheduler.getNodeTracker().getNode(rmNode.getNodeID()); if (node.getContainersForPreemption().size() > 0) { assertFalse(node.getPreemptionList().keySet().contains(starvingApp)); } } }
Source:
<code>public byte[] getKey() throws Exception { <START> final String o = String.valueOf(properties.get(propertyName)); <END> return EncodingUtils.BASE64_DECODER.apply(o.getBytes(EncodingUtils.ENCODING)); }</code><technical_language>if propertyName is contained in properties here</technical_language>

Target:
public byte[] getKey() throws Exception { final Object propertyObject = properties.get(propertyName); if (propertyObject == null) { throw new IllegalArgumentException("Property '" + propertyName + "' does not exist."); } final String o = String.valueOf(propertyObject); return EncodingUtils.BASE64_DECODER.apply(o.getBytes(EncodingUtils.ENCODING)); }
Source:
<code>private boolean shouldBulkRead(int[] docIds, int startIndex, int endIndex) { int numDocsToRead = endIndex - startIndex + 1; int docIdRange = docIds[endIndex] - docIds[startIndex] + 1; <START> if (docIdRange > DocIdSetPlanNode.MAX_DOC_PER_CALL) { <END> return false; } return numDocsToRead >= ((double)docIdRange * 0.7); }</code><technical_language>is this check needed</technical_language>

Target:
private boolean shouldBulkRead(int[] docIds, int startIndex, int endIndex) { int numDocsToRead = endIndex - startIndex + 1; int docIdRange = docIds[endIndex] - docIds[startIndex] + 1; return numDocsToRead >= ((double)docIdRange * 0.5); }
Source:
<code>private Map<String, List<KafkaMetric>> groupMetrics(Collection<KafkaMetric> metrics) { Map<String, List<KafkaMetric>> result = new HashMap<>(); for (KafkaMetric metric : metrics) { String name = getMBeanName(prefix, metric.metricName()); List<KafkaMetric> list = result.get(name); <START> if (list == null) { <END> list = new ArrayList<>(); result.put(name, list); } list.add(metric); } return result; }</code><technical_language>this replaced Map.computeIfAbsent</technical_language>

Target:
private Map<String, List<KafkaMetric>> groupMetrics(Collection<KafkaMetric> metrics) { Map<String, List<KafkaMetric>> result = new HashMap<>(); for (KafkaMetric metric : metrics) { String name = getMBeanName(prefix, metric.metricName()); result.computeIfAbsent(name, __ -> new ArrayList<>()).add(metric); } return result; }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SelectorPredicateFactory that = (SelectorPredicateFactory) o; <START> return Objects.equals(initLock, that.initLock); <END> }</code><technical_language>This compare instead</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SelectorPredicateFactory that = (SelectorPredicateFactory) o; return Objects.equals(value, that.value); }
Source:
<code>private void visit(StateGraphNode node) { visited.add(node); if (node instanceof State) { State st = (State) node; if (RoomHelpers.hasDirectSubStructure(st)) { addStartingPoints(st.getSubgraph(), true); } else { for (ActiveTrigger trigger : xpAct.getActiveTriggers(st)) { for (TriggeredTransition trans : trigger.getTransitions()) visit(trans); } <START> for(Transition trans : xpAct.getOutgoingTransitions(node)){ <END> if(trans instanceof GuardedTransition) visit(trans); } } } else { if (node instanceof EntryPoint) { boolean markVisited = true; State container = (State) node.eContainer().eContainer(); StateGraph parentGraph = container.getSubgraph(); for (Transition tr : parentGraph.getTransitions()) if (tr instanceof InitialTransition) markVisited = false; if (markVisited) visited.add(container); } for (Transition trans : xpAct.getOutgoingTransitions(node)) visit(trans); } }</code><technical_language>This code considers transitions level. check upper levels in hierarchy (cf. RoomExtensions.getOutgoingTransitionsHierarchical())</technical_language>

Target:
private void visit(StateGraphNode node) { visited.add(node); if (node instanceof State) { State st = (State) node; if (RoomHelpers.hasDirectSubStructure(st)) { addStartingPoints(st.getSubgraph(), true); } else { for (ActiveTrigger trigger : xpAct.getActiveTriggers(st)) { for (TriggeredTransition trans : trigger.getTransitions()) visit(trans); } for(Transition trans : roomExt.getOutgoingTransitionsHierarchical(xpAct, st)){ if(trans instanceof GuardedTransition) visit(trans); } } } else { if (node instanceof EntryPoint) { boolean markVisited = true; State container = (State) node.eContainer().eContainer(); StateGraph parentGraph = container.getSubgraph(); for (Transition tr : parentGraph.getTransitions()) if (tr instanceof InitialTransition) markVisited = false; if (markVisited) visited.add(container); } for (Transition trans : xpAct.getOutgoingTransitions(node)) visit(trans); } }
Source:
<code>protected void executeCommand() { final List<LUNs> lunsFromVgInfo = (List<LUNs>) runVdsCommand(VDSCommandType.GetVGInfo, new GetVGInfoVDSCommandParameters(getVds().getId(), getStorageDomain().getStorage())).getReturnValue(); final List<LUNs> lunsFromDb = getLunDao().getAllForVolumeGroup(getStorageDomain().getStorage()); List<LUNs> lunsToUpdateInDb = getLunsToUpdateInDb(lunsFromVgInfo, lunsFromDb); <START> if (lunsFromDb.size() != lunsFromVgInfo.size() || lunsToUpdateInDb.size() > 0) { <END> TransactionSupport.executeInNewTransaction(() -> { updateLunsInDb(lunsToUpdateInDb); refreshLunsInfo(lunsFromVgInfo, lunsFromDb); return null; }); } setSucceeded(true); }</code><technical_language>is this refactoring related patch logic</technical_language>

Target:
protected void executeCommand() { final List<LUNs> lunsFromVgInfo = (List<LUNs>) runVdsCommand(VDSCommandType.GetVGInfo, new GetVGInfoVDSCommandParameters(getVds().getId(), getStorageDomain().getStorage())).getReturnValue(); final List<LUNs> lunsFromDb = getLunDao().getAllForVolumeGroup(getStorageDomain().getStorage()); List<LUNs> lunsToUpdateInDb = getLunsToUpdateInDb(lunsFromVgInfo, lunsFromDb); if (lunsFromDb.size() != lunsFromVgInfo.size() || !lunsToUpdateInDb.isEmpty()) { TransactionSupport.executeInNewTransaction(() -> { updateLunsInDb(lunsToUpdateInDb); refreshLunsConnections(lunsFromVgInfo); cleanupLunsFromDb(lunsFromVgInfo, lunsFromDb); return null; }); } setSucceeded(true); }
Source:
<code>boolean canStop() { <START> while (true) { <END> int state = getState(); if (state == START_EXITED_FAIL || state == STOPPING) { return false; } else if (state == START_EXITED_SUCCESSFUL) { if (compareAndSetState(START_EXITED_SUCCESSFUL, STOPPING)) { return true; } } else { throw new IllegalMonitorStateException("Called stop() before start()"); } } }</code><technical_language>specific reason for need of while</technical_language>

Target:
boolean canStop() { while (true) { int state = getState(); if (state == START_EXITED_FAIL || state == STOPPING) { return false; } else if (state == START_EXITED_SUCCESSFUL) { if (compareAndSetState(START_EXITED_SUCCESSFUL, STOPPING)) { return true; } } else { throw new IllegalMonitorStateException("Called canStop() before start()"); } } }
Source:
<code>public void doesNotBackOffIfLegacy() throws Exception { <START> when(shouldStopRetrying.test(anyInt())).thenAnswer(inv -> ((int) inv.getArgument(0)) > 50); <END> when(task.run()).thenThrow(new TransactionFailedRetriableException("")); assertThatExceptionOfType(TransactionFailedRetriableException.class) .isThrownBy(() -> legacy.runWithRetry(shouldStopRetrying, task)); assertThat(blockStrategy.totalBlockedTime).isZero(); }</code><technical_language>here, move a method, clears individual test, in a other places in test</technical_language>

Target:
public void doesNotBackOffIfLegacy() throws Exception { mockRetries(50); when(task.run()).thenThrow(new TransactionFailedRetriableException("")); assertThatExceptionOfType(TransactionFailedRetriableException.class) .isThrownBy(this::runLegacy); assertThat(blockStrategy.totalBlockedTime).isZero(); }
Source:
<code>public void testOverwriteBlobMetadata() throws Exception { String blobKey = TestUtils.createRandomBlobKey("writePayload-", ".img"); Blob blob = new BlobBuilderImpl() .name(blobKey) .payload(randomByteSource().slice(0, 1024)) .userMetadata(ImmutableMap.of("key1", "value1")) .build(); storageStrategy.putBlob(CONTAINER_NAME, blob); blob = storageStrategy.getBlob(CONTAINER_NAME, blobKey); if (!blob.getMetadata().getUserMetadata().containsKey("key1")) { throw new SkipException("Underlying filesystem does not support xattr"); <START> } <END> blob = new BlobBuilderImpl() .name(blobKey) .payload(randomByteSource().slice(0, 1024)) .build(); storageStrategy.putBlob(CONTAINER_NAME, blob); blob = storageStrategy.getBlob(CONTAINER_NAME, blobKey); assertFalse(blob.getMetadata().getUserMetadata().containsKey("key1")); }</code><technical_language>fine this here, "more correct" _not_ do this in a setup for a specific test, a TestUtils.filesystemSupportsXattr() method carry out this check of scope of test? SkipException happen _at beginning_ of test, is go..</technical_language>

Target:
public void testOverwriteBlobMetadata() throws Exception { if (!getFileStore(Paths.get(TestUtils.TARGET_BASE_DIR)).supportsFileAttributeView(UserDefinedFileAttributeView.class)) { throw new SkipException("Filesystem does not support xattr"); } String blobKey = TestUtils.createRandomBlobKey("writePayload-", ".img"); Blob blob = new BlobBuilderImpl() .name(blobKey) .payload(randomByteSource().slice(0, 1024)) .userMetadata(ImmutableMap.of("key1", "value1")) .build(); storageStrategy.putBlob(CONTAINER_NAME, blob); blob = storageStrategy.getBlob(CONTAINER_NAME, blobKey); assertEquals(blob.getMetadata().getUserMetadata().get("key1"), "value1"); blob = new BlobBuilderImpl() .name(blobKey) .payload(randomByteSource().slice(0, 1024)) .build(); storageStrategy.putBlob(CONTAINER_NAME, blob); blob = storageStrategy.getBlob(CONTAINER_NAME, blobKey); assertFalse(blob.getMetadata().getUserMetadata().containsKey("key1")); }
Source:
<code>public static void main(String[] args) throws Exception { Topology topology = new Topology("Echo"); <START> topology.checkpointPeriod(1, TimeUnit.MINUTES); <END> TStream<String> echo = topology.strings(args); echo.print(); StreamsContextFactory.getStreamsContext(StreamsContext.Type.TOOLKIT).submit(topology).get(); }</code><technical_language>debugging code left in?</technical_language>

Target:
public static void main(String[] args) throws Exception { Topology topology = new Topology("Echo"); TStream<String> echo = topology.strings(args); echo.print(); StreamsContextFactory.getEmbedded().submit(topology).get(); }
Source:
<code>public static Collection<Object[]> namesParams() { return Arrays.asList(new Object[][] { { null, false, false }, { "a.a.a.a", false, false }, { "255.255.0", false, false }, { "255.255.0.0.0", false, false }, { "255.255.0.0.", false, false }, { "255.255.0.1", true, false }, { "255.0.255.0", true, false }, { "255.0.0.255", true, false }, { "224.0.255.0", true, false }, { "255.255.0.0", true, true }, { "255.255.255.255", true, true }, { "31 ", false, false }, { "33", false, false }, { "31/", false, false }, { "31*", false, false }, { " <START> { "/31 ", false, false }, END> { "31", true, true }, { "/31", true, true }, { "2", true, true }, { "/2", true, true }, }); }</code><technical_language>More invalid formats: "01" "/01" "33" "/33"</technical_language>

Target:
public static Collection<Object[]> namesParams() { return Arrays.asList(new Object[][] { { null, false, false, true }, { "", false, false, true }, { "a.a.a.a", false, false, true }, { "255.255.0", false, false, true }, { "255.255.0.0.0", false, false, true }, { "255.255.0.0.", false, false, true }, { "31 ", false, false, true }, { "33", false, false, true }, { "31/", false, false, true }, { "31*", false, false, true }, { " { "/31 ", false, false, true }, { "01", false, false, true }, { "01/", false, false, true }, { "33", false, false, true }, { "/33", false, false, true }, { "255.255.0.1", true, false, true }, { "255.0.255.0", true, false, true }, { "255.0.0.255", true, false, true }, { "224.0.255.0", true, false, true }, { "255.255.0.0", true, true, true }, { "255.255.255.255", true, true, true }, { "31", true, true, true }, { "/31", true, true, true }, { "2", true, true, true }, { "/2", true, true, true }, { "31", false, false, false }, { "/31", false, false, false }, { "2", false, false, false }, { "/2", false, false, false }, { "255.255.0.1", true, false, true }, { "255.255.0.1", true, false, false }, { "255.255.0.0", true, true, true }, { "255.255.0.0", true, true, false }, }); }
Source:
<code>public String stemWord(String word) { if (word == null) { return word; } <START> word = word.toLowerCase(eoLocale); <END> if (isExceptionOrNumber(word)) { return word; } String suffix = word; int localMinStemLength = Math.max(minStemLength, firstVowelPos(suffix) + 1); int pluralDirectOffset = calcPluralDirectOffset(suffix); if (pluralDirectOffset > 0) { suffix = suffix.substring(0, suffix.length() - pluralDirectOffset); if (pluralDirectChecks.contains(suffix) || stemmerExceptions.contains(suffix)) { return suffix; } } suffix = findLongestSuffix(suffix, localMinStemLength); int stemLength = word.length() - suffix.length() - pluralDirectOffset; if (!suffix.isEmpty() && stemLength > 0 && suffix.charAt(0) == '-') { return word.substring(0, stemLength); } if (stemLength < localMinStemLength) { return word; } return word.substring(0, stemLength); }</code><technical_language>some stemmers expect this done, for dropping assume entering this filter is lowercased</technical_language>

Target:
public String stemWord(String word) { if (word == null) { return word; } if (isExceptionOrNumber(word)) { return word; } String suffix = word; int localMinStemLength = Math.max(MIN_STEM_LENGTH, firstVowelPos(suffix) + 1); int pluralDirectOffset = calcPluralDirectOffset(suffix); if (pluralDirectOffset > 0) { suffix = suffix.substring(0, suffix.length() - pluralDirectOffset); if (PLURAL_DIRECT_CHECKS.contains(suffix) || STEMMER_EXCEPTIONS.contains(suffix)) { return suffix; } } suffix = findLongestSuffix(suffix, localMinStemLength); int stemLength = word.length() - suffix.length() - pluralDirectOffset; if (!suffix.isEmpty() && stemLength > 0 && suffix.charAt(0) == '-') { return word.substring(0, stemLength); } if (stemLength < localMinStemLength) { return word; } return word.substring(0, stemLength); }
Source:
<code><START> private JavaSymbolicObject expandMacro(JavaSymbolicObject node) { <END> JavaSymbolicObject expandedNode = (JavaSymbolicObject) node.accept(this); while (!node.equals(expandedNode)) { node = expandedNode; expandedNode = (JavaSymbolicObject) node.accept(this); } return node; }</code><technical_language>pretty this right before... This impact performance. this change made</technical_language>

Target:
private JavaSymbolicObject expandMacro(JavaSymbolicObject node) { JavaSymbolicObject expandedNode = (JavaSymbolicObject) node.accept(this); while (node != expandedNode) { node = expandedNode; expandedNode = (JavaSymbolicObject) node.accept(this); } return node; }
Source:
<code>public static void readInDocFromPointable(UTF8StringPointable stringp, ByteBufferInputStream bbis, DataInputStream di, ArrayBackedValueStorage abvs, XMLParser parser) throws HyracksDataException { String fName; try { fName = getStringFromPointable(stringp, bbis, di); } catch (SystemException e) { throw new HyracksDataException(e); } File file = new File(fName); <START> if(file.exists()) <END> { parser.parseDocument(file, abvs); } else { HDFSFunctions hdfs = new HDFSFunctions(); FileSystem fs = hdfs.getFileSystem(); if (fs != null) { Path xmlDocument = new Path(fName); try { if (fs.exists(xmlDocument)) { InputStream in = fs.open(xmlDocument).getWrappedStream(); parser.parseHDFSDocument( in, abvs); } } catch (FileNotFoundException e) { System.err.println(e); } catch (IOException e) { System.err.println(e); } } } }</code><technical_language>Is this code style correct</technical_language>

Target:
public static void readInDocFromPointable(UTF8StringPointable stringp, ByteBufferInputStream bbis, DataInputStream di, ArrayBackedValueStorage abvs, XMLParser parser) throws HyracksDataException { String fName; try { fName = getStringFromPointable(stringp, bbis, di); } catch (SystemException e) { throw new HyracksDataException(e); } if (!fName.contains("hdfs:/")) { File file = new File(fName); if (file.exists()) { parser.parseDocument(file, abvs); } } else { fName = fName.replaceAll("hdfs:/", ""); HDFSFunctions hdfs = new HDFSFunctions(); FileSystem fs = hdfs.getFileSystem(); if (fs != null) { Path xmlDocument = new Path(fName); try { if (fs.exists(xmlDocument)) { InputStream in = fs.open(xmlDocument).getWrappedStream(); parser.parseHDFSDocument(in, abvs); } } catch (FileNotFoundException e) { System.err.println(e); } catch (IOException e) { System.err.println(e); } } } }
Source:
<code>protected void optimizeJoinGroup(AST2BOpContext ctx, StaticAnalysis sa, IBindingSet[] bSets, JoinGroupNode op) { final QueryRoot root = sa.getQueryRoot(); if (root.getQueryType() == QueryType.ASK) { return; } op.getChildren(SubqueryBase.class).stream().forEach(node -> { SubqueryBase subqueryBase = (SubqueryBase)node; JoinGroupNode whereClause = (JoinGroupNode)subqueryBase.getWhereClause(); <START> whereClause.setProperty(QueryBase.Annotations.PROJECTION, subqueryBase.getProjection()); <END> }); LabelServiceUtils.getLabelServiceNodes(op).forEach(service -> { JoinGroupNode g = (JoinGroupNode) service.getGraphPattern(); boolean foundArg = false; for (BOp st : g.args()) { StatementPatternNode sn = (StatementPatternNode) st; if (sn.s().isConstant() && BD.SERVICE_PARAM.equals(sn.s().getValue())) { continue; } foundArg = true; break; } if (EmptyLabelServiceOptimizer.this.restoreExtracted(service)) { foundArg = true; } if (!foundArg) { EmptyLabelServiceOptimizer.this.addResolutions(ctx, g, (ProjectionNode) service.getParent().annotations().get( QueryBase.Annotations.PROJECTION ) ); } }); }</code><technical_language>check whereClause is null? I possible..</technical_language>

Target:
protected void optimizeJoinGroup(AST2BOpContext ctx, StaticAnalysis sa, IBindingSet[] bSets, JoinGroupNode op) { final QueryRoot root = sa.getQueryRoot(); if (root.getQueryType() == QueryType.ASK) { return; } op.getChildren(SubqueryBase.class).forEach(node -> { JoinGroupNode whereClause = (JoinGroupNode) node.getWhereClause(); whereClause.setProperty(QueryBase.Annotations.PROJECTION, node.getProjection()); }); LabelServiceUtils.getLabelServiceNodes(op).forEach(service -> { JoinGroupNode g = (JoinGroupNode) service.getGraphPattern(); boolean foundArg = false; for (BOp st : g.args()) { StatementPatternNode sn = (StatementPatternNode) st; if (sn.s().isConstant() && BD.SERVICE_PARAM.equals(sn.s().getValue())) { continue; } foundArg = true; break; } if (restoreExtracted(service)) { foundArg = true; } if (!foundArg) { addResolutions(ctx, g, getProjectionNode(service)); } }); }
Source:
<code>private static List<Predicate<ChangeData>> filters( ChangeQueryBuilder.Arguments args, CurrentUser user, boolean checkIsVisible) { List<Predicate<ChangeData>> r = Lists.newArrayList(); ChangeQueryBuilder builder = new ChangeQueryBuilder(args, user); for (AccountProjectWatch w : user.getNotificationFilters()) { Predicate<ChangeData> f = null; if (w.getFilter() != null) { try { f = builder.parse(w.getFilter()); if (builder.find(f, IsWatchedByPredicate.class) != null) { continue; } } catch (QueryParseException e) { continue; } } Predicate<ChangeData> p; if (w.getProjectNameKey().equals(args.allProjectsName)) { p = null; } else { p = builder.project(w.getProjectNameKey().get()); } <START> if (p != null && f != null) { <END> r.add(and(p, f)); } else if (p != null) { r.add(p); } else if (f != null) { r.add(f); } else { r.add(builder.status_open()); } } if (r.isEmpty()) { return none(); } else if (checkIsVisible) { return ImmutableList.of(or(r), builder.is_visible()); } else { return r; } }</code><technical_language>[optional] fix warning this: @SuppressWarnings("unchecked") Predicate<ChangeData> andPredicate = and(p, f); r.add(andPredicate); need suppress warnings for complete method, is needed</technical_language>

Target:
private static List<Predicate<ChangeData>> filters( ChangeQueryBuilder.Arguments args, CurrentUser user, boolean checkIsVisible) { List<Predicate<ChangeData>> r = Lists.newArrayList(); ChangeQueryBuilder builder = new ChangeQueryBuilder(args, user); for (AccountProjectWatch w : user.getNotificationFilters()) { Predicate<ChangeData> f = null; if (w.getFilter() != null) { try { f = builder.parse(w.getFilter()); if (builder.find(f, IsWatchedByPredicate.class) != null) { continue; } } catch (QueryParseException e) { continue; } } Predicate<ChangeData> p; if (w.getProjectNameKey().equals(args.allProjectsName)) { p = null; } else { p = builder.project(w.getProjectNameKey().get()); } if (p != null && f != null) { @SuppressWarnings("unchecked") Predicate<ChangeData> andPredicate = and(p, f); r.add(andPredicate); } else if (p != null) { r.add(p); } else if (f != null) { r.add(f); } else { r.add(builder.status_open()); } } if (r.isEmpty()) { return none(); } else if (checkIsVisible) { return ImmutableList.of(or(r), builder.is_visible()); } else { return r; } }
Source:
<code>public SuggestionResource build() { return new SuggestionResource(this); <START> } <END></code><technical_language>Check mandatory parameters defined</technical_language>

Target:
public SuggestionResource build() { validate(); return new SuggestionResource(this); }
Source:
<code>private static String toDruidLiteral(RexNode rexNode, RelDataType rowType, DruidQuery druidQuery) { <START> final SimpleDateFormat dateFormatter = new SimpleDateFormat( <END> TimeExtractionFunction.ISO_TIME_FORMAT, Locale.ROOT); dateFormatter.setTimeZone(DateTimeUtils.UTC_ZONE); final String val; final RexLiteral rhsLiteral = (RexLiteral) rexNode; if (SqlTypeName.NUMERIC_TYPES.contains(rhsLiteral.getTypeName())) { val = String.valueOf(RexLiteral.value(rhsLiteral)); } else if (SqlTypeName.CHAR_TYPES.contains(rhsLiteral.getTypeName())) { val = String.valueOf(RexLiteral.stringValue(rhsLiteral)); } else if (SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE == rhsLiteral.getTypeName() || SqlTypeName.TIMESTAMP == rhsLiteral.getTypeName() || SqlTypeName.DATE == rhsLiteral.getTypeName()) { Long millisSinceEpoch = DruidDateTimeUtils.literalValue(rexNode); if (millisSinceEpoch == null) { throw new AssertionError( "Cannot translate Literal" + rexNode + " of type " + rhsLiteral.getTypeName() + " to TimestampString"); } val = dateFormatter.format(millisSinceEpoch); } else { val = null; } return val; }</code><technical_language>this static</technical_language>

Target:
private static String toDruidLiteral(RexNode rexNode, RelDataType rowType, DruidQuery druidQuery) { final String val; final RexLiteral rhsLiteral = (RexLiteral) rexNode; if (SqlTypeName.NUMERIC_TYPES.contains(rhsLiteral.getTypeName())) { val = String.valueOf(RexLiteral.value(rhsLiteral)); } else if (SqlTypeName.CHAR_TYPES.contains(rhsLiteral.getTypeName())) { val = String.valueOf(RexLiteral.stringValue(rhsLiteral)); } else if (SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE == rhsLiteral.getTypeName() || SqlTypeName.TIMESTAMP == rhsLiteral.getTypeName() || SqlTypeName.DATE == rhsLiteral.getTypeName()) { Long millisSinceEpoch = DruidDateTimeUtils.literalValue(rexNode); if (millisSinceEpoch == null) { throw new AssertionError( "Cannot translate Literal" + rexNode + " of type " + rhsLiteral.getTypeName() + " to TimestampString"); } val = DATE_FORMATTER.format(millisSinceEpoch); } else { val = null; } return val; }
Source:
<code>public void onChildOpened( @NonNull Network network, @NonNull ChildSessionConfiguration childConfig) { if (!isActiveNetwork(network)) { Log.d(TAG, "onOpened called for obsolete network " + network); return; } try { final Collection<RouteInfo> newRoutes = VpnIkev2Utils.getRoutesFromTrafficSelectors( childConfig.getOutboundTrafficSelectors()); for (final LinkAddress address : childConfig.getInternalAddresses()) { mTunnelIface.addAddress(address.getAddress(), address.getPrefixLength()); } final NetworkAgent networkAgent; final LinkProperties lp; synchronized (Vpn.this) { mInterface = <START> mTunnelIface.getInterfaceName(); <END> mConfig.mtu = mProfile.getMaxMtu(); mConfig.interfaze = mInterface; mConfig.addresses.clear(); mConfig.addresses.addAll(childConfig.getInternalAddresses()); mConfig.routes.clear(); mConfig.routes.addAll(newRoutes); networkAgent = mNetworkAgent; lp = makeLinkProperties(); if (networkAgent == null) { if (isSettingsVpnLocked()) { prepareStatusIntent(); } agentConnect(); return; } } networkAgent.sendLinkProperties(lp); } catch (Exception e) { Log.d(TAG, "Error in ChildOpened for network " + network, e); onSessionLost(network); } }</code><technical_language>remove this call lock calling moving a local</technical_language>

Target:
public void onChildOpened( @NonNull Network network, @NonNull ChildSessionConfiguration childConfig) { if (!isActiveNetwork(network)) { Log.d(TAG, "onOpened called for obsolete network " + network); return; } try { final String interfaceName = mTunnelIface.getInterfaceName(); final int maxMtu = mProfile.getMaxMtu(); final List<LinkAddresses> internalAddresses = childConfig.getInternalAddresses(); final Collection<RouteInfo> newRoutes = VpnIkev2Utils.getRoutesFromTrafficSelectors( childConfig.getOutboundTrafficSelectors()); for (final LinkAddress address : internalAddresses) { mTunnelIface.addAddress(address.getAddress(), address.getPrefixLength()); } final NetworkAgent networkAgent; final LinkProperties lp; synchronized (Vpn.this) { mInterface = interfaceName; mConfig.mtu = maxMtu; mConfig.interfaze = mInterface; mConfig.addresses.clear(); mConfig.addresses.addAll(internalAddresses); mConfig.routes.clear(); mConfig.routes.addAll(newRoutes); networkAgent = mNetworkAgent; if (networkAgent == null) { if (isSettingsVpnLocked()) { prepareStatusIntent(); } agentConnect(); return; } lp = makeLinkProperties(); } networkAgent.sendLinkProperties(lp); } catch (Exception e) { Log.d(TAG, "Error in ChildOpened for network " + network, e); onSessionLost(network); } }
Source:
<code>private byte[] convertAvroToJson(String schema, byte[] bytes) { return new AvroToJsonConverter(new Schema.Parser().parse(schema)) <START> .convert(avroMessageContentWrapper.unwrapContent(bytes).getContent()); <END> }</code><technical_language>Unwrapped content is returned for avro message, for json is wrapped. unify it</technical_language>

Target:
private byte[] convertAvroToJson(String schema, byte[] bytes) { return new AvroToJsonConverter(avroMessageContentWrapper.getWrappedSchema(schema)).convert(bytes); }
Source:
<code>public void addStock(Stock <START> stock) throws <END> StockMarketExpection { if (stock.getPrice() < 0.0) { throw new StockMarketExpection("Stock has a negative price (" + stock.getSymbol() + ", " + stock.getPrice() + ")"); } if (stockList.containsKey(stock.getSymbol())) { throw new StockMarketExpection( "Tried to enter a stock that is already present (" + stock.getSymbol() + ")"); } stockList.put(stock.getSymbol(), stock); marketHistory .startHistoryWithPrice(stock.getSymbol(), stock.getPrice()); }</code><technical_language>check if stock == null</technical_language>

Target:
public void addStock(Stock stock) throws StockMarketExpection { if(stock != null){ if (stock.getPrice() < 0.0) { throw new StockMarketExpection("Stock has a negative price (" + stock.getSymbol() + ", " + stock.getPrice() + ")"); } if (stockList.containsKey(stock.getSymbol())) { throw new StockMarketExpection( "Tried to enter a stock that is already present (" + stock.getSymbol() + ")"); } stockList.put(stock.getSymbol(), stock); marketHistory .startHistoryWithPrice(stock.getSymbol(), stock.getPrice()); } }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <START> mSubscriptions = new Disposable[2]; <END> mRepository = (Repository) getArguments().getSerializable("repo"); mRef = getArguments().getString("ref"); }</code><technical_language>some sort of map? avoid potential out of bounds exceptions adds new subscription update declaration</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mRepository = (Repository) getArguments().getSerializable("repo"); mRef = getArguments().getString("ref"); }
Source:
<code>public DruidDataSource( String name, Map<String, String> properties ) { this.name = name; this.properties = properties; this.idToSegmentMap = new HashMap<>(); <START> this.segmentsHolder = new HashSet<>(); <END> }</code><technical_language>is concurrency needed</technical_language>

Target:
public DruidDataSource( String name, Map<String, String> properties ) { this.name = Preconditions.checkNotNull(name); this.properties = properties; this.idToSegmentMap = new ConcurrentHashMap<>(); }
Source:
<code>public void run() { try { <START> cloudBlockBlob.download(new NullOutputStream()); <END> } catch (StorageException e) { throw new RuntimeException(e); } }</code><technical_language>Re-use NullOutputStream</technical_language>

Target:
public void run() { try { cloudBlockBlob.download(DEV_NULL); } catch (StorageException e) { throw new RuntimeException(e); } }
Source:
<code>protected void doGetText(HttpServletRequest req, HttpServletResponse res) throws IOException { GitilesView view = ViewFilter.getView(req); Repository repo = ServletUtils.getRepository(req); ObjectReader reader = repo.newObjectReader(); ObjectLoader loader = reader.open(view.getRevision().getId(), <START> OBJ_COMMIT); <END> if (loader.getType() != OBJ_COMMIT) { res.setStatus(SC_NOT_FOUND); } else { try (Writer writer = startRenderText(req, res); OutputStream out = BaseEncoding.base64().encodingStream(writer)) { loader.copyTo(out); } } }</code><technical_language>No, get IncorrectObjectTypeException if a commit, cf. WindowCursor.java:152. pass a hint</technical_language>

Target:
protected void doGetText(HttpServletRequest req, HttpServletResponse res) throws IOException { GitilesView view = ViewFilter.getView(req); Repository repo = ServletUtils.getRepository(req); ObjectReader reader = repo.newObjectReader(); ObjectLoader loader = reader.open(view.getRevision().getId()); if (loader.getType() != OBJ_COMMIT) { res.setStatus(SC_NOT_FOUND); } else { try (Writer writer = startRenderText(req, res); OutputStream out = BaseEncoding.base64().encodingStream(writer)) { loader.copyTo(out); } } }
Source:
<code>private void handleInfo(Packet packet) { Optional<XMPPContact> contact = contactsService.getContact(packet.getFrom()); if (!contact.isPresent()) return; <START> InfoExchangeExtension versionInfo = InfoExchangeExtension.PROVIDER.getPayload(packet); <END> if (versionInfo == null) { log.warn("contact: " + contact + ", VersionExchangeExtension packet is malformed"); return; } log.debug("received: " + versionInfo.getData()); remoteInfo.put(contact.get(), new ClientInfo(versionInfo.getData())); }</code><technical_language>suggestion InfoExchangeExtension info = InfoExchangeExtension.PROVIDER.getPayload(packet);</technical_language>

Target:
private void handleInfo(Packet packet) { Optional<XMPPContact> contact = contactsService.getContact(packet.getFrom()); if (!contact.isPresent()) return; InfoExchangeExtension info = InfoExchangeExtension.PROVIDER.getPayload(packet); if (info == null) { log.warn("contact: " + contact + ", InfoExchangeExtension packet is malformed"); return; } log.debug("received: " + info.getData()); remoteInfo.put(contact.get(), new ClientInfo(info.getData())); }
Source:
<code>public boolean isBroadcastEnabled() { <START> return preferences.getBoolean(context.getString(R.string.camping_enable), false); <END> }</code><technical_language>camping_enable -> broadcast_enabled</technical_language>

Target:
public boolean isBroadcastEnabled() { return preferences.getBoolean(context.getString(R.string.broadcast_enable), false); }
Source:
<code>public static void addProfileDataToNic(Map<String, Object> struct, VM vm, VmDevice vmDevice, VmNic nic) { VnicProfile vnicProfile = null; Network network = null; String networkName = ""; if (nic.getVnicProfileId() != null) { vnicProfile = DbFacade.getInstance().getVnicProfileDao().get(nic.getVnicProfileId()); if (vnicProfile != null) { network = DbFacade.getInstance().getNetworkDao().get(vnicProfile.getNetworkId()); <START> networkName = network == null ? "" : network.getName(); <END> log.debugFormat("VNIC {0} is using profile {1} on network {2}", nic.getName(), vnicProfile, networkName); addQosForDevice(struct, vnicProfile, vm.getVdsGroupCompatibilityVersion()); } } struct.put(VdsProperties.NETWORK, networkName); if (vnicProfile != null && vnicProfile.isPortMirroring()) { struct.put(VdsProperties.PORT_MIRRORING, network == null ? Collections.<String> emptyList() : Collections.singletonList(networkName)); } addCustomPropertiesForDevice(struct, vm, vmDevice, vm.getVdsGroupCompatibilityVersion(), getVnicCustomProperties(vnicProfile)); }</code><technical_language>note network == null happen, a vm this vnic profile a reference network</technical_language>

Target:
public static void addProfileDataToNic(Map<String, Object> struct, VM vm, VmDevice vmDevice, VmNic nic) { VnicProfile vnicProfile = null; Network network = null; String networkName = ""; if (nic.getVnicProfileId() != null) { vnicProfile = DbFacade.getInstance().getVnicProfileDao().get(nic.getVnicProfileId()); if (vnicProfile != null) { network = DbFacade.getInstance().getNetworkDao().get(vnicProfile.getNetworkId()); networkName = network.getName(); log.debugFormat("VNIC {0} is using profile {1} on network {2}", nic.getName(), vnicProfile, networkName); addQosForDevice(struct, vnicProfile, vm.getVdsGroupCompatibilityVersion()); } } struct.put(VdsProperties.NETWORK, networkName); if (vnicProfile != null && vnicProfile.isPortMirroring()) { struct.put(VdsProperties.PORT_MIRRORING, network == null ? Collections.<String> emptyList() : Collections.singletonList(networkName)); } addCustomPropertiesForDevice(struct, vm, vmDevice, vm.getVdsGroupCompatibilityVersion(), getVnicCustomProperties(vnicProfile)); }
Source:
<code>public void shouldNotWipeStateStoresIfUnableToLockTaskDirectory() throws IOException { final File unknownFile = new File("/unknown/path"); expect(stateManager.taskId()).andReturn(taskId); expect(stateDirectory.lock(taskId)).andReturn(false); expect(stateManager.baseDir()).andReturn(unknownFile); Utils.delete(unknownFile); <START> expectLastCall().andThrow(new StreamsException("Should not be trying to wipe state you don't own!")); <END> ctrl.checkOrder(true); ctrl.replay(); replayAll(); StateManagerUtil.closeStateManager( logger, "logPrefix:", false, true, stateManager, stateDirectory, TaskType.ACTIVE); }</code><technical_language>Ditto here, AssertionError</technical_language>

Target:
public void shouldNotWipeStateStoresIfUnableToLockTaskDirectory() throws IOException { final File unknownFile = new File("/unknown/path"); expect(stateManager.taskId()).andReturn(taskId); expect(stateDirectory.lock(taskId)).andReturn(false); expect(stateManager.baseDir()).andReturn(unknownFile); Utils.delete(unknownFile); expectLastCall().andThrow(new AssertionError("Should not be trying to wipe state you don't own!")); ctrl.checkOrder(true); ctrl.replay(); replayAll(); StateManagerUtil.closeStateManager( logger, "logPrefix:", false, true, stateManager, stateDirectory, TaskType.ACTIVE); }
Source:
<code>public synchronized String load(Properties configuration) { <START> return loadImpl(configuration, null); <END> }</code><technical_language>sync loadImpl</technical_language>

Target:
public String load(Properties configuration) { return loadImpl(configuration, null); }
Source:
<code>private boolean isDistinctNode(AggregationNode aggregationNode) { return aggregationNode.getOutputSymbols().size() == 1 && aggregationNode.getGroupingKeys().size() == 1 <START> && aggregationNode.getOutputSymbols().get(0) == aggregationNode.getGroupingKeys().get(0); <END> }</code><technical_language>== equals</technical_language>

Target:
private boolean isDistinctNode(AggregationNode aggregationNode) { List<Symbol> outputSymbols = aggregationNode.getOutputSymbols(); List<Symbol> groupingKeys = aggregationNode.getGroupingKeys(); return aggregationNode.getStep() == SINGLE && outputSymbols.size() == 1 && groupingKeys.size() == 1 && outputSymbols.get(0).equals(groupingKeys.get(0)); }
Source:
<code>public int hashCode() { int result; long temp; result = dofM; result = 31 * result + carrier.hashCode(); result = 31 * result + dofW; result = 31 * result + (tailNum != null ? tailNum.hashCode() : 0); result = 31 * result + flightNum; result = 31 * result + (originID != null ? originID.hashCode() : 0); result = 31 * result + origin.hashCode(); result = 31 * result + (destId != null ? destId.hashCode() : 0); result = 31 * result + dest.hashCode(); temp = Double.doubleToLongBits(scheduleDepTime); result = 31 * result + (int) (temp ^ (temp >>> 32)); result = 31 * result + (deptime != null ? deptime.hashCode() : 0); result = 31 * result + depDelayMins.hashCode(); result = 31 * result + (scheduledArrTime != null ? scheduledArrTime.hashCode() : 0); result = 31 * result + (arrTime != null ? arrTime.hashCode() : 0); result = 31 * result + (arrDelay != null ? arrDelay.hashCode() : 0); result = 31 * result + (elapsedTime != null ? elapsedTime.hashCode() : 0); result = 31 * result + distance; <START> result = 31 * result + delayed.hashCode(); <END> return result; }</code><technical_language>delayed is nullable, this result in a NPE</technical_language>

Target:
public int hashCode() { return Objects.hash(dofM, dofW, carrier, tailNum, flightNum, originId, origin, destId, dest, scheduleDepTime, deptime, depDelayMins, scheduledArrTime, arrTime, arrDelay, elapsedTime, distance, delayed); }
Source:
<code><START> public NoSuchPartitionException(String tableName, String partitionName) { <END> super(String.format("ERROR: \"%s\" does not exist in \"%s\".", partitionName, tableName)); }</code><technical_language>imports in this source code unused. Please remove them. I this is related changes</technical_language>

Target:
public NoSuchPartitionException(String tableName, String partitionName) { super(String.format("ERROR: \"%s\" is not the partition of \"%s\".", partitionName, tableName)); }
Source:
<code>public void registerAdditionalCatalog(Achievement achievement) { String lowerId = achievement.getId().toLowerCase(Locale.ENGLISH); <START> this.achievementMappings.putIfAbsent(lowerId, achievement); <END> this.achievementMappings.putIfAbsent(lowerId.replaceFirst("^achievement.", ""), achievement); String underscoreId = achievement.getId().replaceAll("[A-Z]", "_$0").toLowerCase(Locale.ENGLISH); this.achievementMappings.putIfAbsent(underscoreId, achievement); this.achievementMappings.putIfAbsent(underscoreId.replaceFirst("^achievement.", ""), achievement); }</code><technical_language>I idea of allowing putIfAbsent, if achievement is registered, throw exception. If is register duplicate ids for achievements, throw exception</technical_language>

Target:
public void registerAdditionalCatalog(Achievement achievement) { String lowerId = achievement.getId().toLowerCase(Locale.ENGLISH); this.achievementMappings.putIfAbsent(lowerId, achievement); this.achievementMappings.putIfAbsent(lowerId.replaceFirst("^achievement.", ""), achievement); String underscoreId = achievement.getId().replaceAll("[A-Z]", "_$0").toLowerCase(Locale.ENGLISH); this.achievementMappings.putIfAbsent(underscoreId, achievement); this.achievementMappings.putIfAbsent(underscoreId.replaceFirst("^achievement.", ""), achievement); this.achievements = null; }
Source:
<code>private boolean isInterruptedOrCanceled(IProgressMonitor monitor) { if (Thread.currentThread().isInterrupted()) { return true; } else if (monitor.isCanceled()) { <START> if (shutdownInProgress.compareAndSet(false, true)) { <END> Runnable runnable = new Runnable() { public void run() { shutdownPools(); } }; ListenableFuture<?> listenableFuture = terminator.submit(runnable); Futures.addCallback(listenableFuture, new FutureCallback<Object>() { public void onSuccess(Object result) { shutdownInProgress.set(false); } public void onFailure(Throwable t) { shutdownInProgress.set(false); EMFCompareIDEUIPlugin.getDefault().log(t); } }); } return true; } else { return false; } }</code><technical_language>This side-effect avoided. responsibility of "isXOrY" is "return X || Y", do some extra work in process. Shutting pools done in finally blocks of "entry points". "shutdownInProgress" boolean set "shutdownPools" itself? If this side-effect avoided, method name advertise it</technical_language>

Target:
private boolean isInterruptedOrCanceled(IProgressMonitor monitor) { return Thread.currentThread().isInterrupted() || monitor.isCanceled(); }