auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private void startSleepyThread(){ <END> Thread sleepyThread = new Thread(new Runnable() { private static final long SOME_POINTLESS_AMOUNT_OF_TIME = 50; @Override public void run() { sleepyMethod(SOME_POINTLESS_AMOUNT_OF_TIME); } @DebugLog private void sleepyMethod(long milliseconds){ try { Thread.sleep(milliseconds); } catch (InterruptedException e) { e.printStackTrace(); } } }); sleepyThread.setName("I'm a lazy thr.. bah! whatever!"); sleepyThread.start(); }</code><technical_language>nit: space {</technical_language>

Target:
private void startSleepyThread() { Thread sleepyThread = new Thread(new Runnable() { private static final long SOME_POINTLESS_AMOUNT_OF_TIME = 50; @Override public void run() { sleepyMethod(SOME_POINTLESS_AMOUNT_OF_TIME); } @DebugLog private void sleepyMethod(long milliseconds) { SystemClock.sleep(milliseconds); } }, "I'm a lazy thr.. bah! whatever!").start(); }
Source:
<code>public abstract boolean isDirectory() throws IOException; public abstract boolean isFile() throws IOException; public abstract boolean exists() throws IOException; public abstract @Nonnull VirtualFile[] list() throws IOException; public abstract @Nonnull String[] list(String glob) throws IOException; public abstract @Nonnull VirtualFile child(@Nonnull String name); public abstract long length() throws IOException; public abstract String date() throws IOException; <START> public static final String DateFormat = "MM/dd/yyyy h:mm:ss a"; <END> public abstract long lastModified() throws IOException; public abstract boolean canRead() throws IOException; public abstract InputStream open() throws IOException; @Override public final int compareTo(VirtualFile o) { return getName().compareToIgnoreCase(o.getName()); }</code><technical_language>localized. mechanism other dates UI</technical_language>

Target:
public abstract boolean isDirectory() throws IOException; public abstract boolean isFile() throws IOException; public abstract boolean exists() throws IOException; public abstract @Nonnull VirtualFile[] list() throws IOException; public abstract @Nonnull String[] list(String glob) throws IOException; public abstract @Nonnull VirtualFile child(@Nonnull String name); public abstract long length() throws IOException; public abstract long lastModified() throws IOException; public abstract boolean canRead() throws IOException; public abstract InputStream open() throws IOException; @Override public final int compareTo(VirtualFile o) { return getName().compareToIgnoreCase(o.getName()); }
Source:
<code>public void testScenarios() throws IOException, DockerCertificateException { <START> String testResourcesPath = getClass().getClassLoader().getResource(".").getPath(); <END> TestScenariosFinder testScenariosFinder = new TestScenariosFinder(testResourcesPath); List<TestScenario> testScenarios = testScenariosFinder.getScenarios(); TestScenarioRunner caseRunner = new TestScenarioRunner(ProjectVersion.currentVersion(), 9080); int successfulScenarios = 0; int failedScenarios = 0; for (TestScenario testScenario: testScenarios) { if (testScenario.enabledTests() == 0) { continue; } int successfulTestCases = caseRunner.run(testScenario); if (successfulTestCases == testScenario.enabledTests()) { System.out.println("\nScenario success: " + testScenario + "\n"); System.out.println("Number of successful test cases: " + successfulTestCases); successfulScenarios++; } else { System.out.println("\nScenario failed: " + testScenario + "\n"); System.out.println("Number of failed test cases: " + (testScenario.enabledTests() - successfulTestCases)); failedScenarios++; } } System.out.println("\n\nScenarios results:\nSuccessful: " + successfulScenarios + ", Failed: " + failedScenarios + "\n\n"); }</code><technical_language>I this is a system property, exposed maven. reliable this technique is :)</technical_language>

Target:
public void testScenarios() throws IOException { String testResourcesPath = getClass().getClassLoader().getResource(".").getPath(); TestScenariosFinder testScenariosFinder = new TestScenariosFinder(testResourcesPath); List<TestScenario> testScenarios = testScenariosFinder.getScenarios(); TestScenarioRunner caseRunner = new TestScenarioRunner(9080); int successfulScenarios = 0; int failedScenarios = 0; for (TestScenario testScenario: testScenarios) { if (testScenario.enabledTests() == 0) { continue; } int successfulTestCases = 0; try { successfulTestCases = caseRunner.run(testScenario); } catch (Throwable throwable) { throwable.printStackTrace(); System.out.print("Exception while running test scenario: " + testScenario); } if (successfulTestCases == testScenario.enabledTests()) { System.out.println("\nScenario success: " + testScenario + "\n"); System.out.println("Number of successful test cases: " + successfulTestCases); successfulScenarios++; } else { System.out.println("\nScenario failed: " + testScenario + "\n"); System.out.println("Number of failed test cases: " + (testScenario.enabledTests() - successfulTestCases)); failedScenarios++; } } System.out.println("\n\nScenarios results:\nSuccessful: " + successfulScenarios + ", Failed: " + failedScenarios + "\n\n"); }
Source:
<code>public Iterator<ModifiableRealmIdentity> getRealmIdentityIterator() throws RealmUnavailableException { if (identityMapping.iteratorFilter == null) { throw log.ldapRealmNotConfiguredToSupportIteratingOverIdentities(); } log.debugf("Trying to iterate over identities."); DirContext context = null; NamingEnumeration<SearchResult> result; try { context = dirContextFactory.obtainDirContext(null); result = context.search(identityMapping.searchDn, identityMapping.iteratorFilter, identityMapping.iteratorFilterArgs, createSearchControls(identityMapping.rdnIdentifier)); } catch (NamingException e) { throw log.ldapRealmIdentitySearchFailed(e); } finally { <START> dirContextFactory.returnContext(context); <END> } return new Iterator<ModifiableRealmIdentity>() { public boolean hasNext() { try { return result.hasMore(); } catch (NamingException e) { throw log.ldapRealmIdentitySearchFailed(e); } } public ModifiableRealmIdentity next() { try { SearchResult entry = result.next(); String name = (String) entry.getAttributes().get(identityMapping.rdnIdentifier).get(); return getRealmIdentityForUpdate(name, null, null); } catch (NamingException e) { throw log.ldapRealmIdentitySearchFailed(e); } } }; }</code><technical_language>Is this Ok context is returned working results? results eagerly loaded</technical_language>

Target:
public Iterator<ModifiableRealmIdentity> getRealmIdentityIterator() throws RealmUnavailableException { if (identityMapping.iteratorFilter == null) { throw log.ldapRealmNotConfiguredToSupportIteratingOverIdentities(); } log.debugf("Trying to iterate over identities."); DirContext context = null; List<ModifiableRealmIdentity> identifiers = new LinkedList<>(); try { context = dirContextFactory.obtainDirContext(null); } catch (NamingException e) { throw log.ldapRealmIdentitySearchFailed(e); } try { NamingEnumeration<SearchResult> result = context.search(identityMapping.searchDn, identityMapping.iteratorFilter, identityMapping.iteratorFilterArgs, createSearchControls(identityMapping.rdnIdentifier)); try { while (result.hasMore()) { SearchResult entry = result.next(); String name = (String) entry.getAttributes().get(identityMapping.rdnIdentifier).get(); identifiers.add(getRealmIdentityForUpdate(name, null, null)); } } finally { result.close(); } } catch (NamingException e) { throw log.ldapRealmIdentitySearchFailed(e); } finally { dirContextFactory.returnContext(context); } return identifiers.iterator(); }
Source:
<code>public GenericArtifactManager(Registry registry, String key) throws RegistryException { try { GovernanceArtifactConfiguration configuration = GovernanceUtils.findGovernanceArtifactConfiguration(key, registry); if (configuration != null) { this.artifactNameAttribute = configuration.getArtifactNameAttribute(); this.artifactNamespaceAttribute = configuration.getArtifactNamespaceAttribute(); this.artifactElementNamespace = configuration.getArtifactElementNamespace(); manager = new GovernanceArtifactManager(registry, configuration.getMediaType(), this.artifactNameAttribute, this.artifactNamespaceAttribute, configuration.getArtifactElementRoot(), this.artifactElementNamespace, configuration.getPathExpression(), configuration.getLifecycle(), configuration.getValidationAttributes(), configuration.getRelationshipDefinitions()); this.mediaType = configuration.getMediaType(); } else { String message = "Artifact type '" + key + "' is not in registry or unable to find relevant " + "configuration."; log.error(message); <START> throw new RegistryException(message); <END> } } catch (RegistryException e) { String message = "Unable to obtain governance artifact configuration."; log.error(message, e); throw new RegistryException(message, e); } }</code><technical_language>Need throw GovernanceException instead of RegistryException</technical_language>

Target:
public GenericArtifactManager(Registry registry, String key) throws RegistryException { try { GovernanceArtifactConfiguration configuration = GovernanceUtils.findGovernanceArtifactConfiguration(key, registry); this.artifactNameAttribute = configuration.getArtifactNameAttribute(); this.artifactNamespaceAttribute = configuration.getArtifactNamespaceAttribute(); this.artifactElementNamespace = configuration.getArtifactElementNamespace(); manager = new GovernanceArtifactManager(registry, configuration.getMediaType(), this.artifactNameAttribute, this.artifactNamespaceAttribute, configuration.getArtifactElementRoot(), this.artifactElementNamespace, configuration.getPathExpression(), configuration.getLifecycle(), configuration.getValidationAttributes(), configuration.getRelationshipDefinitions()); this.mediaType = configuration.getMediaType(); } catch (RegistryException e) { throw new GovernanceException("Unable to obtain governance artifact configuration", e); } }
Source:
<code>public void delete(K key) { Preconditions.checkNotNull(rwTable, "Cannot delete from a read-only table: " + rdTable); locker.computeIfAbsent(key, (k) -> { <START> cache.delete(key); <END> rwTable.delete(key); return null; }); }</code><technical_language>Swap order</technical_language>

Target:
public void delete(K key) { Preconditions.checkNotNull(rwTable, "Cannot delete from a read-only table: " + rdTable); atomicDelete(key); }
Source:
<code>protected String updateACHAccountIfNecessary(Person payee, PayeeACHAccountExtractDetail achDetail, PayeeACHAccount achAccount) { StringBuilder processingResults = new StringBuilder(); if (accountHasChanged(achDetail, achAccount)) { PayeeACHData achData = new PayeeACHData(payee, achDetail, achAccount.getPayeeIdentifierTypeCode(), achAccount); String accountUpdateErrors = createAndRoutePayeeACHAccountDocument(achData, this::setupDocumentForACHUpdate); processingResults.append(accountUpdateErrors); } else { <START> LOG.info("Input file's account information for payee of type '" + achAccount.getPayeeIdentifierTypeCode() <END> + "' matches what is already in KFS; no updates will be made for this entry."); } if (processingResults.length() > 0) { processingResults.append(" Update was NOT performed."); LOG.warn("updateACHAccountIfNecessary: " + processingResults.toString()); } return processingResults.toString(); }</code><technical_language>Missing method name</technical_language>

Target:
protected String updateACHAccountIfNecessary(Person payee, PayeeACHAccountExtractDetail achDetail, PayeeACHAccount achAccount) { StringBuilder processingResults = new StringBuilder(); if (accountHasChanged(achDetail, achAccount)) { PayeeACHData achData = new PayeeACHData(payee, achDetail, achAccount.getPayeeIdentifierTypeCode(), achAccount); String accountUpdateErrors = createAndRoutePayeeACHAccountDocument(achData, this::setupDocumentForACHUpdate); processingResults.append(accountUpdateErrors); } else { LOG.info("updateACHAccountIfNecessary: Input file's account information for payee of type '" + achAccount.getPayeeIdentifierTypeCode() + "' matches what is already in KFS; no updates will be made for this entry."); } if (processingResults.length() > 0) { processingResults.append(" Update was NOT performed."); LOG.warn("updateACHAccountIfNecessary: " + processingResults.toString()); } return processingResults.toString(); }
Source:
<code>protected StatsDMessage(String aspect, Message.Type type, T value, double sampleRate, String[] tags) { <START> super(aspect, type, value); <END> this.sampleRate = sampleRate; this.tags = tags; }</code><technical_language>tags included in aspect, ? hash metrics in aggregator</technical_language>

Target:
protected StatsDMessage(String aspect, Message.Type type, T value, double sampleRate, String[] tags) { super(aspect, type, value, tags); this.sampleRate = sampleRate; }
Source:
<code>public NavigableMap<byte[], List<Cell>> getFamilyCellMap() { if (action instanceof Mutation) { return ((Mutation) action).getFamilyCellMap(); <START> } else { <END> throw new UnsupportedOperationException(); } }</code><technical_language>nit: drop else this if (..) { ...} throw new .</technical_language>

Target:
public NavigableMap<byte[], List<Cell>> getFamilyCellMap() { if (action instanceof Mutation) { return ((Mutation) action).getFamilyCellMap(); } throw new UnsupportedOperationException(); }
Source:
<code>public boolean isSynchronized() { <START> if (getResource().isAccessible()) { <END> return super.isSynchronized(); } return path.toFile().lastModified() == timestamp; }</code><technical_language>do need this ? type a non-workspace typed element ... assume instances resources of super-class type</technical_language>

Target:
public boolean isSynchronized() { return path.toFile().lastModified() == timestamp; }
Source:
<code>public void shouldGetDiagnoses() { Encounter encounter = new Encounter(3); <START> List<Diagnosis> firstDiagnoses= diagnosisDAO.getDiagnoses(encounter); <END> assertEquals(2, firstDiagnoses.size()); Encounter otherEncounter = new Encounter(9); List<Diagnosis> secondDiagnoses= diagnosisDAO.getDiagnoses(otherEncounter); assertEquals(0, secondDiagnoses.size()); }</code><technical_language>patient voided diagnoses this test more solid</technical_language>

Target:
public void shouldGetDiagnoses() { assertEquals(2, diagnosisDAO.getDiagnoses(new Encounter(3)).size()); assertEquals(0, diagnosisDAO.getDiagnoses(new Encounter(9)).size()); }
Source:
<code>private boolean validateHostsConnectionResults(List<Pair<Guid, Boolean>> hostsConnectionResults) { for (Pair<Guid, Boolean> hostsConnectionResult : hostsConnectionResults) { <START> if (hostsConnectionResult.getSecond() == true) { <END> return true; } } return false; }</code><technical_language>need "== true", a boolean :-)</technical_language>

Target:
private boolean validateHostsConnectionResults(List<Pair<Guid, Boolean>> hostsConnectionResults) { for (Pair<Guid, Boolean> hostsConnectionResult : hostsConnectionResults) { if (hostsConnectionResult.getSecond()) { return true; } } return false; }
Source:
<code>public void testEditWhenHeaderCellSelected() { final GridColumn.HeaderMetaData headerMetaData = mock(GridColumn.HeaderMetaData.class); final GridColumn<?> gridColumn = mockGridColumn(100.0, Arrays.asList(headerMetaData)); doReturn(ci).when(gridRendererHelper).getColumnInformation(50.0); doReturn(gridColumn).when(ci).getColumn(); doReturn(0.0).when(ci).getOffsetX(); doReturn(0).when(ci).getUiColumnIndex(); gridWidget.getModel().appendColumn(gridColumn); gridWidget.getModel().selectHeaderCell(0, 0); CellContextUtilities.editSelectedCell(gridWidget); <START> verify(headerMetaData).edit(any(GridBodyCellEditContext.class)); <END> verify(gridWidget, never()).startEditingCell(anyInt(), anyInt()); verify(gridWidget, never()).startEditingCell(any(Point2D.class)); }</code><technical_language>_nice_ assert values of GridBodyCellEditContext a test is test :-)</technical_language>

Target:
public void testEditWhenHeaderCellSelected() { final GridColumn.HeaderMetaData headerMetaDataC1 = mock(GridColumn.HeaderMetaData.class); final GridColumn.HeaderMetaData headerMetaDataC2 = mock(GridColumn.HeaderMetaData.class); final GridColumn<?> gridColumnOne = mockGridColumn(100.0, Arrays.asList(headerMetaDataC1)); final GridColumn<?> gridColumnTwo = mockGridColumn(100.0, Arrays.asList(headerMetaDataC2)); doReturn(0).when(gridColumnOne).getIndex(); doReturn(1).when(gridColumnTwo).getIndex(); final double secondColumnXCoordinate = gridColumnOne.getWidth() + gridColumnTwo.getWidth() / 2; doReturn(ci).when(gridRendererHelper).getColumnInformation(secondColumnXCoordinate); doReturn(gridColumnOne.getWidth()).when(gridRendererHelper).getColumnOffset(gridColumnTwo); doReturn(gridColumnTwo).when(ci).getColumn(); doReturn(0.0).when(ci).getOffsetX(); doReturn(1).when(ci).getUiColumnIndex(); doReturn(Arrays.asList(gridColumnOne, gridColumnTwo)).when(ri).getAllColumns(); gridWidget.getModel().appendColumn(gridColumnOne); gridWidget.getModel().appendColumn(gridColumnTwo); gridWidget.getModel().selectHeaderCell(0, 1); CellContextUtilities.editSelectedCell(gridWidget); verify(headerMetaDataC1, never()).edit(any(GridBodyCellEditContext.class)); verify(headerMetaDataC2).edit(gridBodyCellEditContextCaptor.capture()); final GridBodyCellEditContext gridBodyCellEditContext = gridBodyCellEditContextCaptor.getValue(); assertThat(gridBodyCellEditContext) .hasFieldOrPropertyWithValue("columnIndex", 1) .hasFieldOrPropertyWithValue("rowIndex", 0); verify(gridWidget, never()).startEditingCell(anyInt(), anyInt()); verify(gridWidget, never()).startEditingCell(any(Point2D.class)); }
Source:
<code><START> public <T> Object create(Class<T> cls) { <END> final AnnotatedType<T> annotatedType = beanManager.createAnnotatedType(cls); final InjectionTargetFactory<T> injectionTargetFactory = beanManager.getInjectionTargetFactory(annotatedType); final BeanAttributes<T> attributes = beanManager.createBeanAttributes(annotatedType); final Bean<T> bean = beanManager.createBean(attributes, cls, injectionTargetFactory); final CreationalContext<?> context = beanManager.createCreationalContext(bean); return beanManager.getReference(bean, cls, context); }</code><technical_language>client close() - worse case - that. if beanManager.isNormalScope(bean.getScope()) is true need call context.release()</technical_language>

Target:
public <T> Object create(Class<T> cls) { final AnnotatedType<T> annotatedType = beanManager.createAnnotatedType(cls); final InjectionTargetFactory<T> injectionTargetFactory = beanManager.getInjectionTargetFactory(annotatedType); final BeanAttributes<T> attributes = beanManager.createBeanAttributes(annotatedType); final Bean<T> bean = beanManager.createBean(attributes, cls, injectionTargetFactory); final CreationalContext<?> context = beanManager.createCreationalContext(bean); if (!beanManager.isNormalScope(bean.getScope())) { beanManager.fireEvent(new DisposableCreationalContext(context)); } return beanManager.getReference(bean, cls, context); }
Source:
<code>private void removeUserRemovedNetworkAttachments(List<NetworkAttachment> existingNetworkAttachments) { for (Guid attachmentId : userRemovedNetworkAttachments) { networkAttachmentDao.remove(attachmentId); } for (Iterator<NetworkAttachment> iterator = existingNetworkAttachments.iterator(); iterator.hasNext();) { Guid networkAttachmentId = iterator.next().getId(); if <START> (networkAttachmentId != null && <END> userRemovedNetworkAttachments.contains(networkAttachmentId)) { iterator.remove(); break; } } }</code><technical_language>existing network attachments (returned db) id set</technical_language>

Target:
private void removeUserRemovedNetworkAttachments(List<NetworkAttachment> existingNetworkAttachments) { for (Guid attachmentId : userRemovedNetworkAttachments) { networkAttachmentDao.remove(attachmentId); } for (Iterator<NetworkAttachment> iterator = existingNetworkAttachments.iterator(); iterator.hasNext();) { Guid networkAttachmentId = iterator.next().getId(); if (userRemovedNetworkAttachments.contains(networkAttachmentId)) { iterator.remove(); } } }
Source:
<code>public void onBackStackChanged() { ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { <START> actionBar.setDisplayHomeAsUpEnabled(getSupportFragmentManager().getBackStackEntryCount() > 0); <END> } }</code><technical_language>0 > 1 then</technical_language>

Target:
public void onBackStackChanged() { this.updateUpButtonVisibility(); }
Source:
<code>public long rangeSelectivity(DataValueDescriptor start,DataValueDescriptor stop, boolean includeStart,boolean includeStop,boolean useExtrapolation) { if ((start == null || start.isNull()) && (stop == null || stop.isNull())) return nullCount; if (start.equals(stop)) return rpv; <START> return (long)(0.1 * totalCount); <END> }</code><technical_language>Is this a default estimation some other location? If so, a static constant if place updated, this place</technical_language>

Target:
public long rangeSelectivity(DataValueDescriptor start,DataValueDescriptor stop, boolean includeStart,boolean includeStop,boolean useExtrapolation) { if ((start == null || start.isNull()) && (stop == null || stop.isNull())) return nullCount; if (start.equals(stop)) return rpv; return (long)(DEFAULT_RANGE_SELECTIVITY * totalCount); }
Source:
<code>protected void executeCommand() { updateQuotaCache(); <START> if (_oldStoragePool.getStatus() == StoragePoolStatus.Up && getMasterDomain() != null) { <END> if (!StringUtils.equals(_oldStoragePool.getName(), getStoragePool().getName())) { runVdsCommand(VDSCommandType.SetStoragePoolDescription, new SetStoragePoolDescriptionVDSCommandParameters( getStoragePool().getId(), getStoragePool().getName()) ); } } copyUnchangedStoragePoolProperties(getStoragePool(), _oldStoragePool); getStoragePoolDAO().updatePartial(getStoragePool()); updateStoragePoolFormatType(); setSucceeded(true); }</code><technical_language>this is unrelated bug fix. in a separate patch</technical_language>

Target:
protected void executeCommand() { updateQuotaCache(); if (_oldStoragePool.getStatus() == StoragePoolStatus.Up) { if (!StringUtils.equals(_oldStoragePool.getName(), getStoragePool().getName())) { runVdsCommand(VDSCommandType.SetStoragePoolDescription, new SetStoragePoolDescriptionVDSCommandParameters( getStoragePool().getId(), getStoragePool().getName()) ); } } copyUnchangedStoragePoolProperties(getStoragePool(), _oldStoragePool); getStoragePoolDAO().updatePartial(getStoragePool()); updateStoragePoolFormatType(); setSucceeded(true); }
Source:
<code>public void onRequestStarted(Map<Object, Object> ephemeralProperties) { if (ephemeralProperties.get(REQUEST_RECEIVED_MILLIS_KEY) != null) { long started = (long) ephemeralProperties.get(REQUEST_RECEIVED_MILLIS_KEY); <START> long duration = System.currentTimeMillis() - started; <END> if (duration > highWatermark) { LOGGER.warn(String.format( "request spent %d ms in the transport buffer, your consumer might be backed up", duration)); } } }</code><technical_language>this clock</technical_language>

Target:
public void onRequestStarted(Map<Object, Object> ephemeralProperties) { if (ephemeralProperties.get(REQUEST_RECEIVED_MILLIS_KEY) != null) { long started = (long) ephemeralProperties.get(REQUEST_RECEIVED_MILLIS_KEY); long duration = clock.millis() - started; if (duration > highWatermark) { LOGGER.warn(String.format( "request spent %d ms in the transport buffer, your consumer might be backed up", duration)); } } }
Source:
<code><START> public Histogram aggregateHistogram() { <END> Histogram aggregate = AGGREGATE_HISTOGRAM.get(); aggregate.reset(); aggregate.add(histogramAtomicReference.get()); synchronized (this) { histogramQueue .forEach(aggregate::add); } return aggregate; }</code><technical_language>concurrent, done poller, do need threadlocal isolation of aggregation? Synchronized aggregation simpler efficient? Also, synchronizing additions aggregate</technical_language>

Target:
public Histogram aggregateHistogram() { Histogram aggregate = createHistogram(); synchronized (LOCK) { aggregate.add(liveHistogram); histogramQueue .forEach(aggregate::add); } return aggregate; }
Source:
<code>public ModelAndView getGroupUsers(@PathVariable("groupId") Long groupId) throws org.jtalks.common.service.exceptions.NotFoundException { checkForAdminPermissions(); <START> GroupDto groupDto = new GroupDto(groupId, groupService.get(groupId).getName(), groupService.getGroupUsers(groupId, 4)); <END> return new ModelAndView("groupUserList").addObject("group", groupDto); }</code><technical_language>4</technical_language>

Target:
public ModelAndView getGroupUsers(@PathVariable("groupId") Long groupId) throws org.jtalks.common.service.exceptions.NotFoundException { checkForAdminPermissions(); GroupDto groupDto = new GroupDto(groupId, groupService.get(groupId).getName(), groupService.getGroupUsers(groupId, 20)); return new ModelAndView("groupUserList").addObject("group", groupDto); }
Source:
<code>public void testPutIfAbsent() throws Exception{ String fileID = store.get(file1); assertNull(fileID); fileID = store.putIfAbsent(file1, file1Id); assertNull(fileID); <START> fileID = store.putIfAbsent(file1, file1Id); <END> assertNotNull(fileID); assertEquals(file1Id, fileID); }</code><technical_language>putIfAbsent for get putIfAbsent changed in collection</technical_language>

Target:
public void testPutIfAbsent() throws Exception { String fileID = store.get(file1); assertNull("Get First time, Key doesnt exists", fileID); fileID = store.putIfAbsent(file1, file1Id); assertNull("Insert First time, Key insertion successful", fileID); fileID = store.putIfAbsent(file1, "56789"); assertNotNull("Key Already Exists - Insertion Failed, for different value", fileID); assertEquals("Retrieving the Old Value", file1Id, fileID); assertEquals("Retrieving the Old Value", file1Id, store.get(file1)); }
Source:
<code>public ChannelFuture writeOneInbound(Object msg, ChannelPromise promise) { if (checkOpen(true)) { if (!config().isAutoRead()) { tempInboundMessages().add(msg); } else { pipeline().fireChannelRead(msg); } } <START> return checkException(promise); <END> }</code><technical_language>is this correct ? Dont need drain inbound messages ensure preserve correct order</technical_language>

Target:
public ChannelFuture writeOneInbound(Object msg, ChannelPromise promise) { if (checkOpen(true)) { if (!config().isAutoRead()) { Queue<AbstractMap.SimpleEntry<Object, ChannelPromise>> tempInboundMessages = tempInboundMessages(); tempInboundMessages.add(new AbstractMap.SimpleEntry<Object, ChannelPromise>(msg, promise)); return promise; } else { pipeline().fireChannelRead(msg); } } return checkException(promise); }
Source:
<code>public void testUpdate() throws Exception { int count = handle.createStatement("INSERT INTO user(id, name) VALUES(:id, :name)") .bind("id", 3) .bind("name", "Charlie") .execute(); <START> assertThat(count, is(1)); <END> }</code><technical_language>Ditto: assertThat(count).isEqualTo(1);</technical_language>

Target:
public void testUpdate() throws Exception { int count = handle.createUpdate("INSERT INTO user(id, name) VALUES(:id, :name)") .bind("id", 3) .bind("name", "Charlie") .execute(); assertThat(count).isEqualTo(1); }
Source:
<code>private List<Facet> updateStringFacets(JsonObject aggregations, DiscreteFacetRequest facetRequest) { JsonElement aggregation = aggregations.get( facetRequest.getFacetingName() ); if ( aggregation == null ) { return Collections.emptyList(); } <START> if ( facetRequest.getFieldName().contains( "." ) ) { <END> aggregation = aggregation.getAsJsonObject().get( facetRequest.getFacetingName() ); } if ( aggregation == null ) { return Collections.emptyList(); } ArrayList<Facet> facets = new ArrayList<>(); for ( JsonElement bucket : aggregation.getAsJsonObject().get( "buckets" ).getAsJsonArray() ) { facets.add( facetRequest.createFacet( bucket.getAsJsonObject().get( "key" ).getAsString(), bucket.getAsJsonObject().get( "doc_count" ).getAsInt() ) ); } return facets; }</code><technical_language>"." configured else user I learned. This resolved meta-data</technical_language>

Target:
private List<Facet> updateStringFacets(JsonObject aggregations, DiscreteFacetRequest facetRequest) { JsonElement aggregation = aggregations.get( facetRequest.getFacetingName() ); if ( aggregation == null ) { return Collections.emptyList(); } if ( FieldHelper.isEmbeddedField( facetRequest.getFieldName() ) ) { aggregation = aggregation.getAsJsonObject().get( facetRequest.getFacetingName() ); } if ( aggregation == null ) { return Collections.emptyList(); } ArrayList<Facet> facets = new ArrayList<>(); for ( JsonElement bucket : aggregation.getAsJsonObject().get( "buckets" ).getAsJsonArray() ) { facets.add( facetRequest.createFacet( bucket.getAsJsonObject().get( "key" ).getAsString(), bucket.getAsJsonObject().get( "doc_count" ).getAsInt() ) ); } return facets; }
Source:
<code>private boolean hasStoragePermissions() { int permission = ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE); Log.i("Glucosio", "Storage permissions granted."); <START> if (permission != PackageManager.PERMISSION_GRANTED) { <END> requestStoragePermission(); return false; } else { return true; } }</code><technical_language>Yea, invert conditions</technical_language>

Target:
private boolean hasStoragePermissions() { int permission = ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE); Log.i("Glucosio", "Storage permissions granted."); if (permission == PackageManager.PERMISSION_DENIED) { requestStoragePermission(); return false; } else { return true; } }
Source:
<code>public static String getUniqueUserID() { <START> String defaultUuidValue = "UUID missing, defaulting to this value"; <END> String uniqueUserID = Preference.APPLICATION_SCOPED.get(BriefcasePreferences.BRIEFCASE_UNIQUE_USER_ID_PROPERTY, defaultUuidValue); if ( uniqueUserID.equals(defaultUuidValue)) { Preference.APPLICATION_SCOPED.put(BriefcasePreferences.BRIEFCASE_UNIQUE_USER_ID_PROPERTY, UUID.randomUUID().toString()); } return Preference.APPLICATION_SCOPED.get(BriefcasePreferences.BRIEFCASE_UNIQUE_USER_ID_PROPERTY, defaultUuidValue); }</code><technical_language>important noun in this noun phrase is message, value. a message a missing UUID</technical_language>

Target:
public static String getUniqueUserID() { String defaultUuidValue = "UUID missing, defaulting to this message"; String uniqueUserID = Preference.APPLICATION_SCOPED.get(BriefcasePreferences.BRIEFCASE_UNIQUE_USER_ID_PROPERTY, defaultUuidValue); if ( uniqueUserID.equals(defaultUuidValue)) { Preference.APPLICATION_SCOPED.put(BriefcasePreferences.BRIEFCASE_UNIQUE_USER_ID_PROPERTY, UUID.randomUUID().toString()); } return Preference.APPLICATION_SCOPED.get(BriefcasePreferences.BRIEFCASE_UNIQUE_USER_ID_PROPERTY, defaultUuidValue); }
Source:
<code>public void close() { try (Closer closer = Closer.create()) { <START> closer.register(() -> directReader.close()); <END> closer.register(() -> dictionaryReader.close()); } catch (IOException e) { throw new UncheckedIOException(e); } }</code><technical_language>java closer.register(directReader::close); closer.register(dictionaryReader::close);</technical_language>

Target:
public void close() { try (Closer closer = Closer.create()) { closer.register(directReader::close); closer.register(dictionaryReader::close); } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
<code>public void remove(@NotNull(message = "name cannot be NULL") final String name ) throws IOException { if (this.labelSet().contains(name)) { this.storage.apply( new Directives().xpath( String.format("%s/label[.='%s']", this.xpath(), name) ).remove() ); final MkIssueEvents events = new MkIssueEvents( this.storage, this.self, this.repo ); <START> events.create( <END> Event.UNLABELED, this.ticket, this.self, Optional.of(name) ); } }</code><technical_language>@cvrebert inline this statement new MkIssueEvents() statement above</technical_language>

Target:
public void remove(@NotNull(message = "name cannot be NULL") final String name ) throws IOException { if (this.labels().contains(name)) { this.storage.apply( new Directives().xpath( String.format("%s/label[.='%s']", this.xpath(), name) ).remove() ); new MkIssueEvents( this.storage, this.self, this.repo ).create( Event.UNLABELED, this.ticket, this.self, Optional.of(name) ); } }
Source:
<code>private boolean isValid() { <START> return !StringUtils.isBlank(topic) && payload.length > 0; <END> }</code><technical_language>0 byte message is valid <LINK_0></technical_language>

Target:
private boolean isValid() { return !StringUtils.isBlank(topic); }
Source:
<code>public void testVariantIdsFoundAndNotFound() { List<String> ids = new ArrayList<>(); ids.add("rs148957270"); ids.add("rs575961545"); ids.add("a1b1c1d1e1"); List<VariantRepositoryFilter> filters = new ArrayList<>(); List<String> exclude = new ArrayList<>(); List<VariantMongo> variantEntityList = variantRepository .findByIdsAndComplexFilters(ids, filters, exclude, null); assertNotNull(variantEntityList); assertTrue(variantEntityList.size() > 0); <START> assertEquals(2, variantEntityList.size()); <END> }</code><technical_language>I assert proper rs ids found</technical_language>

Target:
public void testVariantIdsFoundAndNotFound() { List<String> ids = new ArrayList<>(); ids.add("rs148957270"); ids.add("rs575961545"); ids.add("a1b1c1d1e1"); List<VariantRepositoryFilter> filters = new ArrayList<>(); List<String> exclude = new ArrayList<>(); List<VariantMongo> variantEntityList = variantRepository .findByIdsAndComplexFilters(ids, filters, exclude, null); assertNotNull(variantEntityList); assertTrue(variantEntityList.size() > 0); assertEquals(2, variantEntityList.size()); assertTrue(variantEntityList.get(0).getIds().contains(ids.get(0)) || variantEntityList.get(0).getIds().contains(ids.get(1))); assertTrue(variantEntityList.get(1).getIds().contains(ids.get(0)) || variantEntityList.get(1).getIds().contains(ids.get(1))); }
Source:
<code>public void refreshGeneratedScript() throws InvalidParamsException, UnsupportedTypeException, NoScriptDefinitionSelectedException { <START> ScriptDefinitionWrapper config = getScriptDefinition() <END> .orElseThrow(() -> new NoScriptDefinitionSelectedException("Tried to generate a script with no config selected to generate it with")); try { if(areParamsValid()) { generator.doRunstrategy(AlgorithmType.GENERATE_PYTHON, currentlyLoadedDataFile, scriptGeneratorTable, config, GeneratedProgrammingLanguage.PYTHON); } else { throw new InvalidParamsException("Parameters are invalid, cannot generate script"); } } catch (InterruptedException | ExecutionException e) { firePropertyChange(THREAD_ERROR_PROPERTY, threadError, true); LOG.error(e); threadError = true; } }</code><technical_language>scriptDefinition config</technical_language>

Target:
public void refreshGeneratedScript() throws InvalidParamsException, UnsupportedLanguageException, NoScriptDefinitionSelectedException { ScriptDefinitionWrapper scriptDefinition = getScriptDefinition() .orElseThrow(() -> new NoScriptDefinitionSelectedException( "Tried to generate a script with no script definition selected to generate it with")); try { if (areParamsValid()) { String filePath = preferenceSupplier.scriptGeneratorScriptDefinitionFolders() + scriptDefinition.getName() + PYTHON_EXT; String jsonContent = scriptGenFileHandler.createJsonString(scriptGeneratorTable.getActions(), scriptGenFileHandler.readFileContent(filePath), filePath); generator.refreshGeneratedScript(scriptGeneratorTable, scriptDefinition, jsonContent); } else { throw new InvalidParamsException("Parameters are invalid, cannot generate script"); } } catch (InterruptedException | ExecutionException e) { firePropertyChange(THREAD_ERROR_PROPERTY, threadError, true); LOG.error(e); threadError = true; } catch (IOException e) { LOG.error(e); } }
Source:
<code>public void shouldNotHaveTheRemoteCause() { try { Document wrongDoc = (Document) session.newRequest(FetchDocument.ID).set("value", "/test").execute(); fail("Unexpected " + wrongDoc); } catch (RemoteException e) { assertNotNull(e); assertNull(e.getRemoteCause()); } catch (Exception e) { <START> fail(); <END> } }</code><technical_language>remove catch (Exception e) { fail(); }, give a clearer error failing</technical_language>

Target:
public void shouldNotHaveTheRemoteCause() throws IOException { try { Document wrongDoc = (Document) session.newRequest(FetchDocument.ID).set("value", "/test").execute(); fail("Unexpected " + wrongDoc); } catch (RemoteException e) { assertNotNull(e); assertNull(e.getRemoteCause()); } }
Source:
<code>public Weld beanClasses(Class<?>... classes) { this.beanClasses.clear(); <START> for (Class<?> beanClass : classes) { <END> this.beanClasses.add(beanClass.getName()); } return this; }</code><technical_language>consider BeanDeployArchive changes / evolvement allow for Class<?> objects passed Weld instead of Class<?> --> class name --> Class<?></technical_language>

Target:
public Weld beanClasses(Class<?>... classes) { beanClasses.clear(); for (Class<?> beanClass : classes) { addBeanClass(beanClass); } return this; }
Source:
<code>public void testValidImports() throws IOException { setUpOpennmsHomeInTmpDir(); final String validXml = "<model-import xmlns=\"<LINK_0>\" date-stamp=\"2019-04-04T07:49:24.053+02:00\" foreign-source=\"ABC\" last-import=\"2019-04-04T07:49:30.777+02:00\"/>"; final Path etcDir = java.nio.file.Files.createDirectories(Paths.get(this.opennmsHomeDir.getPath(), "etc/imports")); final File file = new File(etcDir.toFile(), "ABC.xml"); <START> Files.write(validXml, file, StandardCharsets.UTF_8); <END> testConfigFile("imports"); }</code><technical_language>test do thing, besides valid/invalidXml changes. refactor this duplicated code</technical_language>

Target:
public void testValidImports() throws IOException { final String validXml = "<model-import xmlns=\"<LINK_0>\" date-stamp=\"2019-04-04T07:49:24.053+02:00\" foreign-source=\"ABC\" last-import=\"2019-04-04T07:49:30.777+02:00\"/>"; testXmlFile("imports", validXml); }
Source:
<code>public void run() { try { while ( !isCompleted() && !end ) { Unit candidate = current.next; <START> if ( candidate != null ) <END> { if ( id < candidate.processors ) { long time = nanoTime(); forkedProcess( id, candidate.processors, candidate.batch ); candidate.processorDone( nanoTime() - time ); } current = candidate; } else { PARK.park( this ); } } } catch ( Throwable e ) { issuePanic( e, false ); } }</code><technical_language>number of processor threads decrease. wanted set end true in applyProcessorCount</technical_language>

Target:
public void run() { try { while ( !isCompleted() ) { Unit candidate = current.next; if ( candidate != null ) { if ( id < candidate.processors ) { long time = nanoTime(); forkedProcess( id, candidate.processors, candidate.batch ); candidate.processorDone( nanoTime() - time ); } current = candidate; } else { PARK.park( this ); } } } catch ( Throwable e ) { issuePanic( e, false ); } }
Source:
<code>void printUsageInfo() { StringBuilder usage = new StringBuilder(); usage.append(" System Properties: \n"); usage.append(" -DselionHome=<folderPath>: \n"); <START> usage.append(" Path of SeLion home directory. Defaults to <user.home>/.selion/ \n"); <END> usage.append(" -D[property]=[value]: \n"); usage.append(" Any other System Property you wish to pass to the JVM \n"); System.out.print(usage.toString()); }</code><technical_language>consider defaulting "<user.home>/.selion2" For SeLion 2 ? allow SeLIon 1.x 2 host</technical_language>

Target:
void printUsageInfo() { StringBuilder usage = new StringBuilder(); usage.append(" System Properties: \n"); usage.append(" -DselionHome=<folderPath>: \n"); usage.append(" Path of SeLion home directory. Defaults to <user.home>/.selion2/ \n"); usage.append(" -D[property]=[value]: \n"); usage.append(" Any other System Property you wish to pass to the JVM \n"); System.out.print(usage.toString()); }
Source:
<code>public Rectangle getBounds() { <START> bounds = new Rectangle(0,0,bv.hex_size.width, bv.hex_size.height); <END> Point hexOrigin = bounds.getLocation(); Point ePos; if (secondaryPos == -1) { ePos = bv.getHexLocation(entity.getPosition()); } else { ePos = bv.getHexLocation(entity.getSecondaryPositions().get(secondaryPos)); } bounds.setLocation(hexOrigin.x + ePos.x, hexOrigin.y + ePos.y); return bounds; }</code><technical_language>suggestion bounds = new Rectangle(0, 0, bv.hex_size.width, bv.hex_size.height);</technical_language>

Target:
public Rectangle getBounds() { bounds = new Rectangle(0, 0, bv.hex_size.width, bv.hex_size.height); Point hexOrigin = bounds.getLocation(); Point ePos; if (secondaryPos < 0 || secondaryPos >= entity.getSecondaryPositions().size()) { ePos = bv.getHexLocation(entity.getPosition()); } else { ePos = bv.getHexLocation(entity.getSecondaryPositions().get(secondaryPos)); } bounds.setLocation(hexOrigin.x + ePos.x, hexOrigin.y + ePos.y); return bounds; }
Source:
<code><START> public static Object[][] adsVUAPTopMercury() { <END> return new Object[][]{ { new Page("project43", "SyntheticTests/VUAP"), ImmutableMap.of("src", "mobile", "slotName", AdsContent.MOBILE_TOP_LB) } }; }</code><technical_language>VUAP bottom part Mercury</technical_language>

Target:
public static Object[][] adsVUAPTopMercury() { return new Object[][]{ { new Page("project43", "SyntheticTests/VUAP"), AdsContent.MOBILE_TOP_LB, String.format( "google_ads_iframe_/5441/wka.life/_project43 AdsContent.MOBILE_TOP_LB ) } }; }
Source:
<code>public void batch_update_using_sso_credential() { final WhoisResources whoisResources = mapRpslObjects( RpslObject.parse( "inetnum: 19.0.0.0 - 19.1.255.255\n" + "netname: TEST-NET-NAME\n" + "descr: TEST network\n" + "country: BE\n" + "admin-c: TP1-TEST\n" + "tech-c: TP1-TEST\n" + "status: ASSIGNED PA\n" + "mnt-by: OWNER4-MNT\n" + "source: TEST") ); try { RestTest.target(getPort(), "whois/batch/TEST") .request() .cookie("crowd.token_key", "valid-token") .post(Entity.entity(whoisResources, MediaType.APPLICATION_JSON_TYPE), WhoisResources.class); <START> } catch (BadRequestException bre) { <END> final WhoisResources response = bre.getResponse().readEntity(WhoisResources.class); System.out.println(response); } assertNotNull(databaseHelper.lookupObject(ObjectType.INETNUM, "19.0.0.0 - 19.1.255.255")); }</code><technical_language>Remove catch? (test fail)</technical_language>

Target:
public void batch_update_using_sso_credential() { final WhoisResources whoisResources = mapRpslObjects( RpslObject.parse( "inetnum: 19.0.0.0 - 19.1.255.255\n" + "netname: TEST-NET-NAME\n" + "descr: TEST network\n" + "country: BE\n" + "admin-c: TP1-TEST\n" + "tech-c: TP1-TEST\n" + "status: ASSIGNED PA\n" + "mnt-by: OWNER4-MNT\n" + "source: TEST") ); RestTest.target(getPort(), "whois/batch/TEST") .request() .cookie("crowd.token_key", "valid-token") .post(Entity.entity(whoisResources, MediaType.APPLICATION_JSON_TYPE), WhoisResources.class); assertNotNull(databaseHelper.lookupObject(ObjectType.INETNUM, "19.0.0.0 - 19.1.255.255")); }
Source:
<code>public void emit(Event event) { if (!started.get()) { throw new ISE("WTF emit was called while service is not started yet"); } if (event instanceof ServiceMetricEvent) { final ServiceMetricEvent serviceMetricEvent = (ServiceMetricEvent) event; final GraphiteEvent graphiteEvent = graphiteEventConverter.druidMetricToGraphite(serviceMetricEvent); if (graphiteEvent == null) { return; } try { final boolean isSuccessful = eventsQueue.offer(graphiteEvent, DEFAULT_PUT_GET_TIMEOUT, TimeUnit.MILLISECONDS); if (!isSuccessful) { log.error( "Throwing metrics on the floor Graphite queue is full please increase the capacity or/and the consumer frequency" <START> ); <END> } } catch (InterruptedException e) { log.error(e, e.getMessage()); } } else if (graphiteEmitterConfig.getLogAlerts() && event instanceof AlertEvent) { try { log.warn(mapper.writeValueAsString(event)); } catch (JsonProcessingException e) { log.error(e, "error while serializing alert event[%s]", ((AlertEvent) event).getDescription()); } } }</code><technical_language>useful log metric event druid in this msg</technical_language>

Target:
public void emit(Event event) { if (!started.get()) { throw new ISE("WTF emit was called while service is not started yet"); } if (event instanceof ServiceMetricEvent) { final GraphiteEvent graphiteEvent = graphiteEventConverter.druidEventToGraphite((ServiceMetricEvent) event); if (graphiteEvent == null) { return; } try { final boolean isSuccessful = eventsQueue.offer(graphiteEvent, DEFAULT_PUT_GET_TIMEOUT, TimeUnit.MILLISECONDS); if (!isSuccessful) { log.error( "Throwing event [%s] on the floor Graphite queue is full please increase the capacity or/and the consumer frequency", mapper.writeValueAsString(event) ); } } catch (InterruptedException e) { log.error(e, "got interrupted with message [%s]", e.getMessage()); Thread.currentThread().interrupt(); } catch (JsonProcessingException e) { log.error(e, e.getMessage()); } } else if (!emitterList.isEmpty() && event instanceof AlertEvent) { for (Emitter emitter : emitterList) { emitter.emit(event); } } else { throw new ISE("unknown event type [%s]", event.getClass()); } }
Source:
<code>public void getOrderGroupsByPatient_shouldGetOrderGroupsGivenPatient() { Patient existingPatient1 = Context.getPatientService().getPatient(8); <START> List<OrderGroup> ordergroups1 = Context.getOrderService().getOrderGroupsByPatient(existingPatient1); <END> assertEquals(1, ordergroups1.size()); }</code><technical_language>is reason for appending 1 variable name</technical_language>

Target:
public void getOrderGroupsByPatient_shouldGetOrderGroupsGivenPatient() { Patient existingPatient = Context.getPatientService().getPatient(8); List<OrderGroup> ordergroups = Context.getOrderService().getOrderGroupsByPatient(existingPatient); assertEquals(1, ordergroups.size()); }
Source:
<code>private List<Map<String, AttributeValue>> getItemsBetweenLocalTime( final Long accountId, final DeviceId deviceId, final DateTime startUTCTime, final DateTime endUTCTime, final DateTime startLocalTime, final DateTime endLocalTime, final Collection<DeviceDataAttribute> attributes) { final String externalDeviceId = deviceId.externalDeviceId.get(); final Expression keyConditionExpression = Expressions.and( <START> Expressions.compare(DeviceDataAttribute.ACCOUNT_ID, "=", toAttributeValue(accountId)), <END> Expressions.between(DeviceDataAttribute.RANGE_KEY, getRangeKey(startUTCTime, externalDeviceId), getRangeKey(endUTCTime, externalDeviceId))); final Expression filterExpression = Expressions.between(DeviceDataAttribute.LOCAL_UTC_TIMESTAMP, dateTimeToAttributeValue(startLocalTime), dateTimeToAttributeValue(endLocalTime)); final List<Map<String, AttributeValue>> results = Lists.newArrayList(); for (final Map<String, AttributeValue> result : queryTables(getTableNames(startUTCTime, endUTCTime), keyConditionExpression, filterExpression, attributes)) { if (externalDeviceIdFromDDBItem(result).equals(externalDeviceId)) { results.add(result); } } return results; }</code><technical_language>_me likes_ note: provide equal abstraction for this, common query for equality attribute</technical_language>

Target:
private List<Map<String, AttributeValue>> getItemsBetweenLocalTime( final Long accountId, final DeviceId deviceId, final DateTime startUTCTime, final DateTime endUTCTime, final DateTime startLocalTime, final DateTime endLocalTime, final Collection<DeviceDataAttribute> attributes) { final String externalDeviceId = deviceId.externalDeviceId.get(); final Expression keyConditionExpression = Expressions.and( Expressions.equals(DeviceDataAttribute.ACCOUNT_ID, toAttributeValue(accountId)), Expressions.between(DeviceDataAttribute.RANGE_KEY, getRangeKey(startUTCTime, externalDeviceId), getRangeKey(endUTCTime, externalDeviceId))); final Expression filterExpression = Expressions.between(DeviceDataAttribute.LOCAL_UTC_TIMESTAMP, dateTimeToAttributeValue(startLocalTime), dateTimeToAttributeValue(endLocalTime)); final List<Map<String, AttributeValue>> results = Lists.newArrayList(); for (final Map<String, AttributeValue> result : queryTables(getTableNames(startUTCTime, endUTCTime), keyConditionExpression, filterExpression, attributes)) { if (externalDeviceIdFromDDBItem(result).equals(externalDeviceId)) { results.add(result); } } return results; }
Source:
<code>public int hashCode() { <START> int result = interval != null ? interval.hashCode() : 0; <END> result = 31 * result + (condition != null ? condition.hashCode() : 0); return result; }</code><technical_language>This is a small nitpick, do equals (only 1 based conditional). thinking give spread interval is multiplied 31 condition is multiplied</technical_language>

Target:
public int hashCode() { return interval != null ? interval.hashCode() : condition.hashCode(); }