auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void setCredentialsRefreshInterval( Integer credentialsRefreshInterval) { <START> this.credentialsRefreshInterval = credentialsRefreshInterval * 1000; <END> }</code><technical_language>this is a surprising hack. please change place is instead sense for a property manipulated this. scheduled expression accept seconds expression s</technical_language>

Target:
public void setCredentialsRefreshInterval( Integer credentialsRefreshInterval) { this.credentialsRefreshInterval = credentialsRefreshInterval; }
Source:
<code>public Collection<ClassDefinition> generate(ExtensionContext input) throws UnableToCompleteException { PrintWriter printWriter = tryCreate(); if (printWriter != null) { mergeTemplate(printWriter); commit(printWriter); registerGinBinding(); } else { getLogger().debug("Jackson Mapper Provider already generated. Returning."); } <START> return Lists.newArrayList(getClassDefinition()); <END> }</code><technical_language>remove guava GWTP</technical_language>

Target:
public Collection<ClassDefinition> generate(ExtensionContext input) throws UnableToCompleteException { PrintWriter printWriter = tryCreate(); if (printWriter != null) { mergeTemplate(printWriter); commit(printWriter); registerGinBinding(); } else { getLogger().debug("Jackson Mapper Provider already generated. Returning."); } return Arrays.asList(getClassDefinition()); }
Source:
<code>public void testConcatDoesNotSkipDuplicateSequencesInSameStream() { DomainEventStream concat = new ConcatenatingDomainEventStream(DomainEventStream.of(event1, event1, event2), DomainEventStream.of(event2, event2, event3), DomainEventStream.of(event3, event4)); assertTrue(concat.hasNext()); assertSame(event1.getPayload(), concat.next().getPayload()); assertSame(event1.getPayload(), concat.next().getPayload()); assertSame(event2.getPayload(), concat.next().getPayload()); <START> assertSame(event3.getPayload(), concat.peek().getPayload()); <END> assertSame(event3.getPayload(), concat.next().getPayload()); assertSame(event4.getPayload(), concat.peek().getPayload()); assertSame(event4.getPayload(), concat.next().getPayload()); assertFalse(concat.hasNext()); }</code><technical_language>removed</technical_language>

Target:
public void testConcatDoesNotSkipDuplicateSequencesInSameStream() { DomainEventStream concat = new ConcatenatingDomainEventStream(DomainEventStream.of(event1, event1, event2), DomainEventStream.of(event2, event2, event3), DomainEventStream.of(event3, event4)); assertTrue(concat.hasNext()); assertSame(event1.getPayload(), concat.next().getPayload()); assertSame(event1.getPayload(), concat.next().getPayload()); assertSame(event2.getPayload(), concat.next().getPayload()); assertSame(event3.getPayload(), concat.next().getPayload()); assertSame(event4.getPayload(), concat.next().getPayload()); assertFalse(concat.hasNext()); }
Source:
<code>public boolean isModified(DirCacheEntry entry, boolean forceContentCheck, boolean checkFilemode, FS fs) { if (entry.isAssumeValid()) return false; if (entry.isUpdateNeeded()) return true; if (getEntryLength() != entry.getLength()) return true; int modeDiff = getEntryRawMode() ^ entry.getRawMode(); if (!checkFilemode) modeDiff &= ~FileMode.EXECUTABLE_FILE.getBits(); if (modeDiff != 0) return true; long cacheLastModified = entry.getLastModified(); long fileLastModified = getEntryLastModified(); if (cacheLastModified % 1000 == 0) fileLastModified = fileLastModified - fileLastModified % 1000; <START> if ((fileLastModified != cacheLastModified) && !forceContentCheck) <END> return true; if (forceContentCheck) { if (fileLastModified == cacheLastModified) return false; else return !getEntryObjectId().equals(entry.getObjectId()); } else { return fileLastModified != cacheLastModified; } }</code><technical_language>this expression redundant? If remove get behavior. forceContentCheck is false fall else below, compares values if != returns true</technical_language>

Target:
public boolean isModified(DirCacheEntry entry, boolean forceContentCheck, boolean checkFilemode, FS fs) { if (entry.isAssumeValid()) return false; if (entry.isUpdateNeeded()) return true; if (getEntryLength() != entry.getLength()) return true; int modeDiff = getEntryRawMode() ^ entry.getRawMode(); if (!checkFilemode) modeDiff &= ~FileMode.EXECUTABLE_FILE.getBits(); if (modeDiff != 0) return true; long cacheLastModified = entry.getLastModified(); long fileLastModified = getEntryLastModified(); if (cacheLastModified % 1000 == 0) fileLastModified = fileLastModified - fileLastModified % 1000; if (forceContentCheck) { if (fileLastModified == cacheLastModified) return false; else return !getEntryObjectId().equals(entry.getObjectId()); } else { return fileLastModified != cacheLastModified; } }
Source:
<code>private CompletableFuture<JobMasterGateway> getJobMasterGateway(JobID jobId) throws FlinkJobNotFoundException, UnavailableDispatcherOperationException { DispatcherJob job = runningJobs.get(jobId); if (job == null) { throw new FlinkJobNotFoundException(jobId); } if (!job.isRunning()) { throw new UnavailableDispatcherOperationException("Unable to get JobMasterGateway for initializing job. " <START> + "The requested operation is not available while the JobManager is still initializing."); <END> } return job.getJobMasterGateway(); }</code><technical_language>suggestion + "The requested operation is while JobManager is initializing.");</technical_language>

Target:
private CompletableFuture<JobMasterGateway> getJobMasterGateway(JobID jobId) { DispatcherJob job = runningJobs.get(jobId); if (job == null) { return FutureUtils.completedExceptionally(new FlinkJobNotFoundException(jobId)); } if (!job.isInitialized()) { return FutureUtils.completedExceptionally(new UnavailableDispatcherOperationException("Unable to get JobMasterGateway for initializing job. " + "The requested operation is not available while the JobManager is initializing.")); } return job.getJobMasterGateway(); }
Source:
<code>public PermissionCollection getUserPermissions(Caller caller, Environment callEnvironment, JmxAction action, JmxTarget target) { <START> return getUserPermissions(roleMapper.mapRoles(caller, callEnvironment, action == null ? null: action.composeAction(),(TargetResource) null)); <END> }</code><technical_language>add a method RoleMapper for this</technical_language>

Target:
public PermissionCollection getUserPermissions(Caller caller, Environment callEnvironment, JmxAction action, JmxTarget target) { return getUserPermissions(roleMapper.mapRoles(caller, callEnvironment, action, target)); }
Source:
<code>public void testImportVMFromConfigurationWhenStorageDomainIsInMaintenance() { initCommand(getOvfEntityData()); StorageDomain storageDomain = createStorageDomain(); storageDomain.setStatus(StorageDomainStatus.Maintenance); doReturn(storageDomain).when(cmd).getStorageDomain(); <START> assertFalse(cmd.canDoAction()); <END> }</code><technical_language>Please CanDoActionAssertUtils</technical_language>

Target:
public void testImportVMFromConfigurationWhenStorageDomainIsInMaintenance() { initCommand(getOvfEntityData()); StorageDomain storageDomain = createStorageDomain(); storageDomain.setStatus(StorageDomainStatus.Maintenance); doReturn(storageDomain).when(cmd).getStorageDomain(); CanDoActionTestUtils.runAndAssertCanDoActionFailure(cmd, VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2); }
Source:
<code>public void startDialog(KSService ks, STTService stt, TTSService tts, HumanLanguageInterpreter hli, AudioSource source, AudioSink sink, Locale locale, String keyword) { ks = (ks == null) ? getKS() : ks; stt = (stt == null) ? getSTT() : stt; tts = (tts == null) ? getTTS() : tts; hli = (hli == null) ? getHLI() : hli; source = (source == null) ? getSource() : source; sink = (sink == null) ? getSink() : sink; locale = (locale == null) ? localeProvider.getLocale() : locale; if (ks != null && stt != null && tts != null && hli != null && source != null && sink != null) { DialogProcessor processor = new DialogProcessor(getKS(), getSTT(), getTTS(), getHLI(), getSource(), <START> getSink(), localeProvider.getLocale(), keyword); <END> processor.start(); } else { String msg = "Cannot start dialog as services are missing."; logger.error(msg); throw new IllegalStateException(msg); } }</code><technical_language>I if reading is correct: - set a variable return variable of getVariable if is null - check if variables differ null - get... for variable calling get function again</technical_language>

Target:
public void startDialog(KSService ks, STTService stt, TTSService tts, HumanLanguageInterpreter hli, AudioSource source, AudioSink sink, Locale locale, String keyword) { ks = (ks == null) ? getKS() : ks; stt = (stt == null) ? getSTT() : stt; tts = (tts == null) ? getTTS() : tts; hli = (hli == null) ? getHLI() : hli; source = (source == null) ? getSource() : source; sink = (sink == null) ? getSink() : sink; locale = (locale == null) ? localeProvider.getLocale() : locale; if (ks != null && stt != null && tts != null && hli != null && source != null && sink != null) { DialogProcessor processor = new DialogProcessor(ks, stt, tts, hli, source, sink, localeProvider.getLocale(), keyword); processor.start(); } else { String msg = "Cannot start dialog as services are missing."; logger.error(msg); throw new IllegalStateException(msg); } }
Source:
<code>public Image bottomLayerMotiveMarkerFor(Entity entity) { Image marker = null; String weightSuffix = EntityWreckHelper.getWeightSuffix(entity); String motivePrefix = EntityWreckHelper.getMotivePrefix(entity); if(motivePrefix != null) { String filename = String.format("%s_decal_%s.png", motivePrefix, weightSuffix); String path = String.format("%s/%s", DIR_NAME_WRECKS, DIR_NAME_BOTTOM_DECALS); <START> int rotationKey = entity.getId() % 4; <END> String imageKey = String.format("%s%s", filename, rotationKey); if(!wreckageDecals.containsKey(imageKey)) { Image baseImage = TilesetManager.LoadSpecificImage(new File(Configuration.unitImagesDir(), path), filename); for(double x = 0; x < 4; x++) { RotateFilter rf = new RotateFilter(x * 90); String newImageKey = String.format("%s%s", filename, (int) x); ImageProducer ip = new FilteredImageSource(baseImage.getSource(), rf); Image resultImage = Toolkit.getDefaultToolkit().createImage(ip); wreckageDecals.put(newImageKey, resultImage); } } marker = wreckageDecals.get(imageKey); } return marker; }</code><technical_language>magic 4</technical_language>

Target:
public Image bottomLayerMotiveMarkerFor(Entity entity) { Image marker = null; String weightSuffix = EntityWreckHelper.getWeightSuffix(entity); String motivePrefix = EntityWreckHelper.getMotivePrefix(entity); if(motivePrefix != null) { String filename = String.format("%s_decal_%s.png", motivePrefix, weightSuffix); String path = String.format("%s/%s", DIR_NAME_WRECKS, DIR_NAME_BOTTOM_DECALS); int rotationKey = entity.getId() % NUM_DECAL_ROTATIONS; String imageKey = String.format("%s%s", filename, rotationKey); if(!wreckageDecals.containsKey(imageKey)) { Image baseImage = TilesetManager.LoadSpecificImage(new File(Configuration.unitImagesDir(), path), filename); for(double x = 0; x < NUM_DECAL_ROTATIONS; x++) { RotateFilter rf = new RotateFilter(x * 90); String newImageKey = String.format("%s%s", filename, (int) x); ImageProducer ip = new FilteredImageSource(baseImage.getSource(), rf); Image resultImage = Toolkit.getDefaultToolkit().createImage(ip); wreckageDecals.put(newImageKey, resultImage); } } marker = wreckageDecals.get(imageKey); } return marker; }
Source:
<code>public void saveAs(OpenWorkpiece openWorkpiece, URI uri) throws IOException { if (uri.equals(openWorkpiece.getUri())) { save(openWorkpiece); } else { LockResult lockResult = openWorkpiece.getLockResult(); if (Objects.isNull(lockResult)) { lockResult = ServiceManager.getFileService().tryLock(uri, LockingMode.EXCLUSIVE); if (!lockResult.isSuccessful()) { throw new IOException(createLockErrorMessage(uri, lockResult.getConflicts())); } openWorkpiece.setLockResult(lockResult); } else { Map<URI, LockingMode> requests = new HashMap<>(2); requests.put(uri, LockingMode.EXCLUSIVE); Map<URI, Collection<String>> conflicts = lockResult.tryLock(requests); if (!conflicts.isEmpty()) { throw new IOException(createLockErrorMessage(uri, conflicts)); } } try (OutputStream out = ServiceManager.getFileService().write(uri, lockResult)) { logger.info("Saving {}", uri.toString()); <START> metsXmlElementAccess.save(openWorkpiece.getWorkpiece(), out); <END> } lockResult.close(openWorkpiece.getUri()); openWorkpiece.setUri(uri); } }</code><technical_language>call method write</technical_language>

Target:
public void saveAs(OpenWorkpiece openWorkpiece, URI uri) throws IOException { if (uri.equals(openWorkpiece.getUri())) { save(openWorkpiece); } else { LockResult lockResult = openWorkpiece.getLockResult(); if (Objects.isNull(lockResult)) { lockResult = ServiceManager.getFileService().tryLock(uri, LockingMode.EXCLUSIVE); if (!lockResult.isSuccessful()) { throw new IOException(createLockErrorMessage(uri, lockResult.getConflicts())); } openWorkpiece.setLockResult(lockResult); } else { Map<URI, LockingMode> requests = new HashMap<>(2); requests.put(uri, LockingMode.EXCLUSIVE); Map<URI, Collection<String>> conflicts = lockResult.tryLock(requests); if (!conflicts.isEmpty()) { throw new IOException(createLockErrorMessage(uri, conflicts)); } } try (OutputStream out = ServiceManager.getFileService().write(uri, lockResult)) { logger.info("Saving {}", uri.toString()); write(openWorkpiece.getWorkpiece(), out); } lockResult.close(openWorkpiece.getUri()); openWorkpiece.setUri(uri); } }
Source:
<code>public void run() { FileManifest manifest = server.fetchManifest(); <START> Gui_JavaFX.getStackMainPane().getPaneSync().getObservMods().clear(); <END> Gui_JavaFX.getStackMainPane().getPaneSync().getPaneProgressBar().getProgressBar().setProgress(0); double n = manifest.entries.size(); double count = 0; for(ManifestEntry entry : manifest.entries){ Gui_JavaFX.getStackMainPane().getPaneSync().getPaneProgressBar().getProgressBar().setProgress(count/n); Gui_JavaFX.getStackMainPane().getPaneSync().getPaneProgressBar().setPathText(entry.path); Gui_JavaFX.getStackMainPane().getPaneSync().getPaneProgressBar().setStatusText("Files updated : " +(int)count+"/"+(int)n); Platform.runLater(() -> Gui_JavaFX.getStackMainPane().getPaneSync().getPaneProgressBar().updateGUI()); Path file = entry.resolvePath(); Logger.debug(String.format("Starting check for file: %s", file)); if (!entry.redirectTo.equals("")) { Logger.debug(String.format( "File: %s, redirected from: %s to %s", file.getFileName(), entry.path, file )); } if (Files.exists(file)) { String hash = FileHash.hashFile(file); if (entry.hash.equals(hash)) { Logger.debug("File already exists"); }else{ server.updateIndividualFile(entry, file); } }else{ server.updateIndividualFile(entry, file); } Gui_JavaFX.getStackMainPane().getPaneSync().getObservMods().add(new Mod(entry.path, EValid.UPTODATE,false)); count++; }; Gui_JavaFX.getStackMainPane().getPaneSync().getPaneProgressBar().getProgressBar().setProgress(count/n); Gui_JavaFX.getStackMainPane().getPaneSync().getPaneProgressBar().setStatusText("Files updated : " +(int)count+"/"+(int)n); Gui_JavaFX.getStackMainPane().getPaneSync().getPaneProgressBar().setPathText("Done!"); Platform.runLater(() -> Gui_JavaFX.getStackMainPane().getPaneSync().getPaneProgressBar().updateGUI()); }</code><technical_language>sync need agnositc of GUI, need change this command line intact</technical_language>

Target:
public void run() { FileManifest manifest = server.fetchManifest(); manifest.files .forEach(entry -> { Path file = entry.resolvePath(); Logger.debug(String.format("Starting check for file: %s", file)); if (!entry.redirectTo.equals("")) { Logger.debug(String.format( "File: %s, redirected from: %s to %s", file.getFileName(), entry.path, file )); } if (Files.exists(file)) { String hash = FileHash.hashFile(file); if (entry.hash.equals(hash)) { Logger.debug("File already exists"); } } }); }
Source:
<code>public void testMap() throws Exception { String[] tableNames = getUniqueNames(2); String table1 = tableNames[0]; String table2 = tableNames[1]; try (AccumuloClient c = getAccumuloClient()) { c.tableOperations().create(table1); c.tableOperations().create(table2); BatchWriter bw = c.createBatchWriter(table1, new BatchWriterConfig()); BatchWriter bw2 = c.createBatchWriter(table2, new BatchWriterConfig()); for (int i = 0; i < 100; i++) { Mutation t1m = new Mutation(new Text(String.format("%s_%09x", table1, i + 1))); t1m.put(new Text(), new Text(), new Value(String.format("%s_%09x", table1, i).getBytes())); bw.addMutation(t1m); Mutation t2m = new Mutation(new Text(String.format("%s_%09x", table2, i + 1))); t2m.put(new Text(), new Text(), new Value(String.format("%s_%09x", table2, i).getBytes())); bw2.addMutation(t2m); } bw.close(); bw2.close(); MRTester.main(new String[] {table1, table2}); <START> assertNull(e1); <END> assertNull(e2); } }</code><technical_language>test strong enough. error occur, do 200 entries tables read</technical_language>

Target:
public void testMap() throws Exception { String[] tableNames = getUniqueNames(2); String table1 = tableNames[0]; String table2 = tableNames[1]; try (AccumuloClient c = createAccumuloClient()) { c.tableOperations().create(table1); c.tableOperations().create(table2); BatchWriter bw = c.createBatchWriter(table1, new BatchWriterConfig()); BatchWriter bw2 = c.createBatchWriter(table2, new BatchWriterConfig()); for (int i = 0; i < 100; i++) { Mutation t1m = new Mutation(new Text(String.format("%s_%09x", table1, i + 1))); t1m.put(new Text(), new Text(), new Value(String.format("%s_%09x", table1, i).getBytes())); bw.addMutation(t1m); Mutation t2m = new Mutation(new Text(String.format("%s_%09x", table2, i + 1))); t2m.put(new Text(), new Text(), new Value(String.format("%s_%09x", table2, i).getBytes())); bw2.addMutation(t2m); } bw.close(); bw2.close(); MRTester.main(new String[] {table1, table2}); assertNull(e1); assertNull(e2); } }
Source:
<code>protected long getEngineSessionSeqId() { <START> return SessionDataContainer.getInstance().getEngineSessionSeqId(engineContext.getSessionId()); <END> }</code><technical_language>want check if session id is null well</technical_language>

Target:
protected long getEngineSessionSeqId() { if (engineContext.getSessionId() == null) { throw new RuntimeException("No sessionId found for query " + getClass().getName()); } return SessionDataContainer.getInstance().getEngineSessionSeqId(engineContext.getSessionId()); }
Source:
<code>protected void assertIsLegalCell(final int row, final int column) { int rowCount = rowCount(); int columnCount = columnCount(); Assert.isLegal(row < rowCount, "The row number (" + row + ") is more than the number of <START> rows(" + <END> rowCount + ") in the table."); Assert.isLegal((column < columnCount) || ((columnCount == 0) && (column == 0)), "The column number (" + column + ") is more than the number of column(" + columnCount + ") in the table."); }</code><technical_language>space</technical_language>

Target:
protected void assertIsLegalCell(final int row, final int column) { int rowCount = rowCount(); int columnCount = columnCount(); Assert.isLegal(row < rowCount, "The row number (" + row + ") is more than the number of rows (" + rowCount + ") in the table."); Assert.isLegal((column < columnCount) || ((columnCount == 0) && (column == 0)), "The column number (" + column + ") is more than the number of columns (" + columnCount + ") in the table."); }
Source:
<code>public EntityVampirism(World world) { super(world); moveTowardsRestriction = new EntityAIMoveTowardsRestriction(this, 1.0F); <START> this.actionTasks = new EntityAITasks(world != null && world.profiler != null ? world.profiler : null); <END> setAvailableActions(); if (world != null && !world.isRemote) { this.initEntityAI1(); } }</code><technical_language>Do need EntityAITasks. is a single actual AITask added this list, add task normal tasks list perform task update in onUpdate method</technical_language>

Target:
public EntityVampirism(World world) { super(world); setupEntityClass(); moveTowardsRestriction = new EntityAIMoveTowardsRestriction(this, 1.0F); }
Source:
<code>public void testCompareWithTrackChanges() throws Exception { File tmpFile1 = File.createTempFile("File1", ".xml"); File tmpFile2 = File.createTempFile("File2", ".xml"); File diffFile = File.createTempFile("Diff", ".xml"); <START> File scriptFile = File.createTempFile("script", ".vbs"); <END> try { FileOutputStream stream1 = new FileOutputStream(tmpFile1); FileOutputStream stream2 = new FileOutputStream(tmpFile2); String content = Lib.fileToString(getClass(), TEST_WORD_EDIT_FILE_NAME); byte[] bytes = content.getBytes(); stream1.write(bytes); stream1.close(); content = content.replace("methods", "functions"); bytes = content.getBytes(); stream2.write(bytes); stream2.close(); CompareData compareData = new CompareData(diffFile.getAbsolutePath(), scriptFile.getAbsolutePath()); compareData.add(tmpFile1.getAbsolutePath(), tmpFile2.getAbsolutePath()); VbaWordDiffGenerator diff = new VbaWordDiffGenerator(false, false, false, true, false); diff.generate(compareData); InputStream diffStream = new FileInputStream(diffFile); String theDiff = Lib.inputStreamToString(diffStream); diffStream.close(); theDiff = removeDynamicInformation(theDiff); String expected = Lib.fileToString(getClass(), EXPECTED_WORD_DIFF_FILE_NAME); Assert.assertEquals(expected, theDiff); } finally { tmpFile1.delete(); tmpFile2.delete(); scriptFile.delete(); diffFile.delete(); } }</code><technical_language>Junit Rule - TemporaryFolder instead of File.createTempFile.... ImportTraceUnitsOperationTest for example</technical_language>

Target:
public void testCompareWithTrackChanges() throws Exception { TemporaryFolder tempFolder = new TemporaryFolder(); File tmpFile1 = tempFolder.newFile("File1.xml"); File tmpFile2 = tempFolder.newFile("File2.xml"); File diffFile = tempFolder.newFile("Diff.xml"); File scriptFile = tempFolder.newFile("script.vbs"); String content = Lib.fileToString(getClass(), TEST_WORD_EDIT_FILE_NAME); Lib.writeStringToFile(content, tmpFile1); content = content.replace("methods", "functions"); Lib.writeStringToFile(content, tmpFile2); CompareData compareData = new CompareData(diffFile.getAbsolutePath(), scriptFile.getAbsolutePath()); compareData.add(tmpFile1.getAbsolutePath(), tmpFile2.getAbsolutePath()); VbaWordDiffGenerator diff = new VbaWordDiffGenerator(false, false, false, true, false); diff.generate(compareData); String theDiff = Lib.fileToString(diffFile); theDiff = removeDynamicInformation(theDiff); String expected = Lib.fileToString(getClass(), EXPECTED_WORD_DIFF_FILE_NAME); Assert.assertEquals(expected, theDiff); }
Source:
<code>private void updateActionEnablement(ISelection selection) { if (!(selection instanceof IStructuredSelection)) return; IStructuredSelection sel = (IStructuredSelection) selection; boolean allSelected = !sel.isEmpty() && sel.size() == getTable().getItemCount(); boolean submoduleSelected = false; for (Object item : sel.toArray()) if (((FileDiff) item).isSubmodule()) { submoduleSelected = true; break; } selectAll.setEnabled(!allSelected); copy.setEnabled(!sel.isEmpty()); if (!submoduleSelected) { boolean oneOrMoreSelected = !sel.isEmpty(); open.setEnabled(oneOrMoreSelected); compare.setEnabled(sel.size() == 1); blame.setEnabled(oneOrMoreSelected); if (sel.size() == 1) { FileDiff diff = (FileDiff) sel.getFirstElement(); boolean workTreeFileExists = false; if (diff.getChange() != ChangeType.DELETE) { String path = new Path(getRepository().getWorkTree() .getAbsolutePath()).append(diff.getNewPath()) .toOSString(); workTreeFileExists = new File(path).exists(); <START> } <END> compareWorkingTreeVersion.setEnabled(workTreeFileExists); openWorkingTreeVersion.setEnabled(workTreeFileExists); } else { compareWorkingTreeVersion.setEnabled(false); openWorkingTreeVersion.setEnabled(oneOrMoreSelected); } } else { open.setEnabled(false); openWorkingTreeVersion.setEnabled(false); compare.setEnabled(false); blame.setEnabled(false); compareWorkingTreeVersion.setEnabled(false); } }</code><technical_language>I meant. I asking diff.getPath here, returns path in case of a delete. useful able open a file deleted in a commit restored. change getPath change in Action#run? :)</technical_language>

Target:
private void updateActionEnablement(ISelection selection) { if (!(selection instanceof IStructuredSelection)) return; IStructuredSelection sel = (IStructuredSelection) selection; boolean allSelected = !sel.isEmpty() && sel.size() == getTable().getItemCount(); boolean submoduleSelected = false; for (Object item : sel.toArray()) if (((FileDiff) item).isSubmodule()) { submoduleSelected = true; break; } selectAll.setEnabled(!allSelected); copy.setEnabled(!sel.isEmpty()); if (!submoduleSelected) { boolean oneOrMoreSelected = !sel.isEmpty(); open.setEnabled(oneOrMoreSelected); compare.setEnabled(sel.size() == 1); blame.setEnabled(oneOrMoreSelected); if (sel.size() == 1) { FileDiff diff = (FileDiff) sel.getFirstElement(); String path = new Path(getRepository().getWorkTree() .getAbsolutePath()).append(diff.getPath()) .toOSString(); boolean workTreeFileExists = new File(path).exists(); compareWorkingTreeVersion.setEnabled(workTreeFileExists); openWorkingTreeVersion.setEnabled(workTreeFileExists); } else { compareWorkingTreeVersion.setEnabled(false); openWorkingTreeVersion.setEnabled(oneOrMoreSelected); } } else { open.setEnabled(false); openWorkingTreeVersion.setEnabled(false); compare.setEnabled(false); blame.setEnabled(false); compareWorkingTreeVersion.setEnabled(false); } }
Source:
<code>public void testSetupActions() { Context context = getInstrumentation().getTargetContext(); View layout = mock(View.class); View view1 = new View(context); view1.setId(1); View view3 = new View(context); view3.setId(3); ListView listView = new ListView(context); listView.setId(2); setupActionList(); setupActionGetViewId(); setupTriggerType(); when(layout.findViewById(1)).thenReturn(view1); when(layout.findViewById(2)).thenReturn(listView); when(layout.findViewById(3)).thenReturn(view3); <START> ComponentActionManager actionManager = new ComponentActionManager(actionList); <END> actionManager.setupActions(layout); }</code><technical_language>is tested / asserted here. verifyong setting expectations</technical_language>

Target:
public void testSetupActions() { Context context = getInstrumentation().getTargetContext(); View layout = mock(View.class); View view1 = new View(context); view1.setId(1); View view3 = new View(context); view3.setId(3); ListView listView = new ListView(context); listView.setId(2); setupActionList(); when(layout.findViewById(1)).thenReturn(view1); when(layout.findViewById(2)).thenReturn(listView); when(layout.findViewById(3)).thenReturn(view3); ComponentActionManager actionManager = new ComponentActionManager(actionList); actionManager.setupActions(layout); }
Source:
<code>public void testVarchars() throws Exception { tester.testRoundTrip(VARCHAR, newArrayList(limit(cycle(ImmutableList.of("apple", "apple pie", "apple\uD835\uDC03", "apple\uFFFD")), NUM_ROWS)), stringEquals(false, "apple")); tester.testRoundTrip(VARCHAR, intsBetween(0, NUM_ROWS).stream().map(Object::toString).collect(toList()), stringIn(false, "10", "11"), stringIn(true, "10", "11"), stringBetween(false, "14", "10")); tester.testRoundTripTypes( ImmutableList.of(VARCHAR, VARCHAR), ImmutableList.of( intsBetween(0, NUM_ROWS).stream().map(Object::toString).collect(toList()), newArrayList(limit(cycle(ImmutableList.of("A", "B", "C")), NUM_ROWS))), toSubfieldFilters(ImmutableMap.of( 0, stringBetween(true, "16", "10"), 1, stringBetween(false, "B", "A")))); tester.testRoundTrip(VARCHAR, newArrayList(concat(ImmutableList.of("a"), nCopies(9999, "123"), ImmutableList.of("b"), nCopies(9999, "123")))); <START> tester.testRoundTrip(VARCHAR, nCopies(NUM_ROWS, ""), BytesRange.of("".getBytes(), false, "".getBytes(), false, false)); <END> List<Integer> values = newArrayList(limit( cycle(concat( ImmutableList.of(1), nCopies(9999, 123), ImmutableList.of(2), nCopies(9999, 123), ImmutableList.of(3), nCopies(9999, 123), nCopies(1_000_000, null))), 200_000)); tester.assertRoundTrip( VARCHAR, newArrayList(values).stream() .map(value -> value == null ? null : String.valueOf(value)) .collect(toList())); tester.testRoundTrip( VARCHAR, newArrayList(limit(cycle(ImmutableList.of(1, 3, 5, 7, 11, 13, 17)), 200_000)).stream() .map(Object::toString) .collect(toList())); }</code><technical_language>stringEquals: stringEquals(false, "")</technical_language>

Target:
public void testVarchars() throws Exception { tester.testRoundTrip(VARCHAR, newArrayList(limit(cycle(ImmutableList.of("apple", "apple pie", "apple\uD835\uDC03", "apple\uFFFD")), NUM_ROWS)), stringEquals(false, "apple")); tester.testRoundTrip(VARCHAR, intsBetween(0, NUM_ROWS).stream().map(Object::toString).collect(toList()), stringIn(false, "10", "11"), stringIn(true, "10", "11"), stringBetween(false, "14", "10")); tester.testRoundTripTypes( ImmutableList.of(VARCHAR, VARCHAR), ImmutableList.of( intsBetween(0, NUM_ROWS).stream().map(Object::toString).collect(toList()), newArrayList(limit(cycle(ImmutableList.of("A", "B", "C")), NUM_ROWS))), toSubfieldFilters(ImmutableMap.of( 0, stringBetween(true, "16", "10"), 1, stringBetween(false, "B", "A")))); tester.testRoundTrip(VARCHAR, newArrayList(concat(ImmutableList.of("a"), nCopies(9999, "123"), ImmutableList.of("b"), nCopies(9999, "123")))); tester.testRoundTrip(VARCHAR, nCopies(NUM_ROWS, ""), stringEquals(false, "")); List<Integer> values = newArrayList(limit( cycle(concat( ImmutableList.of(1), nCopies(9999, 123), ImmutableList.of(2), nCopies(9999, 123), ImmutableList.of(3), nCopies(9999, 123), nCopies(1_000_000, null))), 200_000)); tester.assertRoundTrip( VARCHAR, newArrayList(values).stream() .map(value -> value == null ? null : String.valueOf(value)) .collect(toList())); tester.testRoundTrip( VARCHAR, newArrayList(limit(cycle(ImmutableList.of(1, 3, 5, 7, 11, 13, 17)), 200_000)).stream() .map(Object::toString) .collect(toList())); }
Source:
<code>public void testBinaryComparisonTypeTemplated() { FilterNode node = builder .beginBinaryComparisonType("=") .setProperty("name") .setTemplatedValues("5", "id", true, false) .endBinaryComparisonType() .getResult(); assertThat(node.getType(), is("=")); assertThat(node.getNodes(), is(nullValue())); assertThat(node.isLeaf(), is(true)); assertThat(FilterLeafNode.class.isInstance(node), is(true)); FilterLeafNode leaf = (FilterLeafNode) node; assertThat(leaf.getProperty(), is("name")); assertThat(leaf.getValue(), is(nullValue())); assertThat(leaf.isTemplated(), is(true)); <START> assertThat(FilterTemplatedLeafNode.class.isInstance(leaf), is(true)); <END> FilterTemplatedLeafNode template = (FilterTemplatedLeafNode) leaf; assertThat(template.getDefaultValue(), is("5")); assertThat(template.getNodeId(), is("id")); assertThat(template.isVisible(), is(true)); assertThat(template.isReadOnly(), is(false)); }</code><technical_language>This unit test assertions</technical_language>

Target:
public void testBinaryComparisonTypeTemplated() { FilterNode node = builder .beginBinaryComparisonType("=") .setProperty("name") .setTemplatedValues("5", "id", true, false) .endTerminalType() .getResult(); assertTemplatedNode(node, "=", "name", "5", "id"); }
Source:
<code>public void save() { try { doSave(); } catch(CoreException e) { GdbPlugin.log(e); } <START> } <END></code><technical_language>reason create doSave ? extenders able override 'save()'</technical_language>

Target:
public void save() { IRegisterGroupDescriptor[] groups = buildDescriptors(); ILaunchConfiguration launchConfig = getLaunchConfig(); if (launchConfig != null) { RegisterGroupsPersistance serializer = new RegisterGroupsPersistance(launchConfig); try { serializer.saveGroups(groups); } catch (CoreException e) { GdbPlugin.log(e); } } }
Source:
<code>public static boolean intArrayContains(int[] source, int target) { <START> for (int sort: source) { <END> if (sort == target) { return true; } } return false; }</code><technical_language>This variable called more generic instead of sort int</technical_language>

Target:
public static boolean intArrayContains(int[] source, int target) { for (int current: source) { if (current == target) { return true; } } return false; }
Source:
<code>public boolean getUserHasPermissions(String userName, String domain) throws SQLException { ResultSet resultSet = null; try (Connection connection = ds.getConnection(); PreparedStatement prepareStatement = connection.prepareStatement(selectQuery);) { log.info("getPermissionsForUser username: " + userName + " domain: " + domain); <START> prepareStatement.setString(1, userName); <END> prepareStatement.setString(2, domain); resultSet = prepareStatement.executeQuery(); if (resultSet.next()) { return true; } } finally { if (resultSet != null) { resultSet.close(); } } return false; }</code><technical_language>not: boolean ret = false; try( Connection connection = ds.getConnection(); PreparedStatement prepareStatement = connection.prepareStatement(selectQuery); ) { prepareStatement.setString(1, userName); prepareStatement.setString(2, domain); try (resultSet = prepareStatement.executeQuery()) { if (resultSet.next()) { ret = true; } } } return ret; problem continue check... do need understand if provide database access detach engine... in this case is important this vdc_options in future anyway. configuration information environment ENGINE_DEFAULTS, ENGINE_VARS. I move LocalConfig uutils</technical_language>

Target:
public boolean getUserHasPermissions(String userName, String domain) throws SQLException { boolean result = false; try (Connection connection = ds.getConnection(); PreparedStatement prepareStatement = connection.prepareStatement(selectQuery);) { log.info("getPermissionsForUser username: " + userName + " domain: " + domain); prepareStatement.setString(1, userName); prepareStatement.setString(2, domain); try (ResultSet resultSet = prepareStatement.executeQuery()) { result = resultSet.next(); } } return result; }
Source:
<code>public SubmissionStepConfig(Map<String, String> stepMap) { id = stepMap.get("id"); String s = stepMap.get("mandatory"); if (s != null) { mandatory = BooleanUtils.toBoolean(s); } heading = stepMap.get("heading"); processingClassName = stepMap.get("processing-class"); type = stepMap.get("type"); scope = stepMap.get("scope"); visibility = stepMap.get("scope.visibility"); <START> visibilityOutside = stepMap.get("scope.visibilityOustside"); <END> }</code><technical_language>This a typo</technical_language>

Target:
public SubmissionStepConfig(Map<String, String> stepMap) { id = stepMap.get("id"); String s = stepMap.get("mandatory"); if (s != null) { mandatory = BooleanUtils.toBoolean(s); } heading = stepMap.get("heading"); processingClassName = stepMap.get("processing-class"); type = stepMap.get("type"); scope = stepMap.get("scope"); visibility = stepMap.get("scope.visibility"); visibilityOutside = stepMap.get("scope.visibilityOutside"); }
Source:
<code>public static void insertUpdates(final DB database, final String[] users, final String objectAffectedId, final String classification) { if (users == null) { LOG.error("There are no users for this school item"); return; } for (int i = 0; i < users.length; i++) { try { UpdateManager.mongoInsertUpdate(database, users[i], objectAffectedId, TimeManager.getSystemTime(), classification); } catch (AuthenticationException | DatabaseAccessException e) { <START> LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); <END> } } }</code><technical_language>this error info</technical_language>

Target:
public static void insertUpdates(final DB database, final String[] users, final String objectAffectedId, final String classification) { if (users == null) { LOG.error("There are no users for this school item"); return; } for (int i = 0; i < users.length; i++) { try { UpdateManager.mongoInsertUpdate(database, users[i], objectAffectedId, TimeManager.getSystemTime(), classification); } catch (AuthenticationException | DatabaseAccessException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } } }
Source:
<code>public void table() { BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.TABLE)); assertTrue(strategies.getBlockStrategy(BlockType.TABLE) instanceof SupportedBlockStrategy); <START> assertTrue(strategies.getBlockStrategy(BlockType.TABLE_ROW) instanceof SupportedBlockStrategy); <END> assertTrue(strategies.getBlockStrategy(BlockType.TABLE_CELL_HEADER) instanceof SupportedBlockStrategy); assertTrue(strategies.getBlockStrategy(BlockType.TABLE_CELL_NORMAL) instanceof SupportedBlockStrategy); }</code><technical_language>a crosscheck supported default</technical_language>

Target:
public void table() { BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.TABLE)); assertSupported(strategies, BlockType.TABLE); assertSupported(strategies, BlockType.TABLE_ROW); assertSupported(strategies, BlockType.TABLE_CELL_HEADER); assertSupported(strategies, BlockType.TABLE_CELL_NORMAL); }
Source:
<code>public void updateArchive(F target, ExecutionResult executionResult, double fitnessValue) { assert target != null; assert this.archive.containsKey(target); assert fitnessValue >= 0.0; ExecutionResult executionResultClone = executionResult.clone(); T solutionClone = (T) executionResultClone.test.clone(); executionResultClone.setTest(solutionClone); if (!executionResultClone.noThrownExceptions()) { solutionClone.chop(executionResultClone.getFirstPositionOfThrownException() + 1); } boolean isNewCoveredTarget = this.archive.get(target).addSolution( <START> 1.0 - (fitnessValue <= 1.0 ? fitnessValue : FitnessFunction.normalize(fitnessValue)), <END> solutionClone); if (isNewCoveredTarget) { this.removeNonCoveredTargetOfAMethod(target); this.hasBeenUpdated = true; } }</code><technical_language>unsure if this is correct... if normalizing, normalize? I mean, happen if a normalized 1.x a a non-normalized 0.9999</technical_language>

Target:
public void updateArchive(F target, ExecutionResult executionResult, double fitnessValue) { assert target != null; assert this.archive.containsKey(target); assert fitnessValue >= 0.0; ExecutionResult executionResultClone = executionResult.clone(); T solutionClone = (T) executionResultClone.test.clone(); executionResultClone.setTest(solutionClone); if (!executionResultClone.noThrownExceptions()) { solutionClone.chop(executionResultClone.getFirstPositionOfThrownException() + 1); } boolean isNewCoveredTarget = this.archive.get(target) .addSolution(1.0 - FitnessFunction.normalize(fitnessValue), solutionClone); if (isNewCoveredTarget) { this.removeNonCoveredTargetOfAMethod(target); this.hasBeenUpdated = true; } }
Source:
<code>public void handleResponsePacket(Packet packet) { try { lock.lock(); if (packet instanceof StateResponse) { handleLightStatus((StateResponse) packet); } else if (packet instanceof StatePowerResponse) { handlePowerStatus((StatePowerResponse) packet); } else if (packet instanceof StateLightPowerResponse) { handleLightPowerStatus((StateLightPowerResponse) packet); } else if (packet instanceof StateLightInfraredResponse) { handleInfraredStatus((StateLightInfraredResponse) packet); } else if (packet instanceof StateMultiZoneResponse) { handleMultiZoneStatus((StateMultiZoneResponse) packet); } if (currentLightState.isOnline() && !wasOnline) { wasOnline = true; logger.trace("{} : The light just went online, immediately polling the state of the light", macAsHex); sendLightStateRequests(); } <START> } catch (Exception e) { <END> logger.error("Error occurred while handling response packet", e); } finally { lock.unlock(); } }</code><technical_language>Do need catch checked Exception, too? catch exceptions thrown (and uncatched / runtime exception)</technical_language>

Target:
public void handleResponsePacket(Packet packet) { try { lock.lock(); if (packet instanceof StateResponse) { handleLightStatus((StateResponse) packet); } else if (packet instanceof StatePowerResponse) { handlePowerStatus((StatePowerResponse) packet); } else if (packet instanceof StateLightPowerResponse) { handleLightPowerStatus((StateLightPowerResponse) packet); } else if (packet instanceof StateLightInfraredResponse) { handleInfraredStatus((StateLightInfraredResponse) packet); } else if (packet instanceof StateMultiZoneResponse) { handleMultiZoneStatus((StateMultiZoneResponse) packet); } if (currentLightState.isOnline() && !wasOnline) { wasOnline = true; logger.trace("{} : The light just went online, immediately polling the state of the light", macAsHex); sendLightStateRequests(); } } finally { lock.unlock(); } }
Source:
<code>public void setPmOptionsMap(HashMap<String, String> value) { String pmOptions = ""; for (Map.Entry<String, String> pair : value.entrySet()) { String k = pair.getKey(); String v = pair.getValue(); if (StringHelper.stringsEqual(k, PmPortKey)) { getPmPort().setEntity(StringHelper.isNullOrEmpty(value.get(k)) ? "" : value.get(k)); } else if (StringHelper.stringsEqual(k, PmSlotKey)) { getPmSlot().setEntity(StringHelper.isNullOrEmpty(value.get(k)) ? "" : value.get(k)); } else if (StringHelper.stringsEqual(k, PmSecureKey)) { getPmSecure().setEntity(Boolean.parseBoolean(value.get(k))); } else { if (StringHelper.isNullOrEmpty(v)) { pmOptions += k + ","; } else { <START> pmOptions += k + "=" + v + ","; END> } } } if (!StringHelper.isNullOrEmpty(pmOptions)) { getPmOptions().setEntity(pmOptions.substring(0, pmOptions.length() - 1)); } }</code><technical_language>StringBuilder string manipulation happening loop</technical_language>

Target:
public void setPmOptionsMap(HashMap<String, String> value) { StringBuilder pmOptions = new StringBuilder(); for (Map.Entry<String, String> pair : value.entrySet()) { String k = pair.getKey(); String v = pair.getValue(); if (StringHelper.stringsEqual(k, PmPortKey)) { getPmPort().setEntity(StringHelper.isNullOrEmpty(value.get(k)) ? "" : value.get(k)); } else if (StringHelper.stringsEqual(k, PmSlotKey)) { getPmSlot().setEntity(StringHelper.isNullOrEmpty(value.get(k)) ? "" : value.get(k)); } else if (StringHelper.stringsEqual(k, PmSecureKey)) { getPmSecure().setEntity(Boolean.parseBoolean(value.get(k))); } else { if (StringHelper.isNullOrEmpty(v)) { pmOptions.append(k).append(","); } else { pmOptions.append(k).append("=").append(v).append(","); } } } String pmOptionsValue = pmOptions.toString(); if (!StringHelper.isNullOrEmpty(pmOptionsValue)) { getPmOptions().setEntity(pmOptionsValue.substring(0, pmOptionsValue.length() - 1)); } }
Source:
<code>private void populateAnnouncements(List<AnnouncementsModel> announcementsList) { if(announcementsList !=null && announcementsList.size()>0) { hideEmptyAnnouncementMessage(); try{ String cssFileContent = FileUtil.loadTextFileFromAssets(getActivity(), "css/handouts-announcements.css"); StringBuffer buff = new StringBuffer(); <START> buff.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"); <END> buff.append("<head>"); buff.append("<style>"); buff.append(cssFileContent); buff.append("</style>"); buff.append("</head>"); for (AnnouncementsModel m : announcementsList) { buff.append("<div class=\"announcement-header\">"); buff.append(m.getDate()); buff.append("</div>"); buff.append("<div class=\"announcement-separator\"></div>"); buff.append("<div class=\"announcement\">"); buff.append(m.getContent()); buff.append("</div>"); } announcementWebView.clearCache(true); announcementWebView.loadDataWithBaseURL(environment.getConfig().getApiHostURL(), buff.toString(), "text/html", HTTP.UTF_8, null); } catch (IOException e) { logger.error(e); } } else { showEmptyAnnouncementMessage(); } }</code><technical_language>This tag head</technical_language>

Target:
private void populateAnnouncements(List<AnnouncementsModel> announcementsList) { if (announcementsList != null && announcementsList.size() > 0) { hideEmptyAnnouncementMessage(); StringBuffer buff = new StringBuffer(); buff.append("<head>"); buff.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"); try { String cssFileContent = FileUtil.loadTextFileFromAssets(getActivity(), "css/handouts-announcements.css"); buff.append("<style>"); buff.append(cssFileContent); buff.append("</style>"); } catch (IOException e) { logger.error(e); } buff.append("</head>"); buff.append("<body>"); for (AnnouncementsModel m : announcementsList) { buff.append("<div class=\"announcement-header\">"); buff.append(m.getDate()); buff.append("</div>"); buff.append("<div class=\"announcement-separator\"></div>"); buff.append("<div class=\"announcement\">"); buff.append(m.getContent()); buff.append("</div>"); } buff.append("</body>"); announcementWebView.clearCache(true); announcementWebView.loadDataWithBaseURL(environment.getConfig().getApiHostURL(), buff.toString(), "text/html", HTTP.UTF_8, null); } else { showEmptyAnnouncementMessage(); } }
Source:
<code><START> public boolean isConnectionSetup() <END> { return (connection != null); }</code><technical_language>I is isConnectionSetup() necessary. Shared in SharedPubSubWebSocket client means is shareable support concurrency. responsibility of SharedPubSubWebSocket ensure state is properly managed if setup() called concurrently, enforce it</technical_language>

Target:
protected boolean isConnectionSetup() { return (connection != null); }
Source:
<code>public static JavaVersion fromString(String javaVersion) { Matcher javaVersionMatcher = JAVA_8_VERSION_PATTERN.matcher(javaVersion); if (javaVersionMatcher.find()) { return new JavaVersion(Integer.parseInt(javaVersionMatcher.group(1)), Integer.parseInt(javaVersionMatcher.group(2)), Integer.parseInt(javaVersionMatcher.group(3)), Integer.parseInt(javaVersionMatcher.group(4)), Integer.parseInt((javaVersionMatcher.group(6) != null ? javaVersionMatcher.group(6) : "0"))); } else { logger.error("Java version not valid"); <START> return null; <END> } }</code><technical_language>Instead of returning null, throw exception? handle case of finding unknown Java version well. Right NPE do comparison</technical_language>

Target:
public static JavaVersion fromString(String javaVersion) throws IllegalArgumentException { Matcher javaVersionMatcher = JAVA_8_VERSION_PATTERN.matcher(javaVersion); if (!javaVersionMatcher.find()) { throw new IllegalArgumentException(String.format(EXCEPTION_STRING_NOT_JAVA_VERSION, javaVersion)); } return new JavaVersion(Integer.parseInt(javaVersionMatcher.group(1)), Integer.parseInt(javaVersionMatcher.group(2)), Integer.parseInt(javaVersionMatcher.group(3)), Integer.parseInt(javaVersionMatcher.group(4)), Integer.parseInt((javaVersionMatcher.group(6) != null ? javaVersionMatcher.group(6) : "0"))); }
Source:
<code>public void testWorkingWhile() throws WordsRuntimeException { environment.createObject("Fred", "thing", new WordsPosition(0,0)); LNodeReference fredLNodeRef = new LNodeReference("Fred's"); INodeReferenceList fredRefList = new INodeReferenceList(fredLNodeRef); AST statementList = new INodeStatementList(new INodeAssign(fredRefList, new LNodeIdentifier("row"), new LNodeNum(environment.getObject("Fred").getCurrentCell().x++))); AST relation = new INodeLess(new LNodeNum(environment.getObject("Fred").getCurrentCell().x), new LNodeNum(2)); AST testNode = new INodeWhile(relation, statementList); <START> loop.enqueueAST(testNode); <END> loop.fastForwardEnvironment(2); assertEquals("Fred has moved correctly", environment.getObject("Fred").getCurrentCell(), new WordsPosition(2,0)); }</code><technical_language>minor change suggest is replace lines 25:26 a single line, is testNode.eval(). Alternatively, leave is, for clarity I fastForwardEnvironment 1, 2, environment needs frame encounter process while loop. said, this is for clarity, test work, OK is</technical_language>

Target:
public void testWorkingWhile() throws WordsRuntimeException { environment.createObject("Fred", "thing", new WordsPosition(0,0)); LNodeReference fredLNodeRef = new LNodeReference("Fred's"); INodeReferenceList fredRefList = new INodeReferenceList(fredLNodeRef); AST statementList = new INodeStatementList(new INodeAssign(fredRefList, new LNodeIdentifier("row"), new LNodeNum(environment.getObject("Fred").getCurrentCell().x++))); AST relation = new INodeLess(new LNodeNum(environment.getObject("Fred").getCurrentCell().x), new LNodeNum(2)); AST testNode = new INodeWhile(relation, statementList); testNode.eval(environment); loop.fastForwardEnvironment(1); assertEquals("Fred has moved correctly", environment.getObject("Fred").getCurrentCell(), new WordsPosition(2,0)); }