auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public void shouldReturnRelationshipForLookupGetRelationshipByTypeUuidAndPersonBUuid() { <END> String className = Relationship.class.getSimpleName(); String relationshipTypeUuid = "relationshipTypeUuid"; String personUuid = "personUuid"; Map<String, String> lookupFields = new HashMap<>(); lookupFields.put(RELATIONSHIP_TYPE_UUID, relationshipTypeUuid); lookupFields.put(PERSON_UUID, personUuid); Relationship expected = prepareRelationship(); when(relationshipService.getByTypeUuidAndPersonUuid(eq(null), eq(relationshipTypeUuid), eq(personUuid))) .thenReturn(expected); Object object = taskDataProvider.lookup(className, BY_PERSON_UUID, lookupFields); verify(relationshipService).getByTypeUuidAndPersonUuid(eq(null), eq(relationshipTypeUuid), eq(personUuid)); assertEquals(expected, object); }</code><technical_language>test? create a separate ticket for</technical_language>

Target:
public void shouldReturnRelationshipForLookupGetRelationshipByTypeUuidAndPersonBUuid() { String className = Relationship.class.getSimpleName(); String relationshipTypeUuid = "relationshipTypeUuid"; String personUuid = "personUuid"; Map<String, String> lookupFields = new HashMap<>(); lookupFields.put(RELATIONSHIP_TYPE_UUID, relationshipTypeUuid); lookupFields.put(PERSON_UUID, personUuid); List<Relationship> expected = prepareRelationship(); when(relationshipService.getByTypeUuidAndPersonUuid(eq(null), eq(relationshipTypeUuid), eq(personUuid))) .thenReturn(expected); Object object = taskDataProvider.lookup(className, BY_PERSON_UUID, lookupFields); verify(relationshipService).getByTypeUuidAndPersonUuid(eq(null), eq(relationshipTypeUuid), eq(personUuid)); assertEquals(expected.get(0), object); }
Source:
<code>private InternetAddress toNormalizedAddress(String address) throws UnsupportedEncodingException { if (address == null) { return null; } if (!address.contains("@")) { if (defaultSuffix != null && defaultSuffix.contains("@")) { address += defaultSuffix; } else { return null; } } try { return Mailer.StringToAddress(address, charset); } catch (AddressException e) { if (listener != null) { listener.getLogger().println("Unable to send to address: " + address); <START> e.printStackTrace(listener.error(e.getMessage())); <END> } return null; } }</code><technical_language>simplified to: e.printStackTrace(listener.error("Unable send address: " + address));</technical_language>

Target:
private InternetAddress toNormalizedAddress(String address) throws UnsupportedEncodingException { if (address == null) { return null; } if (!address.contains("@")) { if (defaultSuffix != null && defaultSuffix.contains("@")) { address += defaultSuffix; } else { return null; } } try { return Mailer.StringToAddress(address, charset); } catch (AddressException e) { logError("Unable to send to address: " + address, e); return null; } }
Source:
<code>private TmfTraceManager() { fTraces = new LinkedHashMap<ITmfTrace, TmfTraceContext>(); <START> fFilters = new LinkedHashMap<ITmfTrace, ITmfFilter>(); <END> TmfSignalManager.registerVIP(this); }</code><technical_language>I filter part of TmfTraceContext. Please move there</technical_language>

Target:
private TmfTraceManager() { fTraces = new LinkedHashMap<ITmfTrace, TmfTraceContext>(); TmfSignalManager.registerVIP(this); }
Source:
<code>public static String loadResource(final InputStream in) throws Exception { <START> final Reader reader = new InputStreamReader(in); <END> final StringBuilder text = new StringBuilder(); final char[] buf = new char[1024]; int len = 0; while ((len = reader.read(buf)) >= 0) { text.append(buf, 0, len); } return text.toString(); }</code><technical_language>Please implement as: java return IOUtils.readLines(in, StandardCharsets.UTF_8).stream().collect(Collectors.joining(System.lineSeparator())); I apply this for: org.drools.workbench.services.verifier.plugin.client.testutil.TestUtil#loadResource</technical_language>

Target:
public static String loadResource(final InputStream in) throws Exception { return IOUtils.readLines(in, StandardCharsets.UTF_8).stream().collect(Collectors.joining(System.lineSeparator())); }
Source:
<code>public SetWireframe(boolean enabled) { this.enabled = enabled; <START> this.mode = enabled? ENABLED_MODE: DISABLED_MODE; <END> }</code><technical_language>Space "enabled" please</technical_language>

Target:
public SetWireframe(boolean enabled) { this.enabled = enabled; this.mode = enabled ? GL_LINE : GL_FILL; }
Source:
<code>public static SphereClient createHttpTestDouble(final Function<HttpRequestIntent, HttpResponse> function) { return new SphereClient() { private final ObjectMapper objectMapper = SphereJsonUtils.newObjectMapper(); @Override public <T> CompletionStage<T> execute(final SphereRequest<T> sphereRequest) { final HttpRequestIntent httpRequest = sphereRequest.httpRequestIntent(); final HttpResponse httpResponse = function.apply(httpRequest); try { final T t = SphereClientImpl.parse(sphereRequest, objectMapper, SphereApiConfig.of("fake-project-key-for-testing", "<LINK_0>"), httpResponse, null); return CompletableFutureUtils.successful(t); } catch (final Exception e) { return CompletableFutureUtils.failed(e); } } @Override public void close() { } @Override public String toString() { return "SphereClientHttpTestDouble"; } @Override public SphereApiConfig getConfig() { <START> return SphereApiConfig.of("DUMMY_PROJECT_KEY","DUMMY_API_URL"); <END> } }; }</code><technical_language>Notice another getConfig some lines this code. notice this client's execute method a SphereApiConfig. save config a class field in sides</technical_language>

Target:
public static SphereClient createHttpTestDouble(final Function<HttpRequestIntent, HttpResponse> function) { return new SphereClient() { private final ObjectMapper objectMapper = SphereJsonUtils.newObjectMapper(); @Override public <T> CompletionStage<T> execute(final SphereRequest<T> sphereRequest) { final HttpRequestIntent httpRequest = sphereRequest.httpRequestIntent(); final HttpResponse httpResponse = function.apply(httpRequest); try { final T t = SphereClientImpl.parse(sphereRequest, objectMapper, sphereApiConfig, httpResponse, null); return CompletableFutureUtils.successful(t); } catch (final Exception e) { return CompletableFutureUtils.failed(e); } } @Override public void close() { } @Override public String toString() { return "SphereClientHttpTestDouble"; } @Override public SphereApiConfig getConfig() { return sphereApiConfig; } }; }
Source:
<code>public void testScoresMismatchIfNoContentAliasMatch(){ Item subject = new Item("subj", "subj", Publisher.YOUVIEW); <START> Alias subjAlias = new Alias("subjAlias", "subjAlias"); <END> subject.setAliases(ImmutableSet.of(subjAlias)); Item candidate = new Item("cand", "cand", Publisher.PA); Alias candAlias = new Alias("candAlias", "candAlias"); candidate.setAliases(ImmutableSet.of(candAlias)); ScoredCandidates<Item> results = scorer.score( subject, ImmutableSet.of(candidate), new DefaultDescription()); assertThat(results.candidates().get(candidate), is(mismatchScore)); }</code><technical_language>ideally values in case reading wrong accidentally</technical_language>

Target:
public void testScoresMismatchIfNoContentAliasMatch(){ Item subject = new Item("subj", "subj", Publisher.YOUVIEW); Alias subjAlias = new Alias("subjAlias one", "subjAlias two"); subject.setAliases(ImmutableSet.of(subjAlias)); Item candidate = new Item("cand", "cand", Publisher.PA); Alias candAlias = new Alias("candAlias one", "candAlias two"); candidate.setAliases(ImmutableSet.of(candAlias)); ScoredCandidates<Item> results = scorer.score( subject, ImmutableSet.of(candidate), new DefaultDescription()); assertThat(results.candidates().get(candidate), is(mismatchScore)); }
Source:
<code>public AsyncFuture<FullQuery> query(final FullQuery.Request request) { if (!concurrentQueries.tryAcquire()) { throw new GoAwayException( "Node has reached maximum number of concurrent MetricManager requests (" + concurrentQueriesBackoff + ")"); <START> } <END> final QueryOptions options = request.getOptions(); final QueryContext queryContext = request.getContext(); queryLogger.logIncomingRequestAtNode(queryContext, request); final DataInMemoryReporter dataInMemoryReporter = reporter.newDataInMemoryReporter(); final QuotaWatcher quotaWatcher = new QuotaWatcher( options.getDataLimit().orElse(dataLimit).asLong().orElse(Long.MAX_VALUE), options .getAggregationLimit() .orElse(aggregationLimit) .asLong() .orElse(Long.MAX_VALUE), dataInMemoryReporter); final OptionalLimit seriesLimit = options.getSeriesLimit().orElse(LocalMetricManager.this.seriesLimit); final boolean failOnLimits = options.getFailOnLimits().orElse(LocalMetricManager.this.failOnLimits); final OptionalLimit groupLimit = options.getGroupLimit().orElse(LocalMetricManager.this.groupLimit); final LazyTransform<FindSeries, FullQuery> transform = new Transform(request, failOnLimits, seriesLimit, groupLimit, quotaWatcher, dataInMemoryReporter); return metadata .findSeries( new FindSeries.Request(request.getFilter(), request.getRange(), seriesLimit)) .onDone(reporter.reportFindSeries()) .lazyTransform(transform) .directTransform(fullQuery -> { queryLogger.logOutgoingResponseAtNode(queryContext, fullQuery); return fullQuery; }) .onDone(reporter.reportQueryMetrics()) .onFinished(concurrentQueries::release); }</code><technical_language>synchronous exception in this code block semaphore leak leases, eventually lock up. suggest a helper function catches these, releases semaphore for circumstances. * exception is thrown. * future completes</technical_language>

Target:
public AsyncFuture<FullQuery> query(final FullQuery.Request request) { if (!concurrentQueries.tryAcquire()) { return async.failed(new GoAwayException( "Node has reached maximum number of concurrent MetricManager requests (" + concurrentQueriesBackoff + ")")); } try { return protectedQuery(request).onFinished(concurrentQueries::release); } catch (Exception e) { concurrentQueries.release(); throw new RuntimeException(e); } }
Source:
<code>public void testGetRelativePath() { ______TS("web URL with no relative path"); String url = "<LINK_2>"; assertEquals("", Url.getRelativePath(url)); ______TS("typical web URL"); url = "<LINK_1>"; assertEquals("/page", Url.getRelativePath(url)); <START> } <END></code><technical_language>AppUrlTest class? I for test case verifies trimming of trailing slash find it</technical_language>

Target:
public void testGetRelativePath() throws Exception { ______TS("web URL with no relative path"); String url = "<LINK_2>"; assertEquals("", Url.getRelativePath(url)); ______TS("typical web URL"); url = "<LINK_0>"; assertEquals("/page?key1=value1", Url.getRelativePath(url)); }
Source:
<code>private void setRepartitionTopicMetadataNumberOfPartitions(final Map<String, InternalTopicConfig> repartitionTopicMetadata, final Map<Integer, TopicsInfo> topicGroups, final Cluster metadata) { final Set<String> allRepartitionSourceTopics = new HashSet<>(); final Map<String, TopicNode> builtTopicNodes = new HashMap<>(); for (final TopicsInfo topicsInfo : topicGroups.values()) { <START> for (final String topicName : topicsInfo.repartitionSourceTopics.keySet()) { <END> allRepartitionSourceTopics.add(topicName); } for (final String sourceTopic : topicsInfo.sourceTopics) { if (builtTopicNodes.containsKey(sourceTopic)) { builtTopicNodes.get(sourceTopic).addDownStreamTopicsInfo(topicsInfo); } else { final TopicNode topicNode = new TopicNode(sourceTopic); topicNode.addDownStreamTopicsInfo(topicsInfo); builtTopicNodes.put(sourceTopic, topicNode); } } for (final String sinkTopic : topicsInfo.sinkTopics) { if (builtTopicNodes.containsKey(sinkTopic)) { builtTopicNodes.get(sinkTopic).addUpStreamTopicsInfo(topicsInfo); } else { final TopicNode topicNode = new TopicNode(sinkTopic); topicNode.addUpStreamTopicsInfo(topicsInfo); builtTopicNodes.put(sinkTopic, topicNode); } } } for (final String topic : allRepartitionSourceTopics) { calcRepartitionNumForTopic(topic, repartitionTopicMetadata, metadata, builtTopicNodes, new HashMap<TopicsInfo, Integer>()); } }</code><technical_language>replace addAll: allRepartitionSourceTopics.addAll(topicsInfo.repartitionSourceTopics.keySet());</technical_language>

Target:
private void setRepartitionTopicMetadataNumberOfPartitions(final Map<String, InternalTopicConfig> repartitionTopicMetadata, final Map<Integer, TopicsInfo> topicGroups, final Cluster metadata) { final Set<String> allRepartitionSourceTopics = new HashSet<>(); final Map<String, TopicNode> builtTopicNodes = new HashMap<>(); for (final TopicsInfo topicsInfo : topicGroups.values()) { allRepartitionSourceTopics.addAll(topicsInfo.repartitionSourceTopics.keySet()); for (final String sourceTopic : topicsInfo.sourceTopics) { builtTopicNodes.computeIfAbsent(sourceTopic, topic -> new TopicNode(topic)); builtTopicNodes.get(sourceTopic).addDownStreamTopicsInfo(topicsInfo); } for (final String sinkTopic : topicsInfo.sinkTopics) { builtTopicNodes.computeIfAbsent(sinkTopic, topic -> new TopicNode(topic)); builtTopicNodes.get(sinkTopic).addUpStreamTopicsInfo(topicsInfo); } } for (final String topic : allRepartitionSourceTopics) { calcRepartitionNumForTopic(topic, repartitionTopicMetadata, metadata, builtTopicNodes, new HashMap<TopicsInfo, Integer>()); } }
Source:
<code>public static boolean isOverlord(Properties properties) { <START> return Boolean.valueOf(properties.getProperty("druid.coordinator.asOverlord.enabled")); <END> }</code><technical_language>I is need get a boxed Boolean either, Boolean.parseBoolean() is a direct equivalent returns a primitive</technical_language>

Target:
public static boolean isOverlord(Properties properties) { return Boolean.parseBoolean(properties.getProperty("druid.coordinator.asOverlord.enabled")); }
Source:
<code>private void updateMessageState(Collection<Message> msgsToBeUpdated, HelixDataAccessor accessor, String instanceName) { if (!msgsToBeUpdated.isEmpty()) { Builder keyBuilder = accessor.keyBuilder(); List<String> updateMsgPaths = new ArrayList<>(); List<DataUpdater<ZNRecord>> updaters = new ArrayList<>(); for (Message msg : msgsToBeUpdated) { updateMsgPaths.add(msg.getKey(keyBuilder, instanceName).getPath()); updaters.add(currentData -> { if (currentData == null) { LOG.warn( "Message targets at has already been removed before it is set as READ on instance {}", msg.getId(), msg.getTgtName(), instanceName); return null; } return msg.getRecord(); }); } accessor.updateChildren(updateMsgPaths, updaters, AccessOption.PERSISTENT); } <START> boolean isNewMessageUpdated = false; <END> for (Message msg : msgsToBeUpdated) { if (msg.getMsgState().equals(MessageState.NEW)) { isNewMessageUpdated = true; } else { _knownMessageIds.add(msg.getId()); } } if (isNewMessageUpdated) { sendNopMessage(accessor, instanceName); } }</code><technical_language>naming a bit confusing. This message is updated NEW is processed right? call MessageUpdatedAsNew something</technical_language>

Target:
private void updateMessageState(Collection<Message> msgsToBeUpdated, HelixDataAccessor accessor, String instanceName) { if (msgsToBeUpdated.isEmpty()) { return; } Builder keyBuilder = accessor.keyBuilder(); List<Message> updateMsgs = new ArrayList<>(); List<String> updateMsgPaths = new ArrayList<>(); List<DataUpdater<ZNRecord>> updaters = new ArrayList<>(); for (Message msg : msgsToBeUpdated) { updateMsgs.add(msg); updateMsgPaths.add(msg.getKey(keyBuilder, instanceName).getPath()); updaters.add(currentData -> { if (currentData == null) { LOG.warn( "Message targets at has already been removed before it is set as READ on instance {}", msg.getId(), msg.getTgtName(), instanceName); return null; } return msg.getRecord(); }); } boolean[] updateResults = accessor.updateChildren(updateMsgPaths, updaters, AccessOption.PERSISTENT); boolean isMessageUpdatedAsNew = false; for (int i = 0; i < updateMsgs.size(); i++) { Message msg = updateMsgs.get(i); if (msg.getMsgState().equals(MessageState.NEW)) { isMessageUpdatedAsNew = true; } else { _knownMessageIds.add(msg.getId()); if (!updateResults[i]) { LOG.error("Failed to update the message {}.", msg.getMsgId()); } } } if (isMessageUpdatedAsNew) { sendNopMessage(accessor, instanceName); } }
Source:
<code>protected void setScopedObjectsField() { JClass keyWildCard = classes().KEY.narrow(codeModel().wildcard()); JClass scopedHashMap = classes().HASH_MAP.narrow(keyWildCard, classes().OBJECT); <START> getRoboGuiceHolder().scopedObjects = getGeneratedClass().field(JMod.PROTECTED, scopedHashMap, "scopedObjects" + ModelConstants.generationSuffix()); <END> getRoboGuiceHolder().scopedObjects.assign(JExpr._new(scopedHashMap)); }</code><technical_language>here. scopedObjects_ scopeObjectsImpl weird</technical_language>

Target:
protected void setScopedObjectsField() { JClass keyWildCard = classes().KEY.narrow(codeModel().wildcard()); JClass scopedHashMap = classes().HASH_MAP.narrow(keyWildCard, classes().OBJECT); getRoboGuiceHolder().scopedObjects = getGeneratedClass().field(JMod.PROTECTED, scopedHashMap, "scopedObjects" + generationSuffix()); getRoboGuiceHolder().scopedObjects.assign(JExpr._new(scopedHashMap)); }
Source:
<code>public void preProcess(ActionParameters params) throws ActionException { <START> if (!params.getUser().isAdmin()) { <END> throw new ActionDeniedException("Unauthorized"); } }</code><technical_language>ActionParameters#requireAdminUser(); move userService == null check handleGet() preProcess()</technical_language>

Target:
public void preProcess(ActionParameters params) throws ActionException { params.requireAdminUser(); if (userService == null) { throw new ActionParamsException("User service not initialized"); } }
Source:
<code>private void checkLogicalDragDrop(StructureTreeNode dragNode, StructureTreeNode dropNode) <START> throws ClassCastException { <END> IncludedStructuralElement dragStructure = (IncludedStructuralElement) dragNode.getDataObject(); IncludedStructuralElement dropStructure = (IncludedStructuralElement) dropNode.getDataObject(); StructuralElementViewInterface divisionView = dataEditor.getRuleset().getStructuralElementView( dropStructure.getType(), dataEditor.getAcquisitionStage(), dataEditor.getPriorityList()); LinkedList<IncludedStructuralElement> dragParents; if (divisionView.getAllowedSubstructuralElements().containsKey(dragStructure.getType())) { dragParents = MetadataEditor.getAncestorsOfStructure(dragStructure, dataEditor.getWorkpiece().getRootElement()); if (!dragParents.isEmpty()) { IncludedStructuralElement parentStructure = dragParents.get(dragParents.size() - 1); if (parentStructure.getChildren().contains(dragStructure)) { preserveLogical(); return; } else { Helper.setErrorMessage("Parents of structure " + dragNode.getLabel() + " do not contain structure!"); } } else { Helper.setErrorMessage("No parents of structure " + dragNode.getLabel() + " found!"); } } else { Helper.setErrorMessage(Helper.getTranslation("dataEditor.forbiddenChildElement", Arrays.asList(dragNode.getLabel(), dropNode.getLabel()))); } show(); }</code><technical_language>need define - is runtime exception</technical_language>

Target:
private void checkLogicalDragDrop(StructureTreeNode dragNode, StructureTreeNode dropNode) { IncludedStructuralElement dragStructure = (IncludedStructuralElement) dragNode.getDataObject(); IncludedStructuralElement dropStructure = (IncludedStructuralElement) dropNode.getDataObject(); StructuralElementViewInterface divisionView = dataEditor.getRuleset().getStructuralElementView( dropStructure.getType(), dataEditor.getAcquisitionStage(), dataEditor.getPriorityList()); LinkedList<IncludedStructuralElement> dragParents; if (divisionView.getAllowedSubstructuralElements().containsKey(dragStructure.getType())) { dragParents = MetadataEditor.getAncestorsOfStructure(dragStructure, dataEditor.getWorkpiece().getRootElement()); if (!dragParents.isEmpty()) { IncludedStructuralElement parentStructure = dragParents.get(dragParents.size() - 1); if (parentStructure.getChildren().contains(dragStructure)) { preserveLogical(); return; } else { Helper.setErrorMessage(Helper.getTranslation("dataEditor.childNotContainedError", Collections.singletonList(dragNode.getLabel()))); } } else { Helper.setErrorMessage(Helper.getTranslation("dataEditor.noParentsError", Collections.singletonList(dragNode.getLabel()))); } } else { Helper.setErrorMessage(Helper.getTranslation("dataEditor.forbiddenChildElement", Arrays.asList(dragNode.getLabel(), dropNode.getLabel()))); } show(); }
Source:
<code>public void testCollisionPlayerCoin() { final double oldscore = State.getScore(); final int oldcoins = State.getCoins(); <START> crashMap.collide(player,coin); <END> assertEquals(oldscore + Coin.VALUE, State.getScore(), StateTest.DELTA); assertEquals(oldcoins + 1, State.getCoins()); }</code><technical_language>Checkstyle: ',' is whitespace. <review,layout</technical_language>

Target:
public void testCollisionPlayerCoin() { final double oldscore = State.getScore(); final int oldcoins = State.getCoins(); collisionHandler.collide(player, coin); assertEquals(oldscore + Coin.VALUE, State.getScore(), StateTest.DELTA); assertEquals(oldcoins + 1, State.getCoins()); }
Source:
<code>public void test_pipe2_errno() throws Exception { try { Libcore.os.pipe2(1); fail(); } catch(ErrnoException expected) <START> <END> }</code><technical_language>needs a newline }, section 4.1.3 of style guide. (The one-line style harder blocks begin/end, is allowed)</technical_language>

Target:
public void test_pipe2_errno() throws Exception { try { Libcore.os.pipe2(-1); fail(); } catch(ErrnoException expected) { } }
Source:
<code>protected BinaryConverter<M> getConverterFor(Class<M> clazz) { <START> throw new RuntimeException("Unsupported"); <END> }</code><technical_language>UnsupportedOperationException is a fit</technical_language>

Target:
protected BinaryConverter<M> getConverterFor(Class<M> clazz) { throw new UnsupportedOperationException(); }
Source:
<code>public void shutdown(boolean flushAndCheckpoint) { if (_shutdownCompleted) { return; } _logger.info("Shutting down event producer for " + getTaskString()); _shutdownRequested = true; <START> if (_checkpointHandler != null) { <END> _checkpointHandler.shutdown(flushAndCheckpoint); } try { _transportProvider.close(); } catch (TransportException e) { _logger.warn("Closing the TransportProvider failed with exception", e); } _shutdownCompleted = true; }</code><technical_language>Do creating a NoOpCheckpointHandler sense this null possibilities null checks</technical_language>

Target:
public void shutdown(boolean flushAndCheckpoint) { if (_shutdownCompleted) { return; } _logger.info("Shutting down event producer for " + getTaskString()); _shutdownRequested = true; _checkpointHandler.ifPresent(h -> h.shutdown(flushAndCheckpoint)); try { _transportProvider.close(); } catch (TransportException e) { _logger.warn("Closing the TransportProvider failed with exception", e); } _shutdownCompleted = true; }
Source:
<code>public AnyLicenseInfo clone() { try { SpdxListedLicense retval = new SpdxListedLicense(this.getName(), this.getLicenseId(), <START> this.getLicenseText(), this.getSeeAlso(), this.getSeeAlsoDetails(), this.getComment(), <END> this.getStandardLicenseHeader(), this.getStandardLicenseTemplate(), this.getStandardLicenseHeaderTemplate(), this.isOsiApproved(), this.getFsfLibre()); retval.setDeprecated(this.isDeprecated()); return retval; } catch (InvalidSPDXAnalysisException e) { throw new AssertionError("Clone should never cause an Invalid SPDX Exception",e); } }</code><technical_language>rename xxxSeeAlsoDetails xxxCrossRef consistent</technical_language>

Target:
public AnyLicenseInfo clone() { try { SpdxListedLicense retval = new SpdxListedLicense(this.getName(), this.getLicenseId(), this.getLicenseText(), this.getSeeAlso(), this.getCrossRef(), this.getComment(), this.getStandardLicenseHeader(), this.getStandardLicenseTemplate(), this.getStandardLicenseHeaderTemplate(), this.isOsiApproved(), this.getFsfLibre()); retval.setDeprecated(this.isDeprecated()); return retval; } catch (InvalidSPDXAnalysisException e) { throw new AssertionError("Clone should never cause an Invalid SPDX Exception",e); } }
Source:
<code>public void usingGreaterThanWithNamedParameter() { <START> String queryString = "SELECT u FROM User u WHERE :age<u.age"; <END> StringQuery query = new StringQuery(queryString); softly.assertThat(query.getQueryString()).isEqualTo(queryString); softly.assertThat(query.hasParameterBindings()).isTrue(); softly.assertThat(query.getParameterBindings()).hasSize(1); softly.assertThat(query.getParameterBindings().get(0).getName()).isEqualTo("age"); softly.assertAll(); }</code><technical_language>name "greaterThan" operator is "less than"</technical_language>

Target:
public void usingGreaterThanWithNamedParameter() { String queryString = "SELECT u FROM User u WHERE :age>u.age"; StringQuery query = new StringQuery(queryString); softly.assertThat(query.getQueryString()).isEqualTo(queryString); softly.assertThat(query.hasParameterBindings()).isTrue(); softly.assertThat(query.getParameterBindings()).hasSize(1); softly.assertThat(query.getParameterBindings().get(0).getName()).isEqualTo("age"); softly.assertAll(); }
Source:
<code>public DayActivityOverviewDto<DayActivityWithBuddiesDto> getUserDayActivityOverviewWithBuddies(UUID userId, LocalDate date) { UUID userAnonymizedId = userService.getUserAnonymizedId(userId); Interval interval = Interval.createDayInterval(date); Set<BuddyDto> buddies = buddyService.getBuddiesOfUserThatAcceptedSending(userId); <START> LocalDate earliestPossibleDate = determineEarliestBuddyStatusChangeDate(buddies); <END> List<DayActivityOverviewDto<DayActivityWithBuddiesDto>> dayActivityOverviews = getUserDayActivityOverviewsWithBuddies( userAnonymizedId, earliestPossibleDate, interval, buddies); return dayActivityOverviews.get(0); }</code><technical_language>do buddies collection is empty here</technical_language>

Target:
public DayActivityOverviewDto<DayActivityWithBuddiesDto> getUserDayActivityOverviewWithBuddies(UUID userId, LocalDate date) { UUID userAnonymizedId = userService.getUserAnonymizedId(userId); Interval interval = Interval.createDayInterval(date); Set<BuddyDto> buddies = buddyService.getBuddiesOfUserThatAcceptedSending(userId); Require.that(!buddies.isEmpty(), () -> BuddyNotFoundException.userHasNoBuddies(userId)); LocalDate earliestPossibleDate = determineEarliestBuddyStatusChangeDate(buddies); List<DayActivityOverviewDto<DayActivityWithBuddiesDto>> dayActivityOverviews = getUserDayActivityOverviewsWithBuddies( userAnonymizedId, earliestPossibleDate, interval, buddies); return dayActivityOverviews.get(0); }
Source:
<code>public void testCategoryAttributeMapping() { MetacardImpl metacard = new MetacardImpl(); metacard.setAttribute(Core.TITLE, "The Title"); List<HtmlExportCategory> categoryList = new ArrayList<>(); categoryList.add(new HtmlCategoryModel("Core", coreList)); HtmlMetacardModel metacardModel = new HtmlMetacardModel(metacard, categoryList); HtmlExportCategory category = metacardModel.getCategories().get(0); <START> assertThat(category.getAttributes().get("Title").getValue(), is("The Title")); <END> }</code><technical_language>Or, assertThat(category.getAttributes(), hasEntry("Title", "The Title")) (this print a more useful message test fails)</technical_language>

Target:
public void testCategoryAttributeMapping() { MetacardImpl metacard = new MetacardImpl(); metacard.setAttribute(Core.TITLE, METACARD_TITLE); List<HtmlExportCategory> categoryList = new ArrayList<>(); categoryList.add(new HtmlCategoryModel("Core", coreList)); HtmlMetacardModel metacardModel = new HtmlMetacardModel(metacard, categoryList); HtmlExportCategory category = metacardModel.getCategories().get(0); String titleValue = category.getAttributeMappings().get("Title").getValue(); assertThat(titleValue, is(METACARD_TITLE)); }
Source:
<code>public MutableSpan(MutableSpan toCopy) { if (toCopy == null) throw new NullPointerException("toCopy == null"); traceId = toCopy.traceId; <START> parentId = toCopy.parentId; <END> id = toCopy.id; kind = toCopy.kind; flags = toCopy.flags; startTimestamp = toCopy.startTimestamp; finishTimestamp = toCopy.finishTimestamp; name = toCopy.name; localServiceName = toCopy.localServiceName; localIp = toCopy.localIp; localPort = toCopy.localPort; remoteServiceName = toCopy.remoteServiceName; remoteIp = toCopy.remoteIp; remotePort = toCopy.remotePort; tags = toCopy.tags != null ? new ArrayList<>(toCopy.tags) : null; annotations = toCopy.annotations != null ? new ArrayList<>(toCopy.annotations) : null; error = toCopy.error; }</code><technical_language>Missing localRootId</technical_language>

Target:
public MutableSpan(MutableSpan toCopy) { if (toCopy == null) throw new NullPointerException("toCopy == null"); traceId = toCopy.traceId; localRootId = toCopy.localRootId; parentId = toCopy.parentId; id = toCopy.id; kind = toCopy.kind; flags = toCopy.flags; startTimestamp = toCopy.startTimestamp; finishTimestamp = toCopy.finishTimestamp; name = toCopy.name; localServiceName = toCopy.localServiceName; localIp = toCopy.localIp; localPort = toCopy.localPort; remoteServiceName = toCopy.remoteServiceName; remoteIp = toCopy.remoteIp; remotePort = toCopy.remotePort; tags = toCopy.tags != null ? new ArrayList<>(toCopy.tags) : null; annotations = toCopy.annotations != null ? new ArrayList<>(toCopy.annotations) : null; error = toCopy.error; }
Source:
<code>public static byte[] read(InputStream is) throws IOException { int l = is.available(); byte[] buffer = new byte[l+1]; int length = 0; while ((l = is.read(buffer, length, buffer.length - length)) != -1) { length += l; if (length == buffer.length) { byte[] b = new byte[buffer.length + 4096]; System.arraycopy(buffer, 0, b, 0, length); buffer = b; } } <START> <END> return buffer; }</code><technical_language>is a bug read() remove unused bytes if buffer is large needed. fixed add this: Java if (length < buffer.length) { byte[] b = new byte[length]; System.arraycopy(buffer, 0, b, 0, length); buffer = b; }</technical_language>

Target:
public static byte[] read(InputStream is) throws IOException { int l = is.available(); byte[] buffer = new byte[l+1]; int length = 0; while ((l = is.read(buffer, length, buffer.length - length)) != -1) { length += l; if (length == buffer.length) { byte[] b = new byte[buffer.length + 4096]; System.arraycopy(buffer, 0, b, 0, length); buffer = b; } } if (length < buffer.length) { byte[] b = new byte[length]; System.arraycopy(buffer, 0, b, 0, length); buffer = b; } return buffer; }
Source:
<code>public void passesValidationForNullCardExpiry() { TelephoneChargeCreateRequest telephoneChargeCreateRequest = telephoneRequestBuilder .withCardExpiry(null) .build(); Set<ConstraintViolation<TelephoneChargeCreateRequest>> constraintViolations = validator.validate(telephoneChargeCreateRequest); <START> assertThat(constraintViolations.size(), isNumber(0)); <END> }</code><technical_language>do assertThat(constraintViolations.isEmpty(), is(true) previous test this. Thoughts</technical_language>

Target:
public void passesValidationForNullCardExpiry() { TelephoneChargeCreateRequest telephoneChargeCreateRequest = telephoneRequestBuilder .withCardExpiry(null) .build(); Set<ConstraintViolation<TelephoneChargeCreateRequest>> constraintViolations = validator.validate(telephoneChargeCreateRequest); assertThat(constraintViolations.isEmpty(), is(true)); }
Source:
<code>protected String adjustPayloadBeforeSavingResource(ResourceManager mgr, CommandContext context, File f, String payload) { if (context.getAppConfig().getExcludeFields() != null) { for(String field : context.getAppConfig().getExcludeFields()) { logger.info("Excluding property %s from payload", field); payload = payloadPropertyFilter.excludeProperty(payload, field); } } <START> if (context.getAppConfig().getIncludeFields() != null) { <END> Map<String, String> field = context.getAppConfig().getIncludeFields(); for(String key : field.keySet()) { logger.info("Adding property %s with value %s payload", key, field.get(key)); payload = payloadPropertyFilter.includeProperty(payload, key, field.get(key)); } } return payload; }</code><technical_language>I - if excludeFields includeFields set, exception thrown, is ResourceFilenameFilter does. I behavior sense a single type of resource is updated. if this is for multiple types of resources, some potential for overlap of field names. need account for this requiring a type of resource? e.g. "database:triple-index,servers:url-rewriter". annoying for common case of e.g. "I want update forests this database, I want update this database forests". So... I assume String[] works here, if of set, throw exception - i.e. mlExcludeProperties mlIncludeProperties, time</technical_language>

Target:
protected String adjustPayloadBeforeSavingResource(ResourceManager mgr, CommandContext context, File f, String payload) { if (context.getAppConfig().getExcludeProperties() != null) { String[] properties = context.getAppConfig().getExcludeProperties(); logger.info("Excluding property %s from payload", Arrays.asList(properties)); payload = payloadParser.excludeProperties(payload, properties); } if (context.getAppConfig().getIncludeProperties() != null) { String[] properties = context.getAppConfig().getIncludeProperties(); logger.info("Including property %s from payload", Arrays.asList(properties)); payload = payloadParser.includeProperties(payload, properties); } return payload; }
Source:
<code>public int hashCode() { int result = remoteViews.hashCode(); result = 31 * result + viewId; <START> return result; <END> }</code><technical_language>Inline method body line</technical_language>

Target:
@Override public int hashCode() { return 31 * remoteViews.hashCode() + viewId; }
Source:
<code><START> public void addPendingUsage(String username, PublicKeyHash writer, int size) { <END> int userId = getUserId(username); int writerId = getWriterId(writer); try (PreparedStatement insert = conn.prepareStatement(commands.insertOrIgnoreCommand("INSERT ", "INTO pendingusage (user_id, writer_id, pending_bytes) VALUES(?, ?, ?)"))) { insert.setInt(1, userId); insert.setInt(2, writerId); insert.setInt(3, 0); insert.executeUpdate(); } catch (SQLException sqe) { LOG.log(Level.WARNING, sqe.getMessage(), sqe); throw new RuntimeException(sqe); } try (PreparedStatement insert = conn.prepareStatement("UPDATE pendingusage SET pending_bytes = pending_bytes + ? " + "WHERE writer_id = ?;")) { insert.setLong(1, size); insert.setInt(2, writerId); int count = insert.executeUpdate(); if (count != 1) throw new IllegalStateException("Didn't update one record!"); } catch (SQLException sqe) { LOG.log(Level.WARNING, sqe.getMessage(), sqe); throw new RuntimeException(sqe); } }</code><technical_language>I 2 sql statments combined 1 command</technical_language>

Target:
public void addPendingUsage(String username, PublicKeyHash writer, int size) { int userId = getUserId(username); int writerId = getWriterId(writer); try (Connection conn = getNonCommittingConnection(); PreparedStatement defaultInsert = conn.prepareStatement(commands.insertOrIgnoreCommand( "INSERT ", "INTO pendingusage (user_id, writer_id, pending_bytes) VALUES(?, ?, ?)")); PreparedStatement insert = conn.prepareStatement("UPDATE pendingusage SET pending_bytes = pending_bytes + ? " + "WHERE writer_id = ?;")) { try { defaultInsert.setInt(1, userId); defaultInsert.setInt(2, writerId); defaultInsert.setInt(3, 0); defaultInsert.executeUpdate(); insert.setLong(1, size); insert.setInt(2, writerId); int count = insert.executeUpdate(); if (count != 1) throw new IllegalStateException("Didn't update one record!"); conn.commit(); } catch (SQLException e) { conn.rollback(); throw e; } } catch (SQLException sqe) { LOG.log(Level.WARNING, sqe.getMessage(), sqe); throw new RuntimeException(sqe); } }
Source:
<code>private boolean requireApiVersion(String apiVer) { <START> if (apiVer.equals(sJsApiVersion)) { <END> return true; } return false; }</code><technical_language>suggestion return apiVer.equals(sJsApiVersion);</technical_language>

Target:
private boolean requireApiVersion(String apiVer) { return apiVer.equals(sCurrentJsApiVersion); }
Source:
<code>private void parseECAction(final ECState type) throws XMLStreamException { ECAction ecAction = LibraryElementFactory.eINSTANCE.createECAction(); String algorithm = getAttributeValue(LibraryElementTags.ALGORITHM_ELEMENT); if <START> (algorithm != null) { <END> if (algorithmNameECActionMapping.containsKey(algorithm)) { algorithmNameECActionMapping.get(algorithm).add(ecAction); } else { List<ECAction> temp = new ArrayList<>(); temp.add(ecAction); algorithmNameECActionMapping.put(algorithm, temp); } } String output = getAttributeValue(LibraryElementTags.OUTPUT_ATTRIBUTE); if (output != null) { Event outp = outputEvents.get(output); if (outp != null) { ecAction.setOutput(outp); } } proceedToEndElementNamed(LibraryElementTags.ECACTION_ELEMENT); type.getECAction().add(ecAction); }</code><technical_language>order of operands</technical_language>

Target:
private void parseECAction(final ECState type) throws XMLStreamException { ECAction ecAction = LibraryElementFactory.eINSTANCE.createECAction(); String algorithm = getAttributeValue(LibraryElementTags.ALGORITHM_ELEMENT); if (null != algorithm) { if (algorithmNameECActionMapping.containsKey(algorithm)) { algorithmNameECActionMapping.get(algorithm).add(ecAction); } else { List<ECAction> temp = new ArrayList<>(); temp.add(ecAction); algorithmNameECActionMapping.put(algorithm, temp); } } String output = getAttributeValue(LibraryElementTags.OUTPUT_ATTRIBUTE); if (null != output) { Event outp = outputEvents.get(output); if (null != outp) { ecAction.setOutput(outp); } } proceedToEndElementNamed(LibraryElementTags.ECACTION_ELEMENT); type.getECAction().add(ecAction); }
Source:
<code>private KeyStore createTrustStore() throws CreateException { trustStorePassword = null == trustStorePassword ? "" : trustStorePassword; KeyStore trustStore; InputStream is = null; try { trustStore = KeyStore.getInstance(trustStoreType); <START> is = IOUtils.getResourceAsStream(trustStoreName, getClass()); <END> if (null == is) { throw new FileNotFoundException("Failed to load truststore from classpath or local file: " + trustStoreName); } trustStore.load(is, trustStorePassword.toCharArray()); } catch (Exception e) { throw new CreateException(failedToLoad("TrustStore: " + trustStoreName), e, this); } finally { if (is != null) { closeQuietly(is); } } return trustStore; }</code><technical_language>try-with-resources for this one</technical_language>

Target:
private KeyStore createTrustStore() throws CreateException { trustStorePassword = null == trustStorePassword ? "" : trustStorePassword; try (InputStream is = getResourceAsStream(trustStoreName, getClass())) { KeyStore trustStore = getInstance(trustStoreType); if (null == is) { throw new FileNotFoundException("Failed to load truststore from classpath or local file: " + trustStoreName); } trustStore.load(is, trustStorePassword.toCharArray()); return trustStore; } catch (Exception e) { throw new CreateException(failedToLoad("TrustStore: " + trustStoreName), e, this); } }
Source:
<code>public void processRequest(HashMap<String, String> paramMap) { String jobId = paramMap.get(ServerUtils.JOB_ID_KEY); String superstepId = paramMap.get(ServerUtils.SUPERSTEP_ID_KEY); if (jobId == null || superstepId == null ) { this.statusCode = HttpURLConnection.HTTP_BAD_REQUEST; <START> this.response = String.format("Invalid parameters. %s and %s are mandatory parameter.", <END> ServerUtils.JOB_ID_KEY, ServerUtils.SUPERSTEP_ID_KEY); return; } ArrayList<String> vertexIds = null; try { vertexIds = ServerUtils.getVerticesDebugged("job_201405061024_0019", 0); } catch(IOException ex) { this.statusCode = HttpURLConnection.HTTP_INTERNAL_ERROR; this.response = "Internal Server Error."; return; } this.statusCode = HttpURLConnection.HTTP_OK; this.response = new JSONArray(vertexIds).toString(); }</code><technical_language>this previous line aligned</technical_language>

Target:
public void processRequest(HashMap<String, String> paramMap) { String jobId = paramMap.get(ServerUtils.JOB_ID_KEY); String superstepId = paramMap.get(ServerUtils.SUPERSTEP_ID_KEY); try { if (jobId == null || superstepId == null) { throw new IllegalArgumentException("Missing mandatory params."); } ArrayList<String> vertexIds = null; long superstepNo = Long.parseLong(superstepId); if (superstepNo < -1) { throw new NumberFormatException("Superstep must be integer >= -1."); } vertexIds = ServerUtils.getVerticesDebugged(jobId, superstepNo); this.statusCode = HttpURLConnection.HTTP_OK; this.response = new JSONArray(vertexIds).toString(); } catch (NumberFormatException e) { this.statusCode = HttpURLConnection.HTTP_BAD_REQUEST; this.response = String.format("%s must be an integer >= -1.", ServerUtils.SUPERSTEP_ID_KEY); } catch (IllegalArgumentException e) { this.statusCode = HttpURLConnection.HTTP_BAD_REQUEST; this.response = String.format("Invalid parameters. %s and %s are mandatory parameter.", ServerUtils.JOB_ID_KEY, ServerUtils.SUPERSTEP_ID_KEY); } catch (IOException e) { this.statusCode = HttpURLConnection.HTTP_INTERNAL_ERROR; this.response = "Internal Server Error."; } }
Source:
<code>public void testUpdate() throws Exception { server.enqueue(jsonResponse("/storageaccountupdate.json")); final StorageAccountApi storageAPI = api.getStorageAccountApi(resourceGroup); StorageServiceUpdateParams.StorageServiceUpdateProperties props = StorageServiceUpdateParams.StorageServiceUpdateProperties.create(null, null, null, null, null, null, null, null, null); final StorageServiceUpdateParams params = storageAPI.update("TESTSTORAGE", props, ImmutableMap.of("another_property_name", "another_property_value")); assertTrue(params.tags().containsKey("another_property_name")); assertSent(server, "PATCH", "/subscriptions/" + subsriptionId + "/resourcegroups/" + resourceGroup + <START> "/providers/Microsoft.Storage/storageAccounts/TESTSTORAGE?api-version=2015-06-15"); <END> }</code><technical_language>Add body check</technical_language>

Target:
public void testUpdate() throws Exception { server.enqueue(jsonResponse("/storageaccountupdate.json")); final StorageAccountApi storageAPI = api.getStorageAccountApi(resourceGroup); StorageServiceUpdateParams.StorageServiceUpdateProperties props = StorageServiceUpdateParams.StorageServiceUpdateProperties.create(StorageService.AccountType.Standard_LRS); final StorageServiceUpdateParams params = storageAPI.update("TESTSTORAGE", ImmutableMap.of("another_property_name", "another_property_value"), props); assertTrue(params.tags().containsKey("another_property_name")); assertSent(server, "PATCH", "/subscriptions/" + subsriptionId + "/resourcegroups/" + resourceGroup + "/providers/Microsoft.Storage/storageAccounts/TESTSTORAGE?api-version=2015-06-15", String.format("{\"properties\":{ \"accountType\": \"Standard_LRS\" },\"tags\":{\"another_property_name\":\"another_property_value\"}}")); }
Source:
<code>public static boolean isBinary(InputStream raw) throws IOException { final byte[] buffer = new byte[FIRST_FEW_BYTES]; <START> final int read = raw.read(buffer, 0, buffer.length); <END> return isBinary(buffer, read); }</code><technical_language>This return a short read. a loop try get full buffer length EOF enter isBinary logic</technical_language>

Target:
public static boolean isBinary(InputStream raw) throws IOException { final byte[] buffer = new byte[FIRST_FEW_BYTES]; int cnt = 0; while (cnt < buffer.length) { final int read = raw.read(buffer, cnt, buffer.length - cnt); if (read == -1) break; cnt += read; } return isBinary(buffer, cnt); }
Source:
<code>public void onResponse(Map<String, Object> response) { infoReturn.eval(); proceedProxyReturnValue(); VdsBrokerObjectsBuilder.updateVDSDynamicData(getVds(), infoReturn.info); setReturnValue(getVds()); <START> if (getParameters().getCallback() != null) { <END> getParameters().getCallback().onResponse(Collections.singletonMap("result", getVDSReturnValue())); } }</code><technical_language>do need care callback here</technical_language>

Target:
public void onResponse(Map<String, Object> response) { handleResponse(); getParameters().getCallback().onResponse(Collections.singletonMap("result", getVDSReturnValue())); }
Source:
<code>public void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.activity_main); ButterKnife.bind(this); new PrerequisitesChecker(this).execute(); userModel.initialize(this); locationUpdatesService.initialize(getApplication()); startSyncService(); drawerNavigation.setNavigationItemSelectedListener(this); setSupportActionBar(toolbar); <START> ActionBarDrawerToggle mDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.open, R.string.close); <END> drawerLayout.setDrawerListener(mDrawerToggle); mDrawerToggle.syncState(); navigateTo(R.id.navigation_map); }</code><technical_language>strings for accessibility especially close string sense here. I suggest "open drawer" "close drawer"</technical_language>

Target:
public void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.activity_main); ButterKnife.bind(this); new PrerequisitesChecker(this).execute(); userModel.initialize(this); locationUpdatesService.initialize(getApplication()); startSyncService(); }
Source:
<code>public ResponseEntity<String> getApplicants() { resultList = applicantService.getApplicants(); <START> String result = jsonUtil.toJson(resultList); <END> return new ResponseEntity<>(result, HttpStatus.OK); }</code><technical_language>time starting Spring build-in json converter</technical_language>

Target:
public ResponseEntity<List<Applicant>> getApplicants() { List<Applicant> resultList = applicantService.getApplicants(); if(resultList.isEmpty() || resultList == null){ return new ResponseEntity<>(resultList, HttpStatus.BAD_REQUEST); } return new ResponseEntity<>(resultList, HttpStatus.OK); }
Source:
<code>public void testNUllVmElementForFloatingDisk() { List<DiskVmElement> allDves = dao.getAll(); <START> assertTrue(allDves.stream().filter(dve -> dve.getDiskId().equals(FixturesTool.FLOATING_DISK_ID)).collect( Collectors.toList()).isEmpty()); <END> }</code><technical_language>need collect it: assertTrue(allDevs.stream().noneMatch(dve -> dve.getDiskId().equals(FixturesTool.FLOATING_DISK_ID)</technical_language>

Target:
public void testNUllVmElementForFloatingDisk() { List<DiskVmElement> allDves = dao.getAll(); assertTrue(allDves.stream().noneMatch(dve -> dve.getDiskId().equals(FixturesTool.FLOATING_DISK_ID))); }
Source:
<code>public HelloWorldServlet(@PluginName String pluginName, @PluginCanonicalWebUrl String url) { <START> log.info("Cookbook Plugin '" + pluginName + "' at url " + url + ""); <END> }</code><technical_language>String.format()</technical_language>

Target:
public HelloWorldServlet(@PluginName String pluginName, @PluginCanonicalWebUrl String url) { log.info(String.format("Cookbook Plugin '%' at url %s", pluginName, url)); }
Source:
<code>private static String getServerUrl() { return System.getProperty(PLUGIN_ID + "." + PROP_SERVER_CONFIGURATION_URL, <START> "<LINK_0>"); <END> }</code><technical_language>field name</technical_language>

Target:
private static String getServerUrl() { return System.getProperty(PLUGIN_ID + "." + PROP_SERVER, "<LINK_0>"); }
Source:
<code><START> public TmfTimeRange getCurrentRange() { <END> return getCurrentTraceContext().getTimerange(); }</code><technical_language>Add synchronized this method</technical_language>

Target:
public synchronized TmfTimeRange getCurrentRange() { return getCurrentTraceContext().getTimerange(); }
Source:
<code>@Override protected void afterTest() throws Exception { super.afterTest(); <START> for (Ignite g : G.allGrids()) <END> g.cache(DEFAULT_CACHE_NAME).removeAll(); }</code><technical_language>is enough clear caches node, loop is needed here</technical_language>

Target:
@Override protected void afterTest() throws Exception { super.afterTest(); grid(0).cache(DEFAULT_CACHE_NAME).removeAll(); }