auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void saveConcept_shouldSaveAConceptNumericAsAConcept() throws Exception { executeDataSet(INITIAL_CONCEPTS_XML); Context.setLocale(Locale.US); Concept c2 = new Concept(2); ConceptName cn = new ConceptName("not a numeric anymore", Locale.US); c2.addName(cn); <START> c2.addDescription(new ConceptDescription("some description",Context.getLocale())); <END> c2.setDatatype(new ConceptDatatype(3)); conceptService.saveConcept(c2); Concept secondConcept = conceptService.getConcept(2); assertFalse(secondConcept.isNumeric()); assertEquals("not a numeric anymore", secondConcept.getName(Locale.US).getName()); }</code><technical_language>longer need set this locale save handler this for</technical_language>

Target:
public void saveConcept_shouldSaveAConceptNumericAsAConcept() throws Exception { executeDataSet(INITIAL_CONCEPTS_XML); Context.setLocale(Locale.US); Concept c2 = new Concept(2); ConceptName cn = new ConceptName("not a numeric anymore", Locale.US); c2.addName(cn); c2.addDescription(new ConceptDescription("some description",null)); c2.setDatatype(new ConceptDatatype(3)); conceptService.saveConcept(c2); Concept secondConcept = conceptService.getConcept(2); assertFalse(secondConcept.isNumeric()); assertEquals("not a numeric anymore", secondConcept.getName(Locale.US).getName()); }
Source:
<code>public void testCommandlineProgramPropertiesOneLineSummaryLength() { PicardCommandLine.processAllCommandLinePrograms( <START> Collections.singletonList("picard"), <END> (Class<picard.cmdline.CommandLineProgram> clazz, CommandLineProgramProperties clProperties) -> Assert.assertTrue( clProperties.oneLineSummary().length() <= CommandLineProgram.MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH, String.format("One line summary for tool '%s' exceeds allowable length of %d", clazz.getCanonicalName(), CommandLineProgram.MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH))); }</code><technical_language>bad, wasteful tests generates list of picard CLPs times here. If generated in a BeforeClass in tests</technical_language>

Target:
public void testCommandlineProgramPropertiesOneLineSummaryLength() { allCLPS.forEach( (Class<picard.cmdline.CommandLineProgram> clazz, CommandLineProgramProperties clProperties) -> { Assert.assertNotNull(clProperties); Assert.assertTrue( clProperties.oneLineSummary().length() <= CommandLineProgram.MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH, String.format("One line summary for tool '%s' exceeds allowable length of %d", clazz.getCanonicalName(), CommandLineProgram.MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH)); }); }
Source:
<code>public int searchCommentInGroup(String text, List<StyledText> listStyledText, int commentIndex, List<CommentViewer> commentViewers) { int numResultsInGroup = 0; for (int i = commentViewers.size() - 1; i >= 0; i--) { CommentViewer viewer = commentViewers.get(i); ExpandableComposite composite = (ExpandableComposite) viewer.getControl(); if (hasResultInComment( text, getModel().getTaskData() .getAttributeMapper() .getAttributesByType(getModel().getTaskData(), TaskAttribute.TYPE_COMMENT) .get(commentIndex))) { viewer.setHasSearchStarted(true); if (composite != null && !composite.isExpanded()) { CommonFormUtil.setExpanded(composite, true); } findStyledText(composite, listStyledText); <START> viewer.setHasSearchStarted(false); <END> numResultsInGroup++; } else { if (composite != null && composite.isExpanded()) { } } commentIndex--; } return numResultsInGroup; }</code><technical_language>set this false in a finally block</technical_language>

Target:
public int searchCommentInGroup(String text, List<StyledText> listStyledText, int commentIndex, List<CommentViewer> commentViewers) { int numResultsInGroup = 0; for (int i = commentViewers.size() - 1; i >= 0; i--) { CommentViewer viewer = commentViewers.get(i); try { ExpandableComposite composite = (ExpandableComposite) viewer.getControl(); if (hasResultInEachComment( text, getModel().getTaskData() .getAttributeMapper() .getAttributesByType(getModel().getTaskData(), TaskAttribute.TYPE_COMMENT) .get(commentIndex))) { viewer.setHasSearchStarted(true); if (composite != null && !composite.isExpanded()) { CommonFormUtil.setExpanded(composite, true); } findStyledText(composite, listStyledText); numResultsInGroup++; } } finally { viewer.setHasSearchStarted(false); } commentIndex--; } return numResultsInGroup; }
Source:
<code><START> private Set<AccessModelPrivelege> immutePrivileges(final Set<PrivilegeDto> source) <END> { return source != null ? ImmutableSet.copyOf(source.stream().map(p -> new AccessModelPrivelege(p)).collect(toSet())) : Collections.emptySet(); }</code><technical_language>Cosmetic: a typo in class' name. AccessModelPrivilege (not AccessModelPrivElege</technical_language>

Target:
private Set<AccessModelPrivilege> immutePrivileges(final Set<PrivilegeDto> source) { return source != null ? ImmutableSet.copyOf(source.stream().map(p -> new AccessModelPrivilege(p)).collect(toSet())) : Collections.emptySet(); }
Source:
<code>MongoDbRepository (Properties settings) { final int PORT = parseInt (settings.getProperty ("mongodb.port")); final String HOST = settings.getProperty ("mongodb.host"); final String DATABASE = settings.getProperty ("mongodb.database"); final String WORLD = settings.getProperty ("mongodb.world.collection"); final String FORTUNE = settings.getProperty ("mongodb.fortune.collection"); MongoClient mongoClient = new MongoClient (HOST, PORT); MongoDatabase db = mongoClient.getDatabase (DATABASE); worldCollection = db.getCollection (WORLD); fortuneCollection = db.getCollection (FORTUNE); <START> loadData (); <END> }</code><technical_language>@jamming please remove this call loadData function + FORTUNES data. setup databases for you</technical_language>

Target:
MongoDbRepository (Properties settings) { final int PORT = parseInt (settings.getProperty ("mongodb.port")); final String HOST = settings.getProperty ("mongodb.host"); final String DATABASE = settings.getProperty ("mongodb.database"); final String WORLD = settings.getProperty ("mongodb.world.collection"); final String FORTUNE = settings.getProperty ("mongodb.fortune.collection"); MongoClient mongoClient = new MongoClient (HOST, PORT); MongoDatabase db = mongoClient.getDatabase (DATABASE); worldCollection = db.getCollection (WORLD); fortuneCollection = db.getCollection (FORTUNE); }
Source:
<code>@Test public void writeSpans_updatesPrometheusMetrics() throws Exception { List<Span> spans = asList(LOTS_OF_SPANS[0], LOTS_OF_SPANS[1], LOTS_OF_SPANS[2]); byte[] body = Codec.JSON.writeSpans(spans); Double messagesCount = registry.get("counter.zipkin_collector.spans.http").counter().count(); post("/api/v1/spans", body); post("/api/v1/spans", body); Response response = get("/prometheus"); assertThat(response.isSuccessful()).isTrue(); String prometheus = response.body().string(); assertThat(prometheus) <START> .contains("counter_zipkin_collector_spans_http_total " + (messagesCount + 6)); <END> }</code><technical_language>this path exact match beforehand</technical_language>

Target:
@Test public void writeSpans_updatesPrometheusMetrics() throws Exception { List<Span> spans = asList(LOTS_OF_SPANS[0], LOTS_OF_SPANS[1], LOTS_OF_SPANS[2]); byte[] body = Codec.JSON.writeSpans(spans); Double messagesCount = registry.get("counter.zipkin_collector.spans.http").counter().count(); long httpCount = registry .find("http_request_duration") .tag("path", "/api/v1/spans") .timer() .count(); httpCount += 2; System.out.print(httpCount); post("/api/v1/spans", body); post("/api/v1/spans", body); Response response = get("/prometheus"); assertThat(response.isSuccessful()).isTrue(); String prometheus = response.body().string(); assertThat(prometheus) .contains("counter_zipkin_collector_spans_http_total " + (messagesCount + 6)); assertThat(prometheus) .contains( "http_request_duration_seconds_count{method=\"POST\",path=\"/api/v1/spans\",status=\"200\",} " + httpCount); }
Source:
<code>protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { String line = value.toString(); String tagsKey = "Tags=\""; int start = line.indexOf(tagsKey); if (start < 0) { return; } start += tagsKey.length(); int end = line.indexOf('"', start); String cutOffLine = line.substring(start + 4, end - 4); String[] elements = cutOffLine.split("&gt;&lt;"); for (int i = 0; i < elements.length; i++) { <START> outputKey.set(TechnologiesFormatter.removeVersionFromName(elements[i])); <END> for (int j = 0; j < elements.length; j++) { if (i != j) { outputValue.set(TechnologiesFormatter.removeVersionFromName(elements[j])); context.write(outputKey, outputValue); } } } }</code><technical_language>Static import</technical_language>

Target:
protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { String line = value.toString(); String tagsKey = "Tags=\""; int start = line.indexOf(tagsKey); if (start < 0) { return; } start += tagsKey.length(); int end = line.indexOf('"', start); String cutOffLine = line.substring(start + 4, end - 4); String[] elements = cutOffLine.split("&gt;&lt;"); for (int i = 0; i < elements.length; i++) { outputKey.set(removeVersionFromName(elements[i])); for (int j = 0; j < elements.length; j++) { if (i != j) { outputValue.set(removeVersionFromName(elements[j])); context.write(outputKey, outputValue); } } } }
Source:
<code>public void convertToModelingProject(final IProject project, IProgressMonitor monitor) throws CoreException { final IWorkspaceRunnable create = new IWorkspaceRunnable() { @Override public void run(final IProgressMonitor monitor) throws CoreException { try { monitor.beginTask(Messages.ModelingProjectManagerImpl_convertToModelingProjectTask, 1); doAddModelingNature(project, new SubProgressMonitor(monitor, 1)); } finally { monitor.done(); } } }; if (alreadyIsInWorkspaceModificationOperation()) { doAddModelingNature(project, monitor); } else { IWorkspace workspace = ResourcesPlugin.getWorkspace(); workspace.run(create, <START> workspace.getRuleFactory().createRule(workspace.getRoot()), IWorkspace.AVOID_UPDATE, <END> monitor); } }</code><technical_language>workspace direcltly</technical_language>

Target:
public void convertToModelingProject(final IProject project, IProgressMonitor monitor) throws CoreException { final IWorkspaceRunnable create = new IWorkspaceRunnable() { @Override public void run(final IProgressMonitor monitor) throws CoreException { try { monitor.beginTask(Messages.ModelingProjectManagerImpl_convertToModelingProjectTask, 1); doAddModelingNature(project, new SubProgressMonitor(monitor, 1)); } finally { monitor.done(); } } }; if (alreadyIsInWorkspaceModificationOperation()) { doAddModelingNature(project, monitor); } else { IWorkspace workspace = ResourcesPlugin.getWorkspace(); workspace.run(create, ResourcesPlugin.getWorkspace().getRoot(), IWorkspace.AVOID_UPDATE, monitor); } }
Source:
<code>protected void innerDraw(GC gc) { Rectangle drawRect = getBounds(); if (drawRect.width >= 2) { gc.fillRectangle(drawRect); RGBAColor foregroundRGB = BLACK; gc.setAlpha(foregroundRGB.getAlpha()); gc.setForeground(getColor(foregroundRGB.toInt())); gc.drawLine(drawRect.x, drawRect.y, drawRect.x + drawRect.width - 1, drawRect.y); gc.drawLine(drawRect.x, drawRect.y + drawRect.height - 1, drawRect.x + drawRect.width - 1, drawRect.y + drawRect.height - 1); } else { gc.setForeground(gc.getBackground()); <START> gc.drawLine(drawRect.x - 1, drawRect.y, <END> drawRect.x, drawRect.y + drawRect.height -1); } }</code><technical_language>This line a diagonal</technical_language>

Target:
protected void innerDraw(GC gc) { Rectangle drawRect = getBounds(); if (drawRect.width >= 2) { gc.fillRectangle(drawRect); if (drawRect.width > 2) { RGBAColor foregroundRGB = BLACK; gc.setAlpha(foregroundRGB.getAlpha()); gc.setForeground(getColor(foregroundRGB.toInt())); gc.drawLine(drawRect.x, drawRect.y, drawRect.x + drawRect.width - 1, drawRect.y); gc.drawLine(drawRect.x, drawRect.y + drawRect.height - 1, drawRect.x + drawRect.width - 1, drawRect.y + drawRect.height - 1); } } else { gc.setForeground(gc.getBackground()); gc.drawLine(drawRect.x, drawRect.y, drawRect.x, drawRect.y + drawRect.height - 1); } }
Source:
<code>public void run() { <START> while (!canScan()) { <END> try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } if (pos == null) { pos = getBatchWizard().getFilesToScan().iterator(); } while (pos.hasNext()) { if (getBatchWizard().isReset()) { getBatchWizard().set(); pos = getBatchWizard().getFilesToScan().iterator(); getBatchWizard().getScannedTraces().clearCandidates(); } if (canScan()) { String fileName = pos.next(); boolean updated = false; final List<String> setToReset = new ArrayList<String>(); for (String traceCat : getBatchWizard().getTracesToScan()) { if (ImportUtils.validate(traceCat, fileName)) { getBatchWizard().getScannedTraces().addCandidate(traceCat, new File(fileName)); setToReset.add(traceCat); updated = true; } } position++; final boolean treeUpdated = updated; pb.getDisplay().asyncExec(new Runnable() { @Override public void run() { if (treeUpdated) { for (String traceCat : setToReset) { traceTypeViewer.setChecked(traceCat, false); } traceTypeViewer.refresh(); } pb.setSelection(position); } }); } else { try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } } }</code><technical_language>This is thread safe. In GUI thread (main thread) super.isCurrentPage() (see canScan) is executed this runnable is in thread</technical_language>

Target:
public void run() { while (fCanRun == true) { boolean updated = false; try { boolean validCombo; TraceToValidate traceToScan = fTracesToScan.take(); if( !getBatchWizard().hasScanned(traceToScan) ){ getBatchWizard().addResult(traceToScan, ImportUtils.validate(traceToScan)); } validCombo = getBatchWizard().getResult(traceToScan); if (validCombo) { getBatchWizard().getScannedTraces().addCandidate(traceToScan.getTraceType(), new File(traceToScan.getTraceToScan())); updated = true; } position++; final boolean treeUpdated = updated; pb.getDisplay().asyncExec(new UpdateUIRunnable(treeUpdated)); } catch (InterruptedException e) { } } }
Source:
<code>@Override public long getCurrentPmeDuration() { <START> GridDhtPartitionsExchangeFuture fut = ctx.cache().context().exchange().lastTopologyFuture(); <END> return (fut == null || fut.isDone()) ? 0 : TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - fut.getStartTime()); }</code><technical_language>this change</technical_language>

Target:
@Override public long getCurrentPmeDuration() { return pmeDuration.value(); }
Source:
<code>public DataFile findByGlobalId(String globalId){ String protocol = ""; String authority = ""; String identifier = ""; int index1 = globalId.indexOf(':'); String nonNullDefaultIfKeyNotFound = ""; String separator = settingsService.getValueForKey(SettingsServiceBean.Key.DoiSeparator, nonNullDefaultIfKeyNotFound); int index2 = globalId.indexOf(separator, index1 + 1); int index3; if (index1 == -1) { logger.info("Error parsing identifier: " + globalId + ". ':' not found in string"); return null; } else { protocol = globalId.substring(0, index1); } if (index2 == -1 ) { logger.info("Error parsing identifier: " + globalId + ". Second separator not found in string"); return null; } else { authority = globalId.substring(index1 + 1, index2); } if (protocol.equals("doi")) { index3 = globalId.indexOf(separator, index2 + 1); if (index3 == -1 ) { identifier = globalId.substring(index2 + 1); } else { if (index3 > -1) { authority = globalId.substring(index1 + 1, index3); identifier = globalId.substring(index3 + 1).toUpperCase(); } } } else { identifier = globalId.substring(index2 + 1).toUpperCase(); } <START> String queryStr = "SELECT s from DataFile s where s.identifier = :identifier and s.protocol= :protocol and s.authority= :authority"; <END> DataFile file = null; try { Query query = em.createQuery(queryStr); query.setParameter("identifier", identifier); query.setParameter("protocol", protocol); query.setParameter("authority", authority); file = (DataFile) query.getSingleResult(); } catch (javax.persistence.NoResultException e) { logger.fine("no file found: " + globalId); } return file; }</code><technical_language>replace a @NamedQuery</technical_language>

Target:
public DataFile findByGlobalId(String globalId) { String queryStr = "select s.id from dvobject s where Concat(s.protocol, ':' , s.authority , s.doiseparator , s.identifier) = '" + globalId + "'"; DataFile file = null; try { Query query = em.createNativeQuery(queryStr); Long fileId = new Long((Integer) query.getSingleResult()); file = em.find(DataFile.class, fileId); } catch (javax.persistence.NoResultException e) { logger.fine("no file found: " + globalId); } return file; }
Source:
<code>public EffectorBody<Void> newSuspendEffectorTask() { <START> return new EffectorBody<Void>() { <END> @Override public Void call(ConfigBag parameters) { suspend(parameters); return null; } }; }</code><technical_language>Effectors persisted, avoid anonymous classes</technical_language>

Target:
public EffectorBody<Void> newSuspendEffectorTask() { return new SuspendEffectorBody(); }
Source:
<code>public List<String> getConsumingSegments(String tableNameWithType) { IdealState idealState = _helixAdmin.getResourceIdealState(_helixClusterName, tableNameWithType); if (idealState == null) { throw new IllegalStateException("Ideal state does not exist for table: " + tableNameWithType); } List<String> consumingSegments = new ArrayList<>(); for (String segment : idealState.getPartitionSet()) { Map<String, String> instanceStateMap = idealState.getInstanceStateMap(segment); if (instanceStateMap.containsValue(SegmentStateModel.CONSUMING)) { <START> consumingSegments.add(segment); <END> } } return consumingSegments; }</code><technical_language>consumingSegments a set duplicates</technical_language>

Target:
public Set<String> getConsumingSegments(String tableNameWithType) { IdealState idealState = _helixAdmin.getResourceIdealState(_helixClusterName, tableNameWithType); if (idealState == null) { throw new IllegalStateException("Ideal state does not exist for table: " + tableNameWithType); } Set<String> consumingSegments = new HashSet<>(); for (String segment : idealState.getPartitionSet()) { Map<String, String> instanceStateMap = idealState.getInstanceStateMap(segment); if (instanceStateMap.containsValue(SegmentStateModel.CONSUMING)) { consumingSegments.add(segment); } } return consumingSegments; }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { TransactionalEditingDomain editingDomain = getTableEditingDomain(); Table table = getTable(); if (null != editingDomain && null != table) { boolean autoResizeCellHeightFlag = StyleUtils.getBooleanNamedStyleValue(table, NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT); StyleUtils.setBooleanNamedStyle(editingDomain, table, NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT, !autoResizeCellHeightFlag); <START> refreshTable(); <END> } return null; }</code><technical_language>refresh here. This launched NattableModelManager superclass, instead, add kind of lines : Command command = event.getCommand(); boolean oldValue = HandlerUtil.toggleCommandState(command);</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { TransactionalEditingDomain editingDomain = getTableEditingDomain(); Table table = getTable(); if (null != editingDomain && null != table) { BooleanValueStyle autoResizeValue = (BooleanValueStyle) table.getNamedStyle(NattablestylePackage.eINSTANCE.getBooleanValueStyle(), NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT); if (null != autoResizeValue) { StyleUtils.setBooleanNamedStyle(editingDomain, table, NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT, !autoResizeValue.isBooleanValue()); } else { StyleUtils.initBooleanNamedStyle(editingDomain, table, NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT, false); } HandlerUtil.toggleCommandState(event.getCommand()); } return null; }
Source:
<code><START> public void resetPositions(int positionCount) <END> { positions = ensureCapacity(positions, positionCount); this.positionCount = 0; }</code><technical_language>For readability i sort methods in resetPositions -> addPosition -> appendData -> flush. Please order private methods accordingly: Method a private method - > private method</technical_language>

Target:
private void resetPositions(int positionCount) { positions = ensureCapacity(positions, positionCount); this.positionCount = 0; }
Source:
<code>private boolean shouldSkipCheck() { long currentTime = Time.monotonicNow(); long minInterval = Math.min(staleNodeIntervalMs, deadNodeIntervalMs); if ((currentTime - lastHealthCheck) >= minInterval) { return true; } <START> return false; <END> }</code><technical_language>return statement simplified return (currentTime - lastHealthCheck) >= minInterval;</technical_language>

Target:
private boolean shouldSkipCheck() { long currentTime = Time.monotonicNow(); long minInterval = Math.min(staleNodeIntervalMs, deadNodeIntervalMs); return ((currentTime - lastHealthCheck) >= minInterval); }
Source:
<code>public String get(final Object o, final String s) { final ContainerRequest request = (ContainerRequest) o; final List<String> requestHeader = request.getRequestHeader(s); if (requestHeader == null) { return null; } <START> if (requestHeader.size() > 0) { <END> return requestHeader.get(0); } return null; }</code><technical_language>combine checks, if (requestHeader != null && requestHeader.size() > 0)</technical_language>

Target:
public String get(final Object o, final String s) { final ContainerRequest request = (ContainerRequest) o; final List<String> requestHeader = request.getRequestHeader(s); if (requestHeader != null && requestHeader.size() > 0) { return requestHeader.get(0); } return null; }
Source:
<code>public static void showMapsWithMeUrl(Activity caller, PendingIntent pendingIntent, double zoomLevel, String url) { final Uri uri = Uri.parse(url); <START> final String[] latlon = uri.getQueryParameter("ll").split(","); <END> final double lat = Double.parseDouble(latlon[0]); final double lon = Double.parseDouble(latlon[1]); final String name = uri.getQueryParameter("n"); final String id = uri.getQueryParameter("id"); showPointsOnMap(caller, name, zoomLevel, pendingIntent, new MWMPoint(lat, lon, name, id)); }</code><technical_language>sure, I this is a file provided Mapswithme. In case modify it, say</technical_language>

Target:
public static void showMapsWithMeUrl(Activity caller, PendingIntent pendingIntent, double zoomLevel, String url) { final Uri uri = Uri.parse(url); final String latlon[] = uri.getQueryParameter("ll").split(","); final double lat = Double.parseDouble(latlon[0]); final double lon = Double.parseDouble(latlon[1]); final String name = uri.getQueryParameter("n"); final String id = uri.getQueryParameter("id"); showPointsOnMap(caller, name, zoomLevel, pendingIntent, new MWMPoint(lat, lon, name, id)); }
Source:
<code>private void assertTableSize(MySqlDataAccessor dataAccessor, int expectedNumRows) throws SQLException { Connection dbConnection = dataAccessor.getDatabaseConnection(true); Statement statement = dbConnection.createStatement(); ResultSet resultSet = statement.executeQuery("SELECT * FROM " + AccountReportsDao.ACCOUNT_REPORTS_TABLE); int numRows = 0; if (resultSet != null) { while (resultSet.next()) { numRows++; } } <START> resultSet.close(); <END> assertEquals(expectedNumRows, numRows); }</code><technical_language>This NPE</technical_language>

Target:
private void assertTableSize(MySqlDataAccessor dataAccessor, int expectedNumRows) throws SQLException { Connection dbConnection = dataAccessor.getDatabaseConnection(true); Statement statement = dbConnection.createStatement(); ResultSet resultSet = statement.executeQuery("SELECT * FROM " + AccountReportsDao.ACCOUNT_REPORTS_TABLE); int numRows = 0; if (resultSet != null) { while (resultSet.next()) { numRows++; } resultSet.close(); } assertEquals(expectedNumRows, numRows); }
Source:
<code>private boolean generatePom(Model parent, File basedir) throws MojoExecutionException { if (isPluginProject(basedir)) { getLog().debug("Found plugin PDE project " + toString(basedir)); generatePluginPom(parent, basedir); } else if (isFeatureProject(basedir)) { getLog().debug("Found feature PDE project " + toString(basedir)); generateFeaturePom(parent, basedir); } else if (isEclipseRepositoryProject(basedir)) { getLog().debug("Found eclipse-repository PDE project " + toString(basedir)); generateEclipseRepositoryPom(parent, basedir); } else if (isUpdateSiteProject(basedir)) { getLog().debug("Found update site PDE project " + toString(basedir)); getLog().warn("Old style update site found for " + toString(basedir) + <START> ". It is recommended you rename your site.xml to category.xml."); <END> generateUpdateSitePom(parent, basedir); } else { getLog().debug("Not a PDE project " + toString(basedir)); return false; } return true; }</code><technical_language>"... packaging type eclipse-repository instead."</technical_language>

Target:
private boolean generatePom(Model parent, File basedir) throws MojoExecutionException { if (isPluginProject(basedir)) { getLog().debug("Found plugin PDE project " + toString(basedir)); generatePluginPom(parent, basedir); } else if (isFeatureProject(basedir)) { getLog().debug("Found feature PDE project " + toString(basedir)); generateFeaturePom(parent, basedir); } else if (isEclipseRepositoryProject(basedir)) { getLog().debug("Found eclipse-repository PDE project " + toString(basedir)); generateEclipseRepositoryPom(parent, basedir); } else if (isUpdateSiteProject(basedir)) { getLog().debug("Found update site PDE project " + toString(basedir)); getLog().warn("Old style update site found for " + toString(basedir) + ". It is recommended you rename your site.xml to category.xml " + "and use packaging type eclipse-repository instead."); generateUpdateSitePom(parent, basedir); } else { getLog().debug("Not a PDE project " + toString(basedir)); return false; } return true; }
Source:
<code>public PatchLineComment saveDraft(Patch.Key patchKey, String message, int line, short side, String parentUuid, IProgressMonitor monitor) throws GerritException { final Version version = getCachedVersion(monitor); PatchLineComment.Key id = new PatchLineComment.Key(patchKey, null); final PatchLineComment comment = new PatchLineComment(id, line, getAccount(monitor).getId(), parentUuid); comment.setMessage(message); comment.setSide(side); return execute(monitor, new Operation<PatchLineComment>() { @Override public void execute(IProgressMonitor monitor) throws GerritException { <START> getPatchDetailService(version).saveDraft(comment, this); <END> } }); }</code><technical_language>encapsulated in getService() method clients pass cached version. progress monitor passed instead</technical_language>

Target:
public PatchLineComment saveDraft(Patch.Key patchKey, String message, int line, short side, String parentUuid, IProgressMonitor monitor) throws GerritException { PatchLineComment.Key id = new PatchLineComment.Key(patchKey, null); final PatchLineComment comment = new PatchLineComment(id, line, getAccount(monitor).getId(), parentUuid); comment.setMessage(message); comment.setSide(side); return execute(monitor, new Operation<PatchLineComment>() { @Override public void execute(IProgressMonitor monitor) throws GerritException { getPatchDetailService().saveDraft(comment, this); } }); }
Source:
<code>protected void testAccessControl() throws Exception { InstructorAttributes instructor = typicalBundle.instructors.get("instructor3OfCourse1"); <START> ______TS("only instructors of the same course can access"); <END> String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, instructor.courseId, }; verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); verifyInaccessibleWithoutModifyInstructorPrivilege(submissionParams); ______TS("instructors of other courses cannot access"); verifyInaccessibleForInstructorsOfOtherCourses(submissionParams); }</code><technical_language>suggestion ______TS("only instructors of modify permission access");</technical_language>

Target:
protected void testAccessControl() throws Exception { InstructorAttributes instructor = typicalBundle.instructors.get("instructor3OfCourse1"); ______TS("only instructors of the same course with modify permission can access"); String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, instructor.courseId, }; verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); verifyInaccessibleWithoutModifyInstructorPrivilege(submissionParams); ______TS("instructors of other courses cannot access"); verifyInaccessibleForInstructorsOfOtherCourses(submissionParams); ______TS("invalid course id cannot access"); String[] invalidCouseIdParams = new String[] { Const.ParamsNames.COURSE_ID, "invalid-course-id", }; verifyCannotAccess(invalidCouseIdParams); }
Source:
<code><START> public int acceptsAssignedUser() { <END> if (User.PLANNING_USER.getEntityId().equals(getUser().getEntityId())) { return 0; } return TaskHelper.isPotentialOwner(this, getUser()) ? 0 : -1; }</code><technical_language>This method return states - boolean suitable in DRL rule this method is called, penalize -1 for task accept assigned user</technical_language>

Target:
public boolean acceptsAssignedUser() { if (User.PLANNING_USER.getEntityId().equals(getUser().getEntityId())) { return true; } return TaskHelper.isPotentialOwner(this, getUser()); }
Source:
<code>private static int parseEap(String eapString) { if (eapString == null) { return WifiEnterpriseConfig.Eap.NONE; } try { <START> return (Integer) WifiEnterpriseConfig.Eap.class.getField(eapString).get(null); <END> } catch (NoSuchFieldException e) { throw new IllegalArgumentException("Unable to find WifiEnterpriseConfig.Eap value for " + eapString); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Unable to parse Eap parameter " + eapString, e); } }</code><technical_language>reflection needed here? is due API levels</technical_language>

Target:
private static int parseEap(String eapString) { if (eapString == null) { return WifiEnterpriseConfig.Eap.NONE; } switch (eapString) { case "NONE": return WifiEnterpriseConfig.Eap.NONE; case "PEAP": return WifiEnterpriseConfig.Eap.PEAP; case "PWD": return WifiEnterpriseConfig.Eap.PWD; case "TLS": return WifiEnterpriseConfig.Eap.TLS; case "TTLS": return WifiEnterpriseConfig.Eap.TTLS; default: throw new IllegalArgumentException("Unknown value for EAP method: " + eapString); } }
Source:
<code>public void create(User user, boolean isTemporary) throws ConflictException, ServerException { if (isNameReserved(user.getName())) { <START> throw new ConflictException("Username is reserved"); <END> } user.withId(generate("user", ID_LENGTH)) .withPassword(firstNonNull(user.getPassword(), generate("", PASSWORD_LENGTH))); userDao.create(user); profileDao.create(new Profile(user.getId())); final Map<String, String> preferences = new HashMap<>(4); preferences.put("temporary", Boolean.toString(isTemporary)); preferences.put("codenvy:created", Long.toString(System.currentTimeMillis())); try { preferenceDao.setPreferences(user.getId(), preferences); } catch (NotFoundException e) { LOG.warn(format("Cannot set creation time preferences for user %s.", user.getId()), e); } }</code><technical_language>Add name exception message</technical_language>

Target:
public void create(User user, boolean isTemporary) throws ConflictException, ServerException { if (reservedNames.contains(user.getName().toLowerCase())) { throw new ConflictException(String.format("Username \"%s\" is reserved", user.getName())); } user.withId(generate("user", ID_LENGTH)) .withPassword(firstNonNull(user.getPassword(), generate("", PASSWORD_LENGTH))); userDao.create(user); profileDao.create(new Profile(user.getId())); final Map<String, String> preferences = new HashMap<>(4); preferences.put("temporary", Boolean.toString(isTemporary)); preferences.put("codenvy:created", Long.toString(System.currentTimeMillis())); try { preferenceDao.setPreferences(user.getId(), preferences); } catch (NotFoundException e) { LOG.warn(format("Cannot set creation time preferences for user %s.", user.getId()), e); } }
Source:
<code><START> public void send(EmailType messageType, Map<String, Object> parameters, String... emails) { <END> if (emails == null || emails.length == 0 || StringUtils.isBlank(emails[0])) { return; } MimeMessage message = mailSender.createMimeMessage(); MimeMessageHelper helper; try { final String emailBody = contentBuilder.build(messageType.getTemplate(), parameters); LOGGER.debug("Sending email: \n\n\n{}\n\n\n", messageType, emailBody); helper = new MimeMessageHelper(message, true); helper.setSubject(messageType.getSubject()); helper.setFrom(from, notifier); helper.setTo(emails); helper.setText(emailBody, true); mailSender.send(message); } catch (MessagingException | MailException | UnsupportedEncodingException ex) { LOGGER.error("{} [user email: {}, subject: {2}]", ex.getMessage(), emails, messageType.getSubject(), ex); throw new RuntimeException(ex); } }</code><technical_language>move this EmailService? benefits of separation</technical_language>

Target:
public void send(EmailType messageType, Map<String, Object> parameters, String... emails) { if (emails == null || emails.length == 0 || StringUtils.isBlank(emails[0])) { return; } MimeMessage message = mailSender.createMimeMessage(); MimeMessageHelper helper; try { final String emailBody = contentBuilder.build(messageType.getTemplate(), parameters); LOGGER.debug("Sending email: \n\n\n{}\n\n\n", messageType, emailBody); helper = new MimeMessageHelper(message, true); helper.setSubject(messageType.getSubject()); helper.setFrom(from, notifier); helper.setTo(emails); helper.setText(emailBody, true); mailSender.send(message); } catch (MessagingException | MailException | UnsupportedEncodingException ex) { LOGGER.error("{} [user email: {}, subject: {}]", ex.getMessage(), emails, messageType.getSubject(), ex); throw new RuntimeException(ex); } }
Source:
<code>public boolean match(String cluster, String service) { <START> if (_cluster == null && _service == null) { return true; } <END> else if (_cluster == null) { return Objects.equals(_service, service); } else if (_service == null) { return Objects.equals(_cluster, cluster); } else { return Objects.equals(_cluster, cluster) && Objects.equals(_service, service); } }</code><technical_language>java if (this.equals(WILDCARD_KEY)) { return true; }</technical_language>

Target:
public boolean match(String cluster, String service) { if (this == WILDCARD_KEY) { return true; } else if (_cluster == null) { return Objects.equals(_service, service); } else if (_service == null) { return Objects.equals(_cluster, cluster); } else { return Objects.equals(_cluster, cluster) && Objects.equals(_service, service); } }
Source:
<code>public ResourceManager withDefaultSubscription() { if (profile.subscriptionId() == null) { List<Subscription> subscriptions = new ArrayList<>(); this.subscriptions().list().forEach(subscription -> { subscriptions.add(subscription); }); <START> if (subscriptions.size() == 0) { <END> throw logger.logExceptionAsError( new RuntimeException("Please create a subscription before you start resource management. " + "To learn more, see: <LINK_0>")); } else if (subscriptions.size() > 1) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("More than one subscription found in your tenant. " + "Please specify which one below is desired for resource management."); subscriptions.forEach(subscription -> { stringBuilder.append("\n" + subscription.displayName() + " : " + subscription.subscriptionId()); }); throw logger.logExceptionAsError(new RuntimeException(stringBuilder.toString())); } else { profile.withSubscriptionId(subscriptions.get(0).subscriptionId()); } } return new ResourceManager(httpPipeline, profile, sdkContext); }</code><technical_language>Is share some code? Azure call some util method in Resources</technical_language>

Target:
public ResourceManager withDefaultSubscription() { if (profile.subscriptionId() == null) { profile.withSubscriptionId(Utils.defaultSubscription(this.subscriptions().list())); } return new ResourceManager(httpPipeline, profile, sdkContext); }
Source:
<code>private static RefList<Ref> applyUpdates(RevWalk walk, RefList<Ref> refs, List<ReceiveCommand> commands) throws IOException { Collections.sort(commands, new Comparator<ReceiveCommand>() { @Override public int compare(ReceiveCommand a, ReceiveCommand b) { return a.getRefName().compareTo(b.getRefName()); } }); int delta = 0; for (ReceiveCommand c : commands) { switch (c.getType()) { case DELETE: delta--; break; case CREATE: delta++; break; default: } } RefList.Builder<Ref> b = new RefList.Builder<>(refs.size() + delta); int refIdx = 0; int cmdIdx = 0; while (refIdx < refs.size() || cmdIdx < commands.size()) { Ref ref = (refIdx < refs.size()) ? refs.get(refIdx) : null; ReceiveCommand cmd = (cmdIdx < commands.size()) ? commands.get(cmdIdx) : null; int cmp = 0; if (ref != null && cmd != null) { cmp = ref.getName().compareTo(cmd.getRefName()); } else if (ref == null) { cmp = 1; } else if (cmd == null) { cmp = -1; } if (cmp < 0) { b.add(ref); refIdx++; } else if (cmp > 0) { <START> if (cmd.getType() != ReceiveCommand.Type.CREATE) { <END> lockFailure(cmd, commands); return null; } b.add(peeledRef(walk, cmd)); cmdIdx++; } else { if (!cmd.getOldId().equals(ref.getObjectId())) { lockFailure(cmd, commands); return null; } if (cmd.getType() != ReceiveCommand.Type.DELETE) { b.add(peeledRef(walk, cmd)); } cmdIdx++; refIdx++; } } return b.toRefList(); }</code><technical_language>eclipse compiler raises error: potential NPE cmd compiler smart enough understand cmp is set -1 if cmd == null, silence error asserting cmd is null this line: assert cmd != null;</technical_language>

Target:
private static RefList<Ref> applyUpdates(RevWalk walk, RefList<Ref> refs, List<ReceiveCommand> commands) throws IOException { Collections.sort(commands, new Comparator<ReceiveCommand>() { @Override public int compare(ReceiveCommand a, ReceiveCommand b) { return a.getRefName().compareTo(b.getRefName()); } }); int delta = 0; for (ReceiveCommand c : commands) { switch (c.getType()) { case DELETE: delta--; break; case CREATE: delta++; break; default: } } RefList.Builder<Ref> b = new RefList.Builder<>(refs.size() + delta); int refIdx = 0; int cmdIdx = 0; while (refIdx < refs.size() || cmdIdx < commands.size()) { Ref ref = (refIdx < refs.size()) ? refs.get(refIdx) : null; ReceiveCommand cmd = (cmdIdx < commands.size()) ? commands.get(cmdIdx) : null; int cmp = 0; if (ref != null && cmd != null) { cmp = ref.getName().compareTo(cmd.getRefName()); } else if (ref == null) { cmp = 1; } else if (cmd == null) { cmp = -1; } if (cmp < 0) { b.add(ref); refIdx++; } else if (cmp > 0) { assert cmd != null; if (cmd.getType() != ReceiveCommand.Type.CREATE) { lockFailure(cmd, commands); return null; } b.add(peeledRef(walk, cmd)); cmdIdx++; } else { assert cmd != null; assert ref != null; if (!cmd.getOldId().equals(ref.getObjectId())) { lockFailure(cmd, commands); return null; } if (cmd.getType() != ReceiveCommand.Type.DELETE) { b.add(peeledRef(walk, cmd)); } cmdIdx++; refIdx++; } } return b.toRefList(); }
Source:
<code>public double rate( PricingEnvironment env, IborAveragedRateObservation observation, LocalDate startDate, LocalDate endDate) { double totalWeight = observation.getFixings().stream() .mapToDouble(IborAveragedFixing::getWeight) .sum(); <START> double weightedRate = observation.getFixings().stream() <END> .mapToDouble(fixing -> weightedRate(env, observation.getIndex(), fixing)) .sum(); return weightedRate / totalWeight; }</code><technical_language>Indentation - line starts 4 chars in</technical_language>

Target:
public double rate( PricingEnvironment env, IborAveragedRateObservation observation, LocalDate startDate, LocalDate endDate) { double weightedRate = observation.getFixings().stream() .mapToDouble(fixing -> weightedRate(env, observation.getIndex(), fixing)) .sum(); return weightedRate / observation.getTotalWeight(); }
Source:
<code>protected boolean failPassthroughVnicHotPlug() { if <START> (VmInterfaceType.pciPassthrough.equals(VmInterfaceType.forValue(getParameters().getNic().getType()))) <END> { addCanDoActionMessage(EngineMessage.HOT_PLUG_UNPLUG_PASSTHROUGH_VNIC_NOT_SUPPORTED); return true; } return false; }</code><technical_language>replace equals == for enums</technical_language>

Target:
protected boolean failPassthroughVnicHotPlug() { if (VmInterfaceType.pciPassthrough == VmInterfaceType.forValue(getParameters().getNic().getType())) { addCanDoActionMessage(EngineMessage.HOT_PLUG_UNPLUG_PASSTHROUGH_VNIC_NOT_SUPPORTED); return true; } return false; }
Source:
<code>public Collection<TopologyComponentDefinition> listTopologyComponentsForTypeWithFilter(TopologyComponentDefinition.TopologyComponentType componentType, List<QueryParam> params) { <START> List<TopologyComponentDefinition> topologyComponentDefinitions = new ArrayList<TopologyComponentDefinition>(); <END> String ns = TopologyComponentDefinition.NAME_SPACE; Collection<TopologyComponentDefinition> filtered = dao.<TopologyComponentDefinition>find(ns, params); for (TopologyComponentDefinition tc : filtered) { if (tc.getType().equals(componentType)) { topologyComponentDefinitions.add(tc); } } return topologyComponentDefinitions; }</code><technical_language>nit: new ArrayList<>();</technical_language>

Target:
public Collection<TopologyComponentDefinition> listTopologyComponentsForTypeWithFilter(TopologyComponentDefinition.TopologyComponentType componentType, List<QueryParam> params) { List<TopologyComponentDefinition> topologyComponentDefinitions = new ArrayList<>(); String ns = TopologyComponentDefinition.NAME_SPACE; Collection<TopologyComponentDefinition> filtered = dao.find(ns, params); for (TopologyComponentDefinition tc : filtered) { if (tc.getType().equals(componentType)) { topologyComponentDefinitions.add(tc); } } return topologyComponentDefinitions; }
Source:
<code>public UniqueId(final HBaseClient client, final byte[] table, final String kind, final int width) { this.client = client; this.table = table; if (kind.isEmpty()) { throw new IllegalArgumentException("Empty string as 'kind' argument!"); } this.kind = toBytes(kind); if (width < 1 || width > 8) { throw new IllegalArgumentException("Invalid width: " + width); } this.idWidth = (short) width; <START> this.idLimit = (long) Math.pow(2, idWidth * Byte.SIZE) - 1; <END> }</code><technical_language>need Math.pow() power is 2, shift bits left ;)</technical_language>

Target:
public UniqueId(final HBaseClient client, final byte[] table, final String kind, final int width) { this.client = client; this.table = table; if (kind.isEmpty()) { throw new IllegalArgumentException("Empty string as 'kind' argument!"); } this.kind = toBytes(kind); if (width < 1 || width > 8) { throw new IllegalArgumentException("Invalid width: " + width); } this.idWidth = (short) width; }
Source:
<code>private static ContinuousStream<Map<String, Object>> cepCCTranslator( final ContinuousStream<Map<String, Object>> input, final ComparisonCondition condition) { <START> String field = condition.getFieldName(); <END> Object value = condition.getComparisonValue(); switch(condition.getConditionType()){ case LT: return input.filter(s -> cepCompare(s.get(field), value) < 0); case GT: return input.filter(s -> cepCompare(s.get(field), value) > 0); case EQ: return input.filter(s -> s.get(field).equals(value)); default: throw new IllegalStateException("Wrong comparison condition type!"); } }</code><technical_language>final</technical_language>

Target:
private static ContinuousStream<Map<String, Object>> cepCCTranslator( final ContinuousStream<Map<String, Object>> input, final ComparisonCondition condition) { final String field = condition.getFieldName(); final Object value = condition.getComparisonValue(); final ConditionType conditionType = condition.getConditionType(); switch (conditionType) { case GT: return input.filter(new CepGTPredicate(field, value)); case LT: return input.filter(new CepLTPredicate(field, value)); case EQ: return input.filter(new CepEQPredicate(field, value)); case NEQ: return input.filter(new CepNEQPredicate(field, value)); default: throw new IllegalStateException("Wrong comparison condition type!"); } }
Source:
<code>protected void logRequest() { BoxLogUtils.i(BoxConstants.TAG, String.format(Locale.ENGLISH, "Request (%s): %s", mRequestMethod, mRequestUrlString)); BoxLogUtils.i(BoxConstants.TAG, "Request Header", mHeaderMap); switch (mContentType) { case JSON: if (!SdkUtils.isBlank(mStringBody)) { BoxLogUtils.i(BoxConstants.TAG, String.format(Locale.ENGLISH, "Request JSON: %s", mStringBody)); } break; case URL_ENCODED: HashMap<String, String> stringMap = new HashMap<String, String>(); for (Map.Entry<String,Object> entry : mBodyMap.entrySet()) { stringMap.put(entry.getKey(), (String)entry.getValue()); } BoxLogUtils.i(BoxConstants.TAG, "Request Form Data", stringMap); break; <START> case JSON_PATCH: <END> if (!SdkUtils.isBlank(mStringBody)) { BoxLogUtils.i(BoxConstants.TAG, String.format(Locale.ENGLISH, "Request JSON: %s", mStringBody)); } break; default: break; } }</code><technical_language>This do JSON -- fall</technical_language>

Target:
protected void logRequest() { BoxLogUtils.i(BoxConstants.TAG, String.format(Locale.ENGLISH, "Request (%s): %s", mRequestMethod, mRequestUrlString)); BoxLogUtils.i(BoxConstants.TAG, "Request Header", mHeaderMap); switch (mContentType) { case JSON: case JSON_PATCH: if (!SdkUtils.isBlank(mStringBody)) { BoxLogUtils.i(BoxConstants.TAG, String.format(Locale.ENGLISH, "Request JSON: %s", mStringBody)); } break; case URL_ENCODED: HashMap<String, String> stringMap = new HashMap<String, String>(); for (Map.Entry<String,Object> entry : mBodyMap.entrySet()) { stringMap.put(entry.getKey(), (String)entry.getValue()); } BoxLogUtils.i(BoxConstants.TAG, "Request Form Data", stringMap); break; default: break; } }
Source:
<code>public ImportVmParameters(VM vm, Guid sourceStorageDomainId, Guid destStorageDomainId, Guid storagePoolId, Guid vdsGroupId) { super(vm.getId(), destStorageDomainId); <START> this.setSourceDomainId(sourceStorageDomainId); <END> this.setDestDomainId(destStorageDomainId); setVm(vm); setStorageDomainId(destStorageDomainId); setStoragePoolId(storagePoolId); setVdsGroupId(vdsGroupId); }</code><technical_language>* need for 'this' in this case :) * imo, setters</technical_language>

Target:
public ImportVmParameters(VM vm, Guid sourceStorageDomainId, Guid destStorageDomainId, Guid storagePoolId, Guid vdsGroupId) { super(vm.getId(), destStorageDomainId); sourceDomainId = sourceStorageDomainId; destDomainId = destStorageDomainId; setVm(vm); setStorageDomainId(destStorageDomainId); setStoragePoolId(storagePoolId); setVdsGroupId(vdsGroupId); }
Source:
<code><START> LockDescriptorAwareRepresenter() { <END> this.representers.put(LockDescriptor.class, data -> representScalar(Tag.STR, data.toString())); }</code><technical_language>call super constructor</technical_language>

Target:
LockDescriptorAwareRepresenter() { super(); this.representers.put(LockDescriptor.class, data -> representScalar(Tag.STR, data.toString())); }
Source:
<code>public KoreKDebug(K initialK, Rewriter rewriter) { this.stateSet = new HashSet<>(); this.checkpointInterval = DEFAULT_CHECKPOINT_SIZE; this.rewriter = rewriter; KDebugState initialState = new KDebugState(initialK); <START> initialState.addCheckpoint(new Checkpoint(initialK, DEFAULT_ID), DEFAULT_ID); <END> stateSet.add(initialState); activeState = initialState; }</code><technical_language>I instead of a separate Checkpoint class I suggest is a State class a RewriterState class a NavigableMap, RewriterState class fields Checkpoint, ie, K, eventually Rule/substitution/etc</technical_language>

Target:
public KoreKDebug(K initialK, Rewriter rewriter) { this.stateList = new ArrayList<>(); this.checkpointInterval = DEFAULT_CHECKPOINT_SIZE; this.rewriter = rewriter; NavigableMap<Integer, RewriterCheckpoint> checkpointMap = new TreeMap<>(); checkpointMap.put(DEFAULT_ID, new RewriterCheckpoint(initialK)); DebuggerState initialState = new DebuggerState(initialK, DEFAULT_ID, checkpointMap); stateList.add(initialState); activeState = initialState; }