auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testGetCachedDatanodeReport() throws Exception { final DatanodeInfo[] datanodeReport = routerProtocol.getDatanodeReport(DatanodeReportType.ALL); assertEquals(12, datanodeReport.length); DatanodeInfo[] datanodeReport1 = routerProtocol.getDatanodeReport(DatanodeReportType.ALL); assertArrayEquals(datanodeReport1, datanodeReport); <START> getCluster().getCluster().startDataNodes(getCluster().getCluster().getConfiguration(0), <END> 1, true, null, null, null); GenericTestUtils.waitFor(new Supplier<Boolean>() { @Override public Boolean get() { DatanodeInfo[] dn = null; try { dn = routerProtocol.getDatanodeReport(DatanodeReportType.ALL); } catch (IOException ex) { LOG.error("Error on getDatanodeReport"); } return !Arrays.equals(datanodeReport, dn); } }, 500, 5 * 1000); final DatanodeInfo[] datanodeReport2 = routerProtocol.getDatanodeReport(DatanodeReportType.ALL); assertFalse(Arrays.equals(datanodeReport, datanodeReport2)); }</code><technical_language>I need clear state test case affect others testNamenodeMetrics. long line</technical_language>

Target:
public void testGetCachedDatanodeReport() throws Exception { RouterRpcServer rpcServer = router.getRouter().getRpcServer(); final DatanodeInfo[] datanodeReport = rpcServer.getCachedDatanodeReport(DatanodeReportType.LIVE); assertEquals(12, datanodeReport.length); DatanodeInfo[] datanodeReport1 = rpcServer.getCachedDatanodeReport(DatanodeReportType.LIVE); assertArrayEquals(datanodeReport1, datanodeReport); MiniDFSCluster miniDFSCluster = getCluster().getCluster(); DataNodeProperties dnprop = miniDFSCluster.stopDataNode(0); GenericTestUtils.waitFor(new Supplier<Boolean>() { @Override public Boolean get() { DatanodeInfo[] dn = null; try { dn = rpcServer.getCachedDatanodeReport(DatanodeReportType.LIVE); } catch (IOException ex) { LOG.error("Error on getCachedDatanodeReport"); } return !Arrays.equals(datanodeReport, dn); } }, 500, 5 * 1000); final DatanodeInfo[] datanodeReport2 = rpcServer.getCachedDatanodeReport(DatanodeReportType.LIVE); assertEquals(datanodeReport.length - 1, datanodeReport2.length); miniDFSCluster.restartDataNode(dnprop); miniDFSCluster.waitActive(); GenericTestUtils.waitFor(new Supplier<Boolean>() { @Override public Boolean get() { DatanodeInfo[] dn = null; try { dn = rpcServer.getCachedDatanodeReport(DatanodeReportType.LIVE); } catch (IOException ex) { LOG.error("Error on getCachedDatanodeReport"); } return datanodeReport.length == dn.length; } }, 500, 5 * 1000); final DatanodeInfo[] datanodeReport3 = rpcServer.getCachedDatanodeReport(DatanodeReportType.LIVE); assertEquals(datanodeReport.length, datanodeReport3.length); }
Source:
<code>public void dispose(String taskName) { checkNotStaleTask(taskName); log(FINEST, taskName, "Disposing"); ScheduledTaskDescriptor descriptor = tasks.get(taskName); taskLifecycleHook.preTaskDestroy(name, descriptor.getDefinition()); try { descriptor.cancel(true); } finally { tasks.remove(taskName); <START> taskLifecycleHook.postTaskDestroy(name, descriptor.getDefinition()); <END> } }</code><technical_language>above, do want invoke postTaskDestroy if exception</technical_language>

Target:
public void dispose(String taskName) { checkNotStaleTask(taskName); log(FINEST, taskName, "Disposing"); ScheduledTaskDescriptor descriptor = tasks.remove(taskName); if (descriptor.isActive()) { releasePermit(); } descriptor.cancel(true); }
Source:
<code>private Class loadGroovyClass(final Resource groovyScript, final GroovyClassLoader loader) throws IOException { if ("jar".equals(groovyScript.getURI().getScheme())) { return loader.parseClass(new BufferedReader(new InputStreamReader(groovyScript.getInputStream(), StandardCharsets.UTF_8)), groovyScript.getFilename()); <START> } else { <END> val groovyFile = groovyScript.getFile(); if (groovyFile.exists()) { return loader.parseClass(groovyFile); } } throw new FileNotFoundException("Groovy script at [" + groovyScript + "] does not exist"); }</code><technical_language>Unnecessary else clause</technical_language>

Target:
private Class loadGroovyClass(final Resource groovyScript, final GroovyClassLoader loader) throws IOException { if (ResourceUtils.isJarResource(groovyScript)) { try (val groovyReader = new BufferedReader(new InputStreamReader(groovyScript.getInputStream(), StandardCharsets.UTF_8))) { return loader.parseClass(groovyReader, groovyScript.getFilename()); } } val groovyFile = groovyScript.getFile(); if (groovyFile.exists()) { return loader.parseClass(groovyFile); } return null; }
Source:
<code>private void writeAck(ChannelHandlerContext ctx, byte protocol, int sequence) { ByteBuf buffer = ctx.alloc().buffer(6); buffer.writeByte(protocol); buffer.writeByte('A'); buffer.writeInt(sequence); <START> ctx.writeAndFlush(buffer); <END> }</code><technical_language>this bytebuffer potentially need released well</technical_language>

Target:
private void writeAck(ChannelHandlerContext ctx, byte protocol, int sequence) { ctx.write(new Ack(protocol, sequence)); }
Source:
<code>public void testOlsonTimeZoneConversion() { final String[] timeZoneIds = TimeZone.getAvailableIDs(); for (final String timeZoneId : timeZoneIds) { if(timeZoneId.startsWith("America") || timeZoneId.startsWith("Europe") || timeZoneId.startsWith("Africa")) { final TimeZone timeZone = TimeZone.getTimeZone(timeZoneId); final OlsonTimeZoneDefinition olsonTimeZone = new OlsonTimeZoneDefinition(timeZone); final String olsonTimeZoneId = olsonTimeZone.getId(); <START> Assert.assertFalse(StringUtils.isBlank(olsonTimeZoneId)); <END> } } }</code><technical_language>expect correct olsonTimeZoneId here</technical_language>

Target:
public void testOlsonTimeZoneConversion() { final Map<String, String> olsonTimeZoneToMsMap = TimeZoneUtils.createOlsonTimeZoneToMsMap(); final String[] timeZoneIds = TimeZone.getAvailableIDs(); for (final String timeZoneId : timeZoneIds) { final boolean america = timeZoneId.startsWith("America"); final boolean europe = timeZoneId.startsWith("Europe"); final boolean africa = timeZoneId.startsWith("Africa"); if (america || europe || africa) { final TimeZone timeZone = TimeZone.getTimeZone(timeZoneId); final OlsonTimeZoneDefinition olsonTimeZone = new OlsonTimeZoneDefinition(timeZone); final String olsonTimeZoneId = olsonTimeZone.getId(); Assert.assertFalse(StringUtils.isBlank(olsonTimeZoneId)); Assert.assertEquals(olsonTimeZoneToMsMap.get(timeZoneId), olsonTimeZoneId); } } }
Source:
<code>public void testForLoopInstrumentation() { CompilerOptions options = createCompilerOptions(); String source = lines( "for(var i = 0 ; i < 10 ; ++i) {", " console.log('*');", "}"); String[] sourceArr = {instrumentCodeSource, source}; String expected = lines( "for(var i = 0 ; i < 10 ; ++i) {", getInstrumentCodeLine("C", 1, 0), ";", " console.log('*');", "}", <START> getInstrumentCodeLine("E", 1, 0), ";"); <END> String[] expectedArr = {instrumentCodeExpected, expected}; test(options, sourceArr, expectedArr); }</code><technical_language>Tbh benefit this case adds. In if switch statements default statements detect main condition runs. While is default case for loop. if this line runs - give useful info loop ran not</technical_language>

Target:
public void testForLoopInstrumentation() { CompilerOptions options = createCompilerOptions(); String source = lines( "for(var i = 0 ; i < 10 ; ++i) {", " console.log('*');", "}"); String[] sourceArr = {instrumentCodeSource, source}; String expected = lines( "for(var i = 0 ; i < 10 ; ++i) {", getInstrumentCodeLine("C", 1, 0), ";", " console.log('*');", "}"); String[] expectedArr = {instrumentCodeExpected, expected}; test(options, sourceArr, expectedArr); }
Source:
<code><START> public static Boolean isZip(String fName) <END> { if (Strings.isNullOrEmpty(fName)) { return false; } return fName.endsWith(ZIP_SUFFIX); }</code><technical_language>Boolean, boolean</technical_language>

Target:
public static boolean isZip(String fName) { if (Strings.isNullOrEmpty(fName)) { return false; } return fName.endsWith(ZIP_SUFFIX); }
Source:
<code>private AffMatchOrganizationAltNameFiller createAffMatchOrganizationAltNameFiller() throws IOException { AffMatchOrganizationAltNameFiller altNameFiller = new AffMatchOrganizationAltNameFiller(); <START> List<String> altNamesCountryCodes = of( <END> "at", "be", "bg", "cy", "cz", "de", "dk", "ee", "es", "fi", "fr", "gr", "hr", "hu", "it", "lt", "lu", "lv", "nl", "pl", "pt", "ro", "se", "si", "sk" ); List<String> alternativeNamesResources = altNamesCountryCodes.stream() .map(code -> "/eu/dnetlib/iis/wf/affmatching/universities/universities_" + code + ".csv").collect(toList()); List<List<String>> alternativeNamesDictionary = new CsvOrganizationAltNamesDictionaryFactory().createAlternativeNamesDictionary(alternativeNamesResources); altNameFiller.setAlternativeNamesDictionary(alternativeNamesDictionary); return altNameFiller; }</code><technical_language>Again, if in resource file need define set of languages explicitly. I guess more generic do assume languages simply put file names in registry. drop universities_ prefix file name in universities directory</technical_language>

Target:
private AffMatchOrganizationAltNameFiller createAffMatchOrganizationAltNameFiller() throws IOException { AffMatchOrganizationAltNameFiller altNameFiller = new AffMatchOrganizationAltNameFiller(); List<Set<String>> alternativeNamesDictionary = new CsvOrganizationAltNamesDictionaryFactory() .createAlternativeNamesDictionary(OrganizationAltNameConst.CLASSPATH_ALTERNATIVE_NAMES_CSV_FILES); altNameFiller.setAlternativeNamesDictionary(alternativeNamesDictionary); return altNameFiller; }
Source:
<code>private MutateRowsRequest createRetryRequest(List<Integer> indiciesToRetry) { MutateRowsRequest.Builder updatedRequest = MutateRowsRequest.newBuilder() .setTableName(originalRequest.getTableName()); <START> mapToOriginalIndex = toIntArray(indiciesToRetry); <END> for (int i = 0; i < indiciesToRetry.size(); i++) { updatedRequest.addEntries(originalRequest.getEntries(indiciesToRetry.get(i))); } return updatedRequest.build(); }</code><technical_language>not: for (int index : indiciesToRetry) { updatedRequest.addEntries(originalRequest.getEntries(indexToRetry)) }</technical_language>

Target:
private MutateRowsRequest createRetryRequest(List<Integer> indiciesToRetry) { MutateRowsRequest.Builder updatedRequest = MutateRowsRequest.newBuilder() .setTableName(originalRequest.getTableName()); mapToOriginalIndex = new int[indiciesToRetry.size()]; for (int i = 0; i < indiciesToRetry.size(); i++) { mapToOriginalIndex[i] = indiciesToRetry.get(i); updatedRequest.addEntries(originalRequest.getEntries(indiciesToRetry.get(i))); } return updatedRequest.build(); }
Source:
<code>private boolean isAdmin(Set<String> entities) { String adminRole = conf.getString(ConfVars.ZEPPELIN_OWNER_ROLE); <START> if (adminRole.isEmpty()) { <END> return false; } return entities.contains(adminRole); }</code><technical_language>please org.apache.commons.lang.StringUtils IsBlank()</technical_language>

Target:
private boolean isAdmin(Set<String> entities) { String adminRole = conf.getString(ConfVars.ZEPPELIN_OWNER_ROLE); if (StringUtils.isBlank(adminRole)) { return false; } return entities.contains(adminRole); }
Source:
<code>private void checkValue(V valueObject) { <START> CheckerUtil.checkKey(valueType, valueObject); <END> }</code><technical_language>checkValue</technical_language>

Target:
private void checkValue(V valueObject) { CheckerUtil.checkValue(valueType, valueObject); }
Source:
<code>public Mono<Instant> renewMessageLock(MessageLockToken lockToken) { if (isDisposed.get()) { return monoError(logger, new IllegalStateException( String.format(INVALID_OPERATION_DISPOSED_RECEIVER, "renewMessageLock"))); } else if (Objects.isNull(lockToken)) { return monoError(logger, new NullPointerException("'receivedMessage' cannot be null.")); <START> } else if (CoreUtils.isNullOrEmpty(lockToken.getLockToken())) { <END> return monoError(logger, new NullPointerException("'receivedMessage.lockToken' cannot be null.")); } UUID lockTokenUUID; try { lockTokenUUID = UUID.fromString(lockToken.getLockToken()); } catch (IllegalArgumentException ex) { return monoError(logger, new IllegalStateException( String.format(INVALID_LOCK_TOKEN_STRING, lockToken.getLockToken()))); } return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityPath, entityType)) .flatMap(serviceBusManagementNode -> serviceBusManagementNode.renewMessageLock(lockTokenUUID)) .map(instant -> { if (lockToken instanceof ServiceBusReceivedMessage) { ((ServiceBusReceivedMessage) lockToken).setLockedUntil(instant); } return instant; }); }</code><technical_language>Null empty is checks. NullPointer for getLockToken() == null if is empty, illegal argument exception</technical_language>

Target:
public Mono<Instant> renewMessageLock(MessageLockToken lockToken) { if (isDisposed.get()) { return monoError(logger, new IllegalStateException( String.format(INVALID_OPERATION_DISPOSED_RECEIVER, "renewMessageLock"))); } else if (Objects.isNull(lockToken)) { return monoError(logger, new NullPointerException("'receivedMessage' cannot be null.")); } else if (Objects.isNull(lockToken.getLockToken())) { return monoError(logger, new NullPointerException("'receivedMessage.lockToken' cannot be null.")); } else if (lockToken.getLockToken().isEmpty()) { return monoError(logger, new IllegalArgumentException("'message.lockToken' cannot be empty.")); } UUID lockTokenUuid = null; try { lockTokenUuid = UUID.fromString(lockToken.getLockToken()); } catch (IllegalArgumentException ex) { monoError(logger, ex); } UUID finalLockTokenUuid = lockTokenUuid; return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityPath, entityType)) .flatMap(serviceBusManagementNode -> serviceBusManagementNode.renewMessageLock(finalLockTokenUuid)) .map(instant -> { if (lockToken instanceof ServiceBusReceivedMessage) { ((ServiceBusReceivedMessage) lockToken).setLockedUntil(instant); } return instant; }); }
Source:
<code>private void prepareGuestAgentNetworkDevicesForUpdate() { for (VmInternalData vmInternalData : _runningVms.values()) { VmDynamic vmDynamic = vmInternalData.getVmDynamic(); if (vmDynamic != null) { VM vm = _vmDict.get(vmDynamic.getId()); if (vm != null) { List<VmGuestAgentInterface> vmGuestAgentInterfaces = vmInternalData.getVmGuestAgentInterfaces(); int guestAgentNicHash = vmGuestAgentInterfaces == null ? 0 : vmGuestAgentInterfaces.hashCode(); if (guestAgentNicHash != vmDynamic.getGuestAgentNicHash()) { vmGuestAgentNics.put(vmDynamic.getId(), vmGuestAgentInterfaces); if (_vmDynamicToSave.containsKey(vm.getId())) { _vmDynamicToSave.get(vm.getId()).setGuestAgentNicHash(guestAgentNicHash); _vmDynamicToSave.get(vm.getId()) .setvm_ip(extractVmIpsFromGuestAgentInterfaces(vmGuestAgentInterfaces)); <START> } else { <END> AddVmDynamicToList(vmDynamic); } } } } } }</code><technical_language>In this case then, new IP & hash values</technical_language>

Target:
private void prepareGuestAgentNetworkDevicesForUpdate() { for (VmInternalData vmInternalData : _runningVms.values()) { VmDynamic vmDynamic = vmInternalData.getVmDynamic(); if (vmDynamic != null) { VM vm = _vmDict.get(vmDynamic.getId()); if (vm != null) { List<VmGuestAgentInterface> vmGuestAgentInterfaces = vmInternalData.getVmGuestAgentInterfaces(); int guestAgentNicHash = vmGuestAgentInterfaces == null ? 0 : vmGuestAgentInterfaces.hashCode(); if (guestAgentNicHash != vmDynamic.getGuestAgentNicsHash()) { vmGuestAgentNics.put(vmDynamic.getId(), vmGuestAgentInterfaces); if (_vmDynamicToSave.containsKey(vm.getId())) { updateGuestAgentInterfacesChanges(_vmDynamicToSave.get(vm.getId()), vmGuestAgentInterfaces, guestAgentNicHash); } else { updateGuestAgentInterfacesChanges(vmDynamic, vmGuestAgentInterfaces, guestAgentNicHash); AddVmDynamicToList(vmDynamic); } } } } } }
Source:
<code>public void getKeys(IPointable result) throws SystemException { try { abvs.reset(); slots.clear(); dataArea.reset(); int dataAreaOffset = getDataAreaOffset(bytes, start); int entryCount = getEntryCount(); int s; for (int i = 0; i < entryCount; i++) { <START> s = dataAreaOffset + getRelativeEntryStartOffset(i); <END> dataArea.getDataOutput().write(ValueTag.XS_STRING_TAG); dataArea.getDataOutput().write(bytes, s, getKeyLength(bytes, s)); slots.append(dataArea.getLength()); } finishSequenceBuild(); result.set(abvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001); } }</code><technical_language>I thought this more, I adding a new method Sequence builder a simpler solution reduce code duplication. new method "public void addItem(int tagValue, IValueReference p) throws IOException". method create a tagged sequence of items for you. This reduce variables code in this class. method else where</technical_language>

Target:
public void getKeys(IPointable result) throws IOException { abvs.reset(); sb.reset(abvs); int dataAreaOffset = getDataAreaOffset(bytes, start); int entryCount = getEntryCount(); int s; for (int i = 0; i < entryCount; i++) { s = dataAreaOffset + getRelativeEntryStartOffset(i); key1.set(bytes, s, getKeyLength(bytes, s)); sb.addItem(ValueTag.XS_STRING_TAG, key1); } sb.finish(); result.set(abvs); }
Source:
<code>public void testCTAWithCampaignMetadata() { final Intent intent = new Intent(); intent.putExtra("mp_message", "MESSAGE"); intent.putExtra("mp_message_id", "1"); intent.putExtra("mp_campaign_id", "2"); intent.putExtra("mp", "some_extra_data"); intent.putExtra("mp_cta", "<LINK_0>"); MixpanelPushNotification.PushTapAction fakeOnTap = new MixpanelPushNotification.PushTapAction(MixpanelPushNotification.PushTapTarget.fromString("browser"), "<LINK_0>"); <START> PushTapActionMatcher matcher = new PushTapActionMatcher(fakeOnTap); <END> mpPushSpy.createNotification(intent); verify(mpPushSpy).getRoutingIntent(argThat(matcher)); }</code><technical_language>nit: call this variable matchesFakeOnTap</technical_language>

Target:
public void testCTAWithCampaignMetadata() { final Intent intent = new Intent(); intent.putExtra("mp_message", "MESSAGE"); intent.putExtra("mp_message_id", "1"); intent.putExtra("mp_campaign_id", "2"); intent.putExtra("mp", "some_extra_data"); intent.putExtra("mp_cta", "<LINK_0>"); MixpanelNotificationData.PushTapAction fakeOnTap = new MixpanelNotificationData.PushTapAction(MixpanelNotificationData.PushTapTarget.fromString("browser"), "<LINK_0>"); PushTapActionMatcher matchesFakeOnTap = new PushTapActionMatcher(fakeOnTap); mpPushSpy.createNotification(intent); verify(mpPushSpy).getRoutingIntent(argThat(matchesFakeOnTap)); verify(mpPushSpy).buildBundle(argThat(matchesFakeOnTap)); }
Source:
<code><START> @Test public void rule_can_be_changed_to_strict() { <END> Result result = runner.run(MutableStrictJUnitTestRuleTest.LenientByDefault.class); JUnitResultAssert.assertThat(result) .succeeds(1) .fails(1, RuntimeException.class); }</code><technical_language>test name correspond test class name - unsure testing here</technical_language>

Target:
@Test public void rule_can_be_changed_to_strict() { Result result = runner.run(StrictByDefault.class); JUnitResultAssert.assertThat(result) .succeeds(1) .fails(1, RuntimeException.class); }
Source:
<code>public void equal_shouldReturnFalseIfOnlyEndDateOfOneObjectIsNull() { CohortMembership cohortMembershipOne = new CohortMembership(13); CohortMembership cohortMembershipTwo = new CohortMembership(12); long timestmap = 1577836801; <START> Date startDate1 = new Date(timestmap); <END> Date endDate1 = null; Date startDate2 = new Date(timestmap); Date endDate2 = null; cohortMembershipOne.setEndDate(endDate1); cohortMembershipOne.setStartDate(startDate1); cohortMembershipTwo.setStartDate(startDate2); cohortMembershipTwo.setEndDate(endDate2); assertFalse(cohortMembershipOne.equals(cohortMembershipTwo)); }</code><technical_language>end date of object objects</technical_language>

Target:
public void equal_shouldReturnFalseIfOnlyEndDateOfOneObjectIsNull() { final int PATIENT_ID = 13; CohortMembership cohortMembershipOne = new CohortMembership(PATIENT_ID); CohortMembership cohortMembershipTwo = new CohortMembership(PATIENT_ID); final int TIMESTAMP = 1577836801; Date startDate1 = new Date(TIMESTAMP); Date endDate1 = null; Date startDate2 = new Date(TIMESTAMP); Date endDate2 = new Date(TIMESTAMP); cohortMembershipOne.setEndDate(endDate1); cohortMembershipOne.setStartDate(startDate1); cohortMembershipTwo.setStartDate(startDate2); cohortMembershipTwo.setEndDate(endDate2); assertFalse(cohortMembershipOne.equals(cohortMembershipTwo)); }
Source:
<code>public void runInToolingApi(CancellationTokenSource tokenSource, IProgressMonitor monitor) throws Exception { try { SubMonitor progress = SubMonitor.convert(monitor, 5); progress.setTaskName((String.format("Synchronizing Gradle build at %s with workspace", this.gradleBuild.getBuildConfig().getRootProjectDirectory()))); new ImportRootProjectOperation(this.gradleBuild.getBuildConfig(), this.newProjectHandler).run(progress.newChild(1)); Set<EclipseProject> allProjects = ModelProviderUtil.fetchAllEclipseProjects(this.gradleBuild, tokenSource, FetchStrategy.FORCE_RELOAD, progress.newChild(1)); new ValidateProjectLocationOperation(allProjects).run(progress.newChild(1)); new RunOnImportTasksOperation(allProjects, this.gradleBuild.getBuildConfig()).run(progress.newChild(1), tokenSource); this.failures = new SynchronizeGradleBuildOperation(allProjects, this.gradleBuild, this.newProjectHandler, ProjectConfigurators.create(this.gradleBuild, CorePlugin.extensionManager().loadConfigurators())).run(progress.newChild(1)); } finally { <START> this.gradleBuild.projectConnectionCache.clear(); <END> } }</code><technical_language>stateful</technical_language>

Target:
public void runInToolingApi(CancellationTokenSource tokenSource, IProgressMonitor monitor) throws Exception { try { SubMonitor progress = SubMonitor.convert(monitor, 5); progress.setTaskName((String.format("Synchronizing Gradle build at %s with workspace", this.gradleBuild.getBuildConfig().getRootProjectDirectory()))); new ImportRootProjectOperation(this.gradleBuild.getBuildConfig(), this.newProjectHandler).run(progress.newChild(1)); Set<EclipseProject> allProjects = ModelProviderUtil.fetchAllEclipseProjects(this.gradleBuild, tokenSource, FetchStrategy.FORCE_RELOAD, progress.newChild(1)); new ValidateProjectLocationOperation(allProjects).run(progress.newChild(1)); new RunOnImportTasksOperation(allProjects, this.gradleBuild.getBuildConfig()).run(progress.newChild(1), tokenSource); this.failures = new SynchronizeGradleBuildOperation(allProjects, this.gradleBuild, this.newProjectHandler, ProjectConfigurators.create(this.gradleBuild, CorePlugin.extensionManager().loadConfigurators())).run(progress.newChild(1)); } finally { this.gradleBuild.projectConnectionCache.invalidateAll(); } }
Source:
<code><START> public Collection<DrugReferenceMap> getDrugReferenceMaps() { <END> if (drugReferenceMaps == null) { drugReferenceMaps = Collections.EMPTY_LIST; } return drugReferenceMaps; }</code><technical_language>I this a set, @djazayeri convention supposed a set</technical_language>

Target:
public Set<DrugReferenceMap> getDrugReferenceMaps() { if (drugReferenceMaps == null) { drugReferenceMaps = new HashSet<DrugReferenceMap>(); } return drugReferenceMaps; }
Source:
<code>public PostComment updateComment(long id, String body, long branchId) throws NotFoundException { PostComment comment = get(id); checkHasUpdatePermission(comment, branchId); comment.setBody(body); comment.setUserChanged(userService.getCurrentUser()); <START> comment.setModificationDate(new DateTime(System.currentTimeMillis())); <END> getDao().saveOrUpdate(comment); return comment; }</code><technical_language>**DateTime.now()** returns **new DateTime(System.currentTimeMillis())** more readable shorter</technical_language>

Target:
public PostComment updateComment(long id, String body, long branchId) throws NotFoundException { PostComment comment = get(id); checkHasUpdatePermission(comment, branchId); comment.setBody(body); comment.setUserChanged(userService.getCurrentUser()); comment.setModificationDate(DateTime.now()); getDao().saveOrUpdate(comment); return comment; }
Source:
<code>synchronized void receiveState(Address sender, int topologyId, Collection<StateChunk> stateChunks) { if (topologyId < topology.getTopologyId()) { if (trace) log.tracef("Discarding state response with old topology id %d for cache %s, the smallest allowed topology id is %d", topologyId, topology.getTopologyId(), cacheName); return; } <START> InboundTransferTask transferTask = transferTaskMap.remove(sender); <END> if (transferTask == null) { if (trace) log.tracef("State received for an unknown request. No record of a state request exists for node %s", sender); return; } if (trace) log.tracef("State chunks received from %s, with topologyId %s, statechunks %s", sender, topologyId, stateChunks); for (StateChunk chunk : stateChunks) { chunk.getCacheEntries().forEach(ice -> addKeyToReplicaMap(sender, ice)); transferTask.onStateReceived(chunk.getSegmentId(), chunk.isLastChunk()); } }</code><technical_language>remove? if this chunk? next chunk find task</technical_language>

Target:
synchronized void receiveState(Address sender, int topologyId, Collection<StateChunk> stateChunks) { if (topologyId < topology.getTopologyId()) { if (trace) log.tracef("Discarding state response with old topology id %d for cache %s, the smallest allowed topology id is %d", topologyId, topology.getTopologyId(), cacheName); return; } InboundTransferTask transferTask = transferTaskMap.get(sender); if (transferTask == null) { if (trace) log.tracef("State received for an unknown request. No record of a state request exists for node %s", sender); return; } if (trace) log.tracef("State chunks received from %s, with topologyId %s, statechunks %s", sender, topologyId, stateChunks); for (StateChunk chunk : stateChunks) { boolean isLastChunk = chunk.isLastChunk(); chunk.getCacheEntries().forEach(ice -> addKeyToReplicaMap(sender, ice)); transferTask.onStateReceived(chunk.getSegmentId(), isLastChunk); if (isLastChunk) transferTaskMap.remove(sender); } }
Source:
<code><START> public String checkBoxIndeterminateIconColor() { <END> return "#707070"; }</code><technical_language>getDisabledMenuColor() return color</technical_language>

Target:
public String checkBoxIndeterminateIconColor() { return this.getDisabledMenuColor(); }
Source:
<code>public void testDeleteNotification() { Notification notification = curationApiAdmin.createNotification(testNotification()); long id = notification.getId(); boolean userCanDelete = true; try { curationApiUser.deleteNotification(id); } catch (ApiException e) { <START> userCanDelete = false; END> } assertFalse(userCanDelete); curationApiAdmin.deleteNotification(id); int count = testingPostgres.runSelectStatement(String.format("select count(id) from notification where id = '%s'", id), int.class); assertEquals(0, count); }</code><technical_language>assertion other similar locations</technical_language>

Target:
public void testDeleteNotification() { Notification notification = curationApiAdmin.createNotification(testNotification()); long id = notification.getId(); boolean userCanDelete = true; try { curationApiUser.deleteNotification(id); } catch (ApiException e) { userCanDelete = false; assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), e.getCode()); } assertFalse(userCanDelete); curationApiAdmin.deleteNotification(id); int count = testingPostgres.runSelectStatement(String.format("select count(id) from notification where id = '%s'", id), int.class); assertEquals(0, count); }
Source:
<code>public QuorumUtil(int n, int syncLimit) throws RuntimeException { try { ClientBase.setupTestEnv(); JMXEnv.setUp(); N = n; ALL = 2 * N + 1; tickTime = 2000; <START> initLimit = 5; <END> this.syncLimit = syncLimit; connectToLearnerMasterLimit = 3; electionAlg = 3; hostPort = ""; for (int i = 1; i <= ALL; ++i) { PeerStruct ps = new PeerStruct(); ps.id = i; ps.dataDir = ClientBase.createTmpDir(); ps.clientPort = PortAssignment.unique(); peers.put(i, ps); peersView.put(Long.valueOf(i), new QuorumServer(i, new InetSocketAddress("127.0.0.1", PortAssignment.unique()), new InetSocketAddress("127.0.0.1", PortAssignment.unique()), new InetSocketAddress("127.0.0.1", ps.clientPort), LearnerType.PARTICIPANT)); hostPort += "127.0.0.1:" + ps.clientPort + ((i == ALL) ? "" : ","); } for (int i = 1; i <= ALL; ++i) { PeerStruct ps = peers.get(i); LOG.info("Creating QuorumPeer {}; public port {}", i, ps.clientPort); ps.peer = new QuorumPeer(peersView, ps.dataDir, ps.dataDir, ps.clientPort, electionAlg, ps.id, tickTime, initLimit, syncLimit, connectToLearnerMasterLimit); assertEquals(ps.clientPort, ps.peer.getClientPort()); } } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>changing this</technical_language>

Target:
public QuorumUtil(int n, int syncLimit) throws RuntimeException { try { ClientBase.setupTestEnv(); JMXEnv.setUp(); N = n; ALL = 2 * N + 1; tickTime = 2000; initLimit = 3; this.syncLimit = syncLimit; connectToLearnerMasterLimit = 3; electionAlg = 3; hostPort = ""; for (int i = 1; i <= ALL; ++i) { PeerStruct ps = new PeerStruct(); ps.id = i; ps.dataDir = ClientBase.createTmpDir(); ps.clientPort = PortAssignment.unique(); peers.put(i, ps); peersView.put(Long.valueOf(i), new QuorumServer(i, new InetSocketAddress("127.0.0.1", PortAssignment.unique()), new InetSocketAddress("127.0.0.1", PortAssignment.unique()), new InetSocketAddress("127.0.0.1", ps.clientPort), LearnerType.PARTICIPANT)); hostPort += "127.0.0.1:" + ps.clientPort + ((i == ALL) ? "" : ","); } for (int i = 1; i <= ALL; ++i) { PeerStruct ps = peers.get(i); LOG.info("Creating QuorumPeer {}; public port {}", i, ps.clientPort); ps.peer = new QuorumPeer(peersView, ps.dataDir, ps.dataDir, ps.clientPort, electionAlg, ps.id, tickTime, initLimit, syncLimit, connectToLearnerMasterLimit); assertEquals(ps.clientPort, ps.peer.getClientPort()); } } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>private void validateHaemoglobinCount(DonationBackingForm donationBackingForm, Errors errors) { Integer haemoglobinCount = null; Integer hbMin = Integer.parseInt(utilController.getGeneralConfigValueByName("donation.donor.hbMin")); Integer hbMax = Integer.parseInt(utilController.getGeneralConfigValueByName("donation.donor.hbMax")); if (donationBackingForm.getHaemoglobinCount() != null) haemoglobinCount = donationBackingForm.getHaemoglobinCount().intValue(); if (haemoglobinCount != null){ <START> if (haemoglobinCount == null || !(haemoglobinCount >= hbMin && <END> haemoglobinCount <= hbMax)) errors.rejectValue("donation.haemoglobinCount", "400", "Enter a value between "+ hbMin + " to " + hbMax); } }</code><technical_language>remove redundant null check merge if statements. simplify logic reversing comparisons || instead of ! &&</technical_language>

Target:
private void validateHaemoglobinCount(DonationBackingForm donationBackingForm, Errors errors) { Integer haemoglobinCount = null; Integer hbMin = Integer.parseInt(utilController.getGeneralConfigValueByName("donation.donor.hbMin")); Integer hbMax = Integer.parseInt(utilController.getGeneralConfigValueByName("donation.donor.hbMax")); if (donationBackingForm.getHaemoglobinCount() != null) haemoglobinCount = donationBackingForm.getHaemoglobinCount().intValue(); if (haemoglobinCount != null && (haemoglobinCount < hbMin || haemoglobinCount > hbMax)) { errors.rejectValue("donation.haemoglobinCount", "400", "Enter a value between "+ hbMin + " to " + hbMax); } }
Source:
<code>private String getValidBrickNames(List<GlusterBrickEntity> bricksForTask) { StringBuilder builder = new StringBuilder(); for (GlusterBrickEntity brick : bricksForTask) { builder.append(brick.getQualifiedName()); builder.append(", "); } <START> return builder.substring(0, builder.length() - 2).toString(); <END> }</code><technical_language>bricksForTask empty? builder.length -2 error</technical_language>

Target:
private String getValidBrickNames(List<GlusterBrickEntity> bricksForTask) { if (bricksForTask.size() == 0) { return ""; } StringBuilder builder = new StringBuilder(); for (GlusterBrickEntity brick : bricksForTask) { builder.append(brick.getQualifiedName()); builder.append(", "); } return builder.substring(0, builder.length() - 2).toString(); }
Source:
<code>public void discardAllContents(Box box) throws IOException; public void discardSingleItem(Box box, String position) throws IOException; public Box getByAlias(String alias) throws IOException; public Box getByBarcode(String barcode) throws IOException; public Map<String, Integer> getColumnSizes() throws IOException; public Collection<BoxableView> getViewsFromBarcodeList(Collection<String> barcodeList) throws IOException; public List<Box> getBySearch(String search); public Collection<BoxSize> listSizes() throws IOException; public Collection<BoxUse> listUses() throws IOException; public long save(Box box) throws IOException; public List<BoxableView> getBoxableViewsBySearch(String search); public BoxableView getBoxableView(BoxableId id) throws IOException; public void updateBoxableLocation(Boxable boxable) throws IOException; @Override public default void beforeDelete(Box object) throws IOException { <START> object.removeAllBoxables(); <END> }</code><technical_language>need save object flush changes database</technical_language>

Target:
public void discardAllContents(Box box) throws IOException; public void discardSingleItem(Box box, String position) throws IOException; public Box getByAlias(String alias) throws IOException; public Box getByBarcode(String barcode) throws IOException; public Map<String, Integer> getColumnSizes() throws IOException; public Collection<BoxableView> getViewsFromBarcodeList(Collection<String> barcodeList) throws IOException; public List<Box> getBySearch(String search); public Collection<BoxSize> listSizes() throws IOException; public Collection<BoxUse> listUses() throws IOException; public long save(Box box) throws IOException; public List<BoxableView> getBoxableViewsBySearch(String search); public BoxableView getBoxableView(BoxableId id) throws IOException; public void updateBoxableLocation(Boxable boxable) throws IOException; @Override public default void beforeDelete(Box object) throws IOException { object.removeAllBoxables(); save(object); }
Source:
<code>public void convertProject(IProject project, String bsId, IProgressMonitor monitor) throws CoreException{ monitor.beginTask(MakeUIPlugin.getResourceString("WizardMakeProjectConversion.monitor.convertingToMakeProject"), 3); try { if (ManagedBuilderCorePlugin.getDefault().isOldStyleMakeProject(project)) { <START> ManagedBuilderCorePlugin.getDefault().convertOldStdMakeToNewStyle(project, monitor); <END> } else { boolean wasCDTProject = AbstractPage.isCDTPrj(project); super.convertProject(project, bsId, new SubProgressMonitor(monitor, 1)); if (!wasCDTProject && isSetProjectType()) { h_selected.convertProject(project, monitor); } } } finally { monitor.done(); } }</code><technical_language>I talking this code. converting. If this is intended add nature another wizard</technical_language>

Target:
public void convertProject(IProject project, String bsId, IProgressMonitor monitor) throws CoreException{ monitor.beginTask(MakeUIPlugin.getResourceString("WizardMakeProjectConversion.monitor.convertingToMakeProject"), 3); try { boolean wasCDTProject = AbstractPage.isCDTPrj(project); super.convertProject(project, bsId, new SubProgressMonitor(monitor, 1)); if (!wasCDTProject && isSetProjectType()) { h_selected.convertProject(project, monitor); } } finally { monitor.done(); } }
Source:
<code>public void parsesHttpBody() throws Exception { final String body = "40 N Wolfe Rd, Sunnyvale, CA 94085"; final String part = "t4"; final RqMultipart multi = new RqMtFake( new RqFake(), new RqWithHeaders( new RqFake("", "", body), new FormattedText( "Content-Length: %s", body.getBytes().length ).asString(), new FormattedText( "Content-Disposition: form-data; name=\"%s\"", part ).asString() ), new RqWithHeaders( new RqFake("", "", ""), "Content-Length: 0", <START> "Content-Disposition: form-data; name=\"data\"; filename=\"a.rar\"" <END> ) ); try { MatcherAssert.assertThat( new RqHeaders.Base( multi.part(part).iterator().next() ).header("Content-Disposition"), Matchers.hasItem("form-data; name=\"t4\"") ); MatcherAssert.assertThat( new RqPrint( new RqHeaders.Base( multi.part(part).iterator().next() ) ).printBody(), Matchers.allOf( Matchers.startsWith("40 N"), Matchers.endsWith("CA 94085") ) ); } finally { multi.part(part).iterator().next().body().close(); } }</code><technical_language>@Serranya JoinedText break this line remove checkstyle supression</technical_language>

Target:
public void parsesHttpBody() throws Exception { final String body = "40 N Wolfe Rd, Sunnyvale, CA 94085"; final String part = "t4"; final RqMultipart multi = new RqMtFake( new RqFake(), new RqWithHeaders( new RqFake("", "", body), new FormattedText( RqMtFakeTest.CONTENT_LENGTH, body.getBytes().length ).asString(), new FormattedText( RqMtFakeTest.CONTENT_DISP, new FormattedText("name=\"%s\"", part).asString() ).asString() ), new RqWithHeaders( new RqFake("", "", ""), new FormattedText( RqMtFakeTest.CONTENT_LENGTH, 0 ).asString(), new FormattedText( RqMtFakeTest.CONTENT_DISP, "name=\"data\"; filename=\"a.rar\"" ).asString() ) ); try { MatcherAssert.assertThat( new RqHeaders.Base( multi.part(part).iterator().next() ).header("Content-Disposition"), Matchers.hasItem("form-data; name=\"t4\"") ); MatcherAssert.assertThat( new RqPrint( new RqHeaders.Base( multi.part(part).iterator().next() ) ).printBody(), Matchers.allOf( Matchers.startsWith("40 N"), Matchers.endsWith("CA 94085") ) ); } finally { multi.part(part).iterator().next().body().close(); } }
Source:
<code>public void run(PublicApiConfig config, Environment environment) throws Exception { final Client client = new RestClientFactory(config.getRestClientConfig()).getInstance(); <START> <END> environment.getObjectMapper().configure(DeserializationFeature.ACCEPT_FLOAT_AS_INT, false); environment.healthChecks().register("ping", new Ping()); environment.setValidator(Validation.byDefaultProvider() .configure().constraintValidatorFactory(new ConfigurationAwareConstraintValidatorFactory(config)) .buildValidatorFactory() .getValidator()); environment.jersey().register(new PaymentsResource(client, config.getConnectorUrl())); environment.jersey().register(AuthFactory.binder(new OAuthFactory<>(new AccountAuthenticator(client, config.getPublicAuthUrl()), "", String.class))); }</code><technical_language>problem I in this is code reads a Client object a new RestClientFactory. I this method of instance (static factory method pattern IIRC) of a factory in order get instance of object factory is suppose provide. ways of instance of factory well. RestClientFactory.from(ClientConfig) return a Client object instead</technical_language>

Target:
public void run(PublicApiConfig config, Environment environment) throws Exception { final Client client = RestClientFactory.buildClient(config.getRestClientConfig()); environment.getObjectMapper().configure(DeserializationFeature.ACCEPT_FLOAT_AS_INT, false); environment.healthChecks().register("ping", new Ping()); environment.setValidator(Validation.byDefaultProvider() .configure().constraintValidatorFactory(new ConfigurationAwareConstraintValidatorFactory(config)) .buildValidatorFactory() .getValidator()); environment.jersey().register(new PaymentsResource(client, config.getConnectorUrl())); environment.jersey().register(AuthFactory.binder(new OAuthFactory<>(new AccountAuthenticator(client, config.getPublicAuthUrl()), "", String.class))); }
Source:
<code>public AccountInfo getAccountInfo() throws IOException { CoingiBalances coingiBalances; try { coingiBalances = getCoingiBalance(); } catch (CoingiException e) { throw CoingiErrorAdapter.adapt(e); } return CoingiAdapters.adaptAccountInfo( coingiBalances, exchange.getExchangeSpecification().getUserName()); <START> } <END></code><technical_language>easier read if surround entire method this type of try / catch like: @Override public AccountInfo getAccountInfo() throws IOException { try { CoingiBalances coingiBalances = getCoingiBalance(); return CoingiAdapters.adaptAccountInfo( coingiBalances, exchange.getExchangeSpecification().getUserName()); } catch (CoingiException e) { throw CoingiErrorAdapter.adapt(e); } } please apply this hint methods this type of try catch</technical_language>

Target:
public AccountInfo getAccountInfo() throws IOException { try { CoingiBalances coingiBalances = getCoingiBalance(); return CoingiAdapters.adaptAccountInfo( coingiBalances, exchange.getExchangeSpecification().getUserName()); } catch (CoingiException e) { throw CoingiErrorAdapter.adapt(e); } }
Source:
<code>public void judgmentReindexingJob_ON_EMPTY() throws Exception { JobExecution jobExecution = jobLauncher.run(judgmentReindexingJob, createJobParameters()); solrJudgmentsServer.commit(); JobExecutionAssertUtils.assertJobExecution(jobExecution, 0, ALL_JUDGMENTS_COUNT); assertAllMarkedAsIndexed(); assertIndexCount(ALL_JUDGMENTS_COUNT); assertCcJudgment(fetchJudgmentDoc(ccJudgments.get(1).getId()), ccJudgments.get(1), 0L); assertScJudgment(fetchJudgmentDoc(scJudgments.get(0).getId()), scJudgments.get(0), 0L); assertCtJudgment(fetchJudgmentDoc(ctJudgments.get(3).getId()), ctJudgments.get(3), 0L); <START> assertNacJudgment(fetchJudgmentDoc(nacJudgments.get(5).getId()), nacJudgments.get(5), 0L); <END> }</code><technical_language>I add in reindexing ref tag show if updates correctly</technical_language>

Target:
public void judgmentReindexingJob_ON_EMPTY() throws Exception { JobExecution jobExecution = jobLauncher.run(judgmentReindexingJob, createJobParameters()); solrJudgmentsServer.commit(); JobExecutionAssertUtils.assertJobExecution(jobExecution, 0, ALL_JUDGMENTS_COUNT); assertAllMarkedAsIndexed(); assertIndexCount(ALL_JUDGMENTS_COUNT); assertCcJudgment(fetchJudgmentDoc(ccJudgments.get(1).getId()), ccJudgments.get(1), 2L); assertScJudgment(fetchJudgmentDoc(scJudgments.get(0).getId()), scJudgments.get(0), 1L); assertCtJudgment(fetchJudgmentDoc(ctJudgments.get(3).getId()), ctJudgments.get(3), 1L); assertNacJudgment(fetchJudgmentDoc(nacJudgments.get(5).getId()), nacJudgments.get(5), 0L); }
Source:
<code>public MockSCMSource(String controllerId, String repository, List<SCMSourceTrait> traits) { <START> super(); <END> this.controllerId = controllerId; this.repository = repository; this.traits = new ArrayList<SCMSourceTrait>(traits); }</code><technical_language>omitted</technical_language>

Target:
public MockSCMSource(String controllerId, String repository, List<SCMSourceTrait> traits) { this.controllerId = controllerId; this.repository = repository; this.traits = new ArrayList<SCMSourceTrait>(traits); }
Source:
<code>public String toString() { <START> return getForecast() != null ? getForecast().toString() : ""; <END> }</code><technical_language>return getForecast() != null ? getForecast().toString() : "FORECAST IS NULL";</technical_language>

Target:
public String toString() { return getForecast() != null ? getForecast().toString() : "FORECAST IS NULL"; }
Source:
<code>protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.setContentView(R.layout.activity_settings); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); TextView title = (TextView) findViewById(R.id.toolbar_title); toolbar.setTitle(""); <START> title.setText("SETTINGS"); <END> setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); }</code><technical_language>FIXME: front facing strings in strings.xml</technical_language>

Target:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.setContentView(R.layout.activity_settings); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); TextView title = (TextView) findViewById(R.id.toolbar_title); toolbar.setTitle(""); title.setText(R.string.settings); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); }
Source:
<code><START> private String fetchCsvHeader(Configuration conf, String path) throws IOException { <END> FileSystem fs = FileSystem.get(URI.create(path), conf); FSDataInputStream inputStream = fs.open(new Path(path)); String header = new BufferedReader(new InputStreamReader(inputStream)).readLine(); inputStream.close(); fs.close(); return header; }</code><technical_language>try-with-resources here</technical_language>

Target:
private String fetchCsvHeader(Configuration conf, String path) throws IOException { FileSystem fs = FileSystem.get(URI.create(path), conf); try(FSDataInputStream inputStream = fs.open(new Path(path))) { try(BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { return reader.readLine(); } } }
Source:
<code>public void testBigImage(){ <START> final Img<ByteType> in = generateByteArrayTestImg(false, 6, 6); <END> final Img<ByteType> out = generateByteArrayTestImg(false, 6, 6); Cursor<ByteType> cin = in.cursor(); final byte[] data = {7, 8, 9, 1, 2, 3, 7, 9, 8, 1, 3, 2, 8, 7, 9, 2, 1, 3, 8, 9, 7, 2, 3, 1, 9, 7, 8, 3, 1, 2, 9, 8, 7, 3, 2, 1}; for(byte b: data){ cin.next().set(b); } ops.run(DefaultBilateral.class, out, in, 15, 5, 2); final byte[] expected = {8, 7, 6, 4, 4, 2, 8, 7, 6, 4, 4, 2, 8, 7, 6, 4, 4, 2, 8, 7, 6, 4, 4, 2, 8, 7, 6, 4, 3, 2, 8, 7, 6, 4, 3, 2}; Cursor<ByteType> cout = out.cursor(); for(int i = 0; i < expected.length; i++){ assertEquals(cout.next().get(), expected[i]); } }</code><technical_language>replace L19-L26 (and similar instances of pattern) final byte[] data = {...}; final Img<ByteType> in = ArrayImgs.bytes(data, 6, 6);</technical_language>

Target:
public void testBigImage() { final byte[] data = { 7, 8, 9, 1, 2, 3, 7, 9, 8, 1, 3, 2, 8, 7, 9, 2, 1, 3, 8, 9, 7, 2, 3, 1, 9, 7, 8, 3, 1, 2, 9, 8, 7, 3, 2, 1 }; final Img<ByteType> in = ArrayImgs.bytes(data, 6, 6); final Img<ByteType> out = generateByteArrayTestImg(false, 6, 6); ops.run(DefaultBilateral.class, out, in, 15, 5, 2); final byte[] expected = { 8, 7, 6, 4, 3, 2, 8, 7, 6, 4, 3, 2, 8, 7, 6, 4, 3, 2, 8, 7, 6, 4, 3, 2, 8, 7, 6, 4, 3, 2, 8, 7, 6, 4, 3, 2 }; Cursor<ByteType> cout = out.cursor(); for (int i = 0; i < expected.length; i++) { assertEquals(cout.next().get(), expected[i]); } }