auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void execute() throws AzureBlobFileSystemException { String latencyHeader = this.client.getAbfsPerfTracker().getClientLatency(); if (latencyHeader != null && !latencyHeader.isEmpty()) { AbfsHttpHeader httpHeader = new AbfsHttpHeader(HttpHeaderConfigurations.X_MS_ABFS_CLIENT_LATENCY, latencyHeader); requestHeaders.add(httpHeader); } retryCount = 0; LOG.debug("First execution of REST operation - {}", operationType); while (!executeHttpOperation(retryCount++)) { try { LOG.debug("Retrying REST operation {}. RetryCount = {}", operationType, retryCount); <START> <END> Thread.sleep(client.getRetryPolicy().getRetryInterval(retryCount)); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } if (result.getStatusCode() >= HttpURLConnection.HTTP_BAD_REQUEST) { if (this.isAppendBlobAppend && retryCount > 0 && result.getStorageErrorCode().equals("InvalidQueryParameterValue")) { return; } throw new AbfsRestOperationException(result.getStatusCode(), result.getStorageErrorCode(), result.getStorageErrorMessage(), null, result); } LOG.trace("{} REST operation complete", operationType); }</code><technical_language>remove newline</technical_language>

Target:
void execute() throws AzureBlobFileSystemException { String latencyHeader = this.client.getAbfsPerfTracker().getClientLatency(); if (latencyHeader != null && !latencyHeader.isEmpty()) { AbfsHttpHeader httpHeader = new AbfsHttpHeader(HttpHeaderConfigurations.X_MS_ABFS_CLIENT_LATENCY, latencyHeader); requestHeaders.add(httpHeader); } retryCount = 0; LOG.debug("First execution of REST operation - {}", operationType); while (!executeHttpOperation(retryCount++)) { try { LOG.debug("Retrying REST operation {}. RetryCount = {}", operationType, retryCount); Thread.sleep(client.getRetryPolicy().getRetryInterval(retryCount)); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } if (result.getStatusCode() >= HttpURLConnection.HTTP_BAD_REQUEST) { throw new AbfsRestOperationException(result.getStatusCode(), result.getStorageErrorCode(), result.getStorageErrorMessage(), null, result); } LOG.trace("{} REST operation complete", operationType); }
Source:
<code>public Assignment apply(Task task, TaskContext taskContext, String s) { List<OrganizationalEntity> excluded = ((InternalPeopleAssignments)task.getPeopleAssignments()).getExcludedOwners(); UserInfo userInfo = (UserInfo) ((org.jbpm.services.task.commands.TaskContext)taskContext).get(EnvironmentName.TASK_USER_INFO); <START> List<OrganizationalEntity> potentialOwners = task.getPeopleAssignments().getPotentialOwners().parallelStream() <END> .filter(oe -> oe instanceof User && !excluded.contains(oe)) .collect(Collectors.toList()); task.getPeopleAssignments().getPotentialOwners().parallelStream().filter(oe -> oe instanceof Group) .forEach(oe -> { Iterator<OrganizationalEntity> groupUsers = userInfo.getMembersForGroup((Group)oe); if (groupUsers != null) { groupUsers.forEachRemaining(user -> { if (user != null && !excluded.contains(user) && !potentialOwners.contains(user)) { potentialOwners.add(user); } }); } }); String queueName = getQueueName(task); CircularQueue<OrganizationalEntity> mappedQueue = null; if (circularQueueMap.containsKey(queueName)) { final CircularQueue<OrganizationalEntity> queue = circularQueueMap.get(queueName); potentialOwners.forEach(po -> { if (!queueContainsUser(queue,po)) { queue.add(po); } }); queue.removeIf(oe -> !potentialOwners.contains(oe)); mappedQueue = queue; } else { CircularQueue<OrganizationalEntity> queue = new CircularQueue(); potentialOwners.forEach(po -> {queue.add(po);}); circularQueueMap.put(queueName,queue); mappedQueue = queue; } OrganizationalEntity owner = mappedQueue.take(); return new Assignment(owner.getId()); }</code><technical_language>List of potential owners is small advatage of parallelStream</technical_language>

Target:
public Assignment apply(Task task, TaskContext taskContext, String s) { List<OrganizationalEntity> excluded = ((InternalPeopleAssignments)task.getPeopleAssignments()).getExcludedOwners(); UserInfo userInfo = (UserInfo) ((org.jbpm.services.task.commands.TaskContext)taskContext).get(EnvironmentName.TASK_USER_INFO); List<OrganizationalEntity> potentialOwners = task.getPeopleAssignments().getPotentialOwners().stream() .filter(oe -> oe instanceof User && !excluded.contains(oe)) .collect(Collectors.toList()); task.getPeopleAssignments().getPotentialOwners().stream().filter(oe -> oe instanceof Group) .forEach(oe -> { Iterator<OrganizationalEntity> groupUsers = userInfo.getMembersForGroup((Group)oe); if (groupUsers != null) { groupUsers.forEachRemaining(user -> { if (user != null && !excluded.contains(user) && !potentialOwners.contains(user)) { potentialOwners.add(user); } }); } }); String queueName = getQueueName(task); CircularQueue<OrganizationalEntity> mappedQueue = synchronizedQueue(queueName,potentialOwners); OrganizationalEntity owner = mappedQueue.take(); return new Assignment(owner.getId()); }
Source:
<code>protected void testAccessControl() throws Exception { StudentAttributes student = typicalBundle.students.get("student1InCourse1"); String feedbackSessionName = "First feedback session"; String courseId = student.course; String moderatedStudentEmail = student.email; String[] submissionParams = new String[]{ Const.ParamsNames.COURSE_ID, courseId, Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName, Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, moderatedStudentEmail }; verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); <START> verifyUnaccessibleWithoutModifyCoursePrivilege(submissionParams); <END> }</code><technical_language>testDifferentPrivileges moved here</technical_language>

Target:
protected void testAccessControl() throws Exception { testDifferentPrivileges(); StudentAttributes student = typicalBundle.students.get("student1InCourse1"); String feedbackSessionName = "First feedback session"; String courseId = student.course; String moderatedStudentEmail = student.email; String[] submissionParams = new String[]{ Const.ParamsNames.COURSE_ID, courseId, Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName, Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, moderatedStudentEmail }; verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); verifyUnaccessibleWithoutModifySessionCommentInSectionsPrivilege(submissionParams); }
Source:
<code>public void testWriteBehind() throws ClassNotFoundException, InstantiationException, IllegalAccessException, SAXException, IOException, InterruptedException { Configuration configuration = new XmlConfiguration(this.getClass().getResource("/configs/writebehind-cache.xml")); assertThat(configuration.getCacheConfigurations().containsKey("bar"), is(true)); final CacheManager cacheManager = CacheManagerBuilder.newCacheManager(configuration); cacheManager.init(); final Cache<Number, String> cache = cacheManager.getCache("bar", Number.class, String.class); assertThat(cache, notNullValue()); assertThat(cache.get(1), notNullValue()); final Number key = new Long(42); TestCacheLoaderWriter.latch = new CountDownLatch(1); cache.put(key, "Bye y'all!"); <START> TestCacheLoaderWriter.latch.await(); <END> assertThat(TestCacheLoaderWriter.lastWrittenKey, is(key)); assertThat(configuration.getCacheConfigurations().containsKey("template1"), is(true)); final Cache<Number, String> templateCache = cacheManager.getCache("template1", Number.class, String.class); assertThat(templateCache, notNullValue()); assertThat(templateCache.get(1), notNullValue()); final Number key1 = new Long(100); TestCacheLoaderWriter.latch = new CountDownLatch(1); templateCache.put(key1, "Bye y'all!"); TestCacheLoaderWriter.latch.await(); assertThat(TestCacheLoaderWriter.lastWrittenKey, is(key1)); }</code><technical_language>need timeout... if this break, this lock for ever..</technical_language>

Target:
public void testWriteBehind() throws ClassNotFoundException, InstantiationException, IllegalAccessException, SAXException, IOException, InterruptedException { Configuration configuration = new XmlConfiguration(this.getClass().getResource("/configs/writebehind-cache.xml")); assertThat(configuration.getCacheConfigurations().containsKey("bar"), is(true)); final CacheManager cacheManager = CacheManagerBuilder.newCacheManager(configuration); cacheManager.init(); final Cache<Number, String> cache = cacheManager.getCache("bar", Number.class, String.class); assertThat(cache, notNullValue()); assertThat(cache.get(1), notNullValue()); final Number key = new Long(42); TestCacheLoaderWriter.latch = new CountDownLatch(1); cache.put(key, "Bye y'all!"); TestCacheLoaderWriter.latch.await(2, TimeUnit.SECONDS); assertThat(TestCacheLoaderWriter.lastWrittenKey, is(key)); assertThat(configuration.getCacheConfigurations().containsKey("template1"), is(true)); final Cache<Number, String> templateCache = cacheManager.getCache("template1", Number.class, String.class); assertThat(templateCache, notNullValue()); assertThat(templateCache.get(1), notNullValue()); final Number key1 = new Long(100); TestCacheLoaderWriter.latch = new CountDownLatch(1); templateCache.put(key1, "Bye y'all!"); TestCacheLoaderWriter.latch.await(2, TimeUnit.SECONDS); assertThat(TestCacheLoaderWriter.lastWrittenKey, is(key1)); }
Source:
<code>public void testSync10() throws Exception { try { Path sourcePath = new Path(dfs.getWorkingDirectory(), "source"); initData10(sourcePath); dfs.allowSnapshot(sourcePath); dfs.createSnapshot(sourcePath, "s1"); <START> generateFilterFile("/tmp", "filters.txt"); <END> final DistCpOptions.Builder builder = new DistCpOptions.Builder( new ArrayList<>(Arrays.asList(sourcePath)), target) .withFiltersFile("/tmp/filters.txt") .withSyncFolder(true); new DistCp(conf, builder.build()).execute(); dfs.allowSnapshot(target); dfs.createSnapshot(target, "s1"); changeData10(sourcePath); dfs.createSnapshot(sourcePath, "s2"); final DistCpOptions.Builder diffBuilder = new DistCpOptions.Builder( new ArrayList<>(Arrays.asList(sourcePath)), target) .withUseDiff("s1", "s2") .withFiltersFile("/tmp/filters.txt") .withSyncFolder(true); new DistCp(conf, diffBuilder.build()).execute(); verifyCopy(dfs.getFileStatus(sourcePath), dfs.getFileStatus(target), false); } finally { deleteFilterFile("/tmp", "filters.txt"); } }</code><technical_language>rely /tmp, especially jenkins systems. temp file API call in File itself,</technical_language>

Target:
public void testSync10() throws Exception { java.nio.file.Path filterFile = null; try { Path sourcePath = new Path(dfs.getWorkingDirectory(), "source"); initData10(sourcePath); dfs.allowSnapshot(sourcePath); dfs.createSnapshot(sourcePath, "s1"); filterFile = generateFilterFile("filters"); final DistCpOptions.Builder builder = new DistCpOptions.Builder( new ArrayList<>(Arrays.asList(sourcePath)), target) .withFiltersFile(filterFile.toString()) .withSyncFolder(true); new DistCp(conf, builder.build()).execute(); verifySync(dfs.getFileStatus(sourcePath), dfs.getFileStatus(target), false, ".staging"); dfs.allowSnapshot(target); dfs.createSnapshot(target, "s1"); changeData10(sourcePath); dfs.createSnapshot(sourcePath, "s2"); final DistCpOptions.Builder diffBuilder = new DistCpOptions.Builder( new ArrayList<>(Arrays.asList(sourcePath)), target) .withUseDiff("s1", "s2") .withFiltersFile(filterFile.toString()) .withSyncFolder(true); new DistCp(conf, diffBuilder.build()).execute(); verifyCopy(dfs.getFileStatus(sourcePath), dfs.getFileStatus(target), false); } finally { deleteFilterFile(filterFile); } }
Source:
<code>private static String getTimeZone(VM vm) { String retVal; String timeZone = null; if (vm.getVmInit() != null && StringUtils.isNotEmpty(vm.getVmInit().getTimeZone())) { timeZone = vm.getVmInit().getTimeZone(); } else { timeZone = Config.<String> getValue(ConfigValues.DefaultWindowsTimeZone); } if (osRepository.isTimezoneValueInteger(vm.getStaticData(). getOsId(), null)) { <START> retVal = getTimezoneIndexByKey(timeZone); <END> } else { retVal = timeZone; } return retVal; }</code><technical_language>i timezone variable, set if here, do in else</technical_language>

Target:
private static String getTimeZone(VM vm) { String timeZone = null; if (vm.getVmInit() != null && StringUtils.isNotEmpty(vm.getVmInit().getTimeZone())) { timeZone = vm.getVmInit().getTimeZone(); } else { timeZone = Config.<String> getValue(ConfigValues.DefaultWindowsTimeZone); } if (osRepository.isTimezoneValueInteger(vm.getStaticData(). getOsId(), null)) { return getTimezoneIndexByKey(timeZone); } return timeZone; }
Source:
<code>void testGetMissingConfigThrowsException() throws Exception { final String key = "foo.bar.baz"; BrooklynProperties properties = ((ManagementContextInternal)getManagementContext()).getBrooklynProperties(); Object existingValue = null; boolean keyAlreadyPresent = false; String response = null; if (properties.containsKey(key)) { existingValue = properties.remove(key); keyAlreadyPresent = true; } try { response = client().resource("/v1/server/config/" + key).get(String.class); } catch (UniformInterfaceException e) { <START> assertEquals(e.getResponse().getStatus(), 204); <END> return; } finally { if (keyAlreadyPresent) { properties.put(key, existingValue); } } Asserts.fail("Expected call to /v1/server/config/" + key + " to fail with status 404, instead server returned " + response); }</code><technical_language>this test pass?! asserting a 204 a 404 (i.e. "No Content'). personal preference is put Asserts.fail try block, do a return catch block. I find clearer, strong feelings</technical_language>

Target:
void testGetMissingConfigThrowsException() throws Exception { final String key = "foo.bar.baz"; BrooklynProperties properties = ((ManagementContextInternal)getManagementContext()).getBrooklynProperties(); Object existingValue = null; boolean keyAlreadyPresent = false; String response = null; if (properties.containsKey(key)) { existingValue = properties.remove(key); keyAlreadyPresent = true; } try { response = client().resource("/v1/server/config/" + key).get(String.class); Asserts.fail("Expected call to /v1/server/config/" + key + " to fail with status 404, instead server returned " + response); } catch (UniformInterfaceException e) { assertEquals(e.getResponse().getStatus(), 204); } finally { if (keyAlreadyPresent) { properties.put(key, existingValue); } } }
Source:
<code>public abstract void scanForRepoChanges() throws IOException; public static String shortenRefName(String refName) { if (refName.startsWith(Constants.R_HEADS)) return refName.substring(Constants.R_HEADS.length()); if (refName.startsWith(Constants.R_TAGS)) return refName.substring(Constants.R_TAGS.length()); if (refName.startsWith(Constants.R_REMOTES)) return refName.substring(Constants.R_REMOTES.length()); if (refName.startsWith(Constants.R_NOTES)) <START> return refName.substring(Constants.R_NOTES.length()); <END> return refName; }</code><technical_language>slightly worried shorten here. start ambiguous other branches. expand a shortened name "review" "refs/notes/review" RefDatabase consider "refs/notes/" namespace of search prefixes. This a method, in NoteMap class</technical_language>

Target:
public abstract void scanForRepoChanges() throws IOException; public static String shortenRefName(String refName) { if (refName.startsWith(Constants.R_HEADS)) return refName.substring(Constants.R_HEADS.length()); if (refName.startsWith(Constants.R_TAGS)) return refName.substring(Constants.R_TAGS.length()); if (refName.startsWith(Constants.R_REMOTES)) return refName.substring(Constants.R_REMOTES.length()); return refName; }
Source:
<code>public static boolean isValidSingleVersion( final String version ) { boolean result = true; if ( version == null || version.trim().length() < 1 ) { <START> result = false; <END> } try { SingleVersion singleVersion = new VersionParser( version ).single(); } catch ( final ParseException e ) { result = false; } catch ( final TokenMgrError e ) { result = false; } return result; }</code><technical_language>return false here. logic prevent parse input is null empty. fixed, merge will. :smiley:</technical_language>

Target:
public static boolean isValidSingleVersion( final String version ) { boolean result = true; if ( version == null || version.trim().length() < 1 ) { return false; } try { SingleVersion singleVersion = new VersionParser( version ).single(); } catch ( final ParseException e ) { result = false; } catch ( final TokenMgrError e ) { result = false; } return result; }
Source:
<code>public SynapseJsonPath(String jsonPathExpression) throws JaxenException { super(jsonPathExpression, SynapsePath.JSON_PATH, log); EIPUtils.setJsonPathConfiguration(); this.contentAware = true; <START> Pattern fullPattern = Pattern.compile(JSON_PATH_WITH_PROP_REGEX); <END> Matcher fullMatcher = fullPattern.matcher(jsonPathExpression); if (fullMatcher.matches()) { Pattern extractProp = Pattern.compile(EXTRACT_PROP_REGEX); Matcher extractPropMatcher = extractProp.matcher(jsonPathExpression); if (extractPropMatcher.find()) { propertyExpression = extractPropMatcher.group(0); expression = "$" + jsonPathExpression.substring(propertyExpression.length()); } } else { this.expression = jsonPathExpression; } if (expression.endsWith(".")) { expression = expression.substring(0, expression.length() - 1); } jsonPath = JsonPath.compile(expression); if ("$".equals(jsonPath.getPath().trim()) || "$.".equals(jsonPath.getPath().trim())) { isWholeBody = true; } if (InlineExpressionUtil.checkForInlineExpressions(expression)) { isJSONPathNeedsProcessing = true; } this.setPathType(SynapsePath.JSON_PATH); }</code><technical_language>a small test compare this Startswith()</technical_language>

Target:
public SynapseJsonPath(String jsonPathExpression) throws JaxenException { super(jsonPathExpression, SynapsePath.JSON_PATH, log); EIPUtils.setJsonPathConfiguration(); this.contentAware = true; if (jsonPathExpression.startsWith("$ctx:") || jsonPathExpression.startsWith("$trp:") || jsonPathExpression.startsWith("$axis2:")) { Pattern extractProp = Pattern.compile(EXTRACT_PROP_REGEX); Matcher extractPropMatcher = extractProp.matcher(jsonPathExpression); if (extractPropMatcher.find()) { propertyExpression = extractPropMatcher.group(0); expression = "$" + jsonPathExpression.substring(propertyExpression.length()); } } else { this.expression = jsonPathExpression; } if (expression.endsWith(".")) { expression = expression.substring(0, expression.length() - 1); } jsonPath = JsonPath.compile(expression); if ("$".equals(jsonPath.getPath().trim()) || "$.".equals(jsonPath.getPath().trim())) { isWholeBody = true; } if (InlineExpressionUtil.checkForInlineExpressions(expression)) { isJSONPathNeedsProcessing = true; } this.setPathType(SynapsePath.JSON_PATH); }
Source:
<code>public void logChunk(String chunk) { <START> Log.d(tag, chunk); <END> }</code><technical_language>This calling getTag()</technical_language>

Target:
public void logChunk(String chunk) { Log.d(getTag(), chunk); }
Source:
<code><START> public int[] getRawTimingData() <END> { return rawTimingData; }</code><technical_language>Do expose this? this is exposed, modified of nature of arrays</technical_language>

Target:
public int[] getRawTimingData(){ return Arrays.copyOfRange(rawTimingData, 0, rawTimingData.length); }
Source:
<code>protected boolean checkExistence(String uid) { if (moduleTypeRegistry.get(uid) != null) { <START> logger.error("Module Type with UID \"{}\" already exists! Failed to create a second with the same UID!", <END> uid, new IllegalArgumentException()); return true; } return false; }</code><technical_language>error logging is unexpected. A method checkExistence simply return true false side effects</technical_language>

Target:
protected boolean checkExistence(String uid) { if (moduleTypeRegistry.get(uid) != null) { return true; } return false; }
Source:
<code>public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = new HashMap<String, String>(); VmPool vmPool = getParameters().getVmPool(); <START> String vmPoolName = vmPool != null ? vmPool.getVmPoolName() : StringUtils.EMPTY; <END> jobProperties.put(VdcObjectType.VmPool.name().toLowerCase(), vmPoolName); Guid vmTemplateId = getVmTemplateId(); String templateName = getVmTemplateName(); if (StringUtils.isEmpty(templateName)) { templateName = vmTemplateId == null ? StringUtils.EMPTY : vmTemplateId.toString(); } jobProperties.put(VdcObjectType.VmTemplate.name().toLowerCase(), templateName); } return jobProperties; }</code><technical_language>consider positive ? String vmPoolName = vmPool == null ? StringUtils.EMPTY : vmPool.getVmPoolName();</technical_language>

Target:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = new HashMap<String, String>(); VmPool vmPool = getParameters().getVmPool(); String vmPoolName = vmPool == null ? StringUtils.EMPTY : vmPool.getVmPoolName(); jobProperties.put(VdcObjectType.VmPool.name().toLowerCase(), vmPoolName); Guid vmTemplateId = getVmTemplateId(); String templateName = getVmTemplateName(); if (StringUtils.isEmpty(templateName)) { templateName = vmTemplateId == null ? StringUtils.EMPTY : vmTemplateId.toString(); } jobProperties.put(VdcObjectType.VmTemplate.name().toLowerCase(), templateName); } return jobProperties; }
Source:
<code>public void testSimultaneousUpdateCustomizedState() { <START> int n = 10; <END> List<Callable<Boolean>> threads = new ArrayList<>(); for (int i = 0; i < n; i++) { threads.add(new TestSimultaneousUpdate()); } Map<String, Boolean> resultMap = TestHelper.startThreadsConcurrently(threads, 1000); Assert.assertEquals(resultMap.size(), n); Boolean[] results = new Boolean[n]; Arrays.fill(results, true); Assert.assertEqualsNoOrder(resultMap.values().toArray(), results); }</code><technical_language>a good idea 'n's this - please a int constant more descriptive</technical_language>

Target:
public void testSimultaneousUpdateCustomizedState() { List<Callable<Boolean>> threads = new ArrayList<>(); int threadCount = 10; for (int i = 0; i < threadCount; i++) { threads.add(new TestSimultaneousUpdate()); } Map<String, Boolean> resultMap = TestHelper.startThreadsConcurrently(threads, 1000); Assert.assertEquals(resultMap.size(), threadCount); Boolean[] results = new Boolean[threadCount]; Arrays.fill(results, true); Assert.assertEqualsNoOrder(resultMap.values().toArray(), results); }
Source:
<code>public void test01_ldapOnlyGroupMappings() { test01_ldapOnlyGroupMappings(true); try { <START> Thread.sleep(1000000000); <END> } catch (InterruptedException e) { e.printStackTrace(); } }</code><technical_language>????</technical_language>

Target:
public void test01_ldapOnlyGroupMappings() { test01_ldapOnlyGroupMappings(true); }
Source:
<code>public SearchScope getUseScope() { final PsiElement parent = getParent(); if(parent != null) { if (this instanceof HaxeLocalVarDeclarationPart) { <START> return new LocalSearchScope(parent.getParent()); <END> } else if (this instanceof HaxeLocalVarDeclaration) { return new LocalSearchScope(parent); } } return super.getUseScope(); }</code><technical_language>growing concerned code this. If expand tree for some reason, code expects a parent of a type a place, code this break. I (and writing) code this a lot. I UsefulPsiTreeUtil.getParentOfType() instead of expecting a specific element's tree position. do think</technical_language>

Target:
public SearchScope getUseScope() { final PsiElement localVar = UsefulPsiTreeUtil.getParentOfType(this, HaxeLocalVarDeclaration.class); if(localVar != null) { final PsiElement outerBlock = UsefulPsiTreeUtil.getParentOfType(localVar, HaxeBlockStatement.class); if(outerBlock != null) { return new LocalSearchScope(outerBlock); } } return super.getUseScope(); }
Source:
<code>@Override public void init(StreamGraph graph, Config config) { MessageStream<PageViewEvent> pageViewEvents = graph.getInputStream("pageViewEventStream", new JsonSerdeV2<>(PageViewEvent.class)); OutputStream<KV<String, PageViewCount>> pageViewEventPerMemberStream = graph.getOutputStream("pageViewEventPerMemberStream", KVSerde.of(new StringSerde(), new JsonSerdeV2<>(PageViewCount.class))); Supplier<Integer> initialValue = () -> 0; FoldLeftFunction<PageViewEvent, Integer> foldLeftFn = (m, c) -> c + 1; pageViewEvents .window(Windows.keyedTumblingWindow(m -> m.memberId, Duration.ofSeconds(10), initialValue, foldLeftFn, null, null) .setEarlyTrigger(Triggers.repeat(Triggers.count(5))) <START> .setAccumulationMode(AccumulationMode.DISCARDING), "window") <END> .map(windowPane -> KV.of(windowPane.getKey().getKey(), new PageViewCount(windowPane))) .sendTo(pageViewEventPerMemberStream); }</code><technical_language>trivial: window/tumblingWindow</technical_language>

Target:
@Override public void init(StreamGraph graph, Config config) { MessageStream<PageViewEvent> pageViewEvents = graph.getInputStream("pageViewEventStream", new JsonSerdeV2<>(PageViewEvent.class)); OutputStream<KV<String, PageViewCount>> pageViewEventPerMemberStream = graph.getOutputStream("pageViewEventPerMemberStream", KVSerde.of(new StringSerde(), new JsonSerdeV2<>(PageViewCount.class))); Supplier<Integer> initialValue = () -> 0; FoldLeftFunction<PageViewEvent, Integer> foldLeftFn = (m, c) -> c + 1; pageViewEvents .window(Windows.keyedTumblingWindow(m -> m.memberId, Duration.ofSeconds(10), initialValue, foldLeftFn, null, null) .setEarlyTrigger(Triggers.repeat(Triggers.count(5))) .setAccumulationMode(AccumulationMode.DISCARDING), "tumblingWindow") .map(windowPane -> KV.of(windowPane.getKey().getKey(), new PageViewCount(windowPane))) .sendTo(pageViewEventPerMemberStream); }
Source:
<code>private Metacard getPreviousMetacardWithId(String id, Map<String, Metacard> previousMetacards) { Metacard previous; previous = previousMetacards .entrySet() .stream() <START> .map(e -> e.getValue()) <END> .filter((x) -> x.getId().equals(id)) .findFirst() .orElse(null); return previous; }</code><technical_language>replaced method reference</technical_language>

Target:
private Metacard getPreviousMetacardWithId(String id, Map<String, Metacard> previousMetacards) { Metacard previous; previous = previousMetacards .entrySet() .stream() .map(Map.Entry::getValue) .filter(x -> x.getId().equals(id)) .findFirst() .orElse(null); if (previous == null) { LOGGER.debug("Cannot locate metacard for update.", id); return null; } return previous; }
Source:
<code>public SmallRyeHealth getHealth() { <START> String emptyChecksStatus = emptyLivenessChecksStatus.equals(DOWN) || emptyReadinessChecksStatus.equals(DOWN) ? DOWN : UP; <END> return getHealth(emptyChecksStatus, healthChecks, livenessChecks, readinessChecks); }</code><technical_language>a proposal - changing this DOWN.equals(emptyLivenessChecksStatus) || DOWN.equals(emptyReadinessChecksStatus) ? : UP; prevent some NPEs</technical_language>

Target:
public SmallRyeHealth getHealth() { String emptyChecksStatus = DOWN.equals(emptyLivenessChecksStatus) || DOWN.equals(emptyReadinessChecksStatus) ? DOWN : UP; return getHealth(emptyChecksStatus, healthChecks, livenessChecks, readinessChecks); }
Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { log.debug("Entered SSOLoginFilter"); HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse res = (HttpServletResponse) response; if (req.getSession(false) == null || req.getSession(false).getAttribute(FiltersHelper.Constants.LOGOUT_INPROGRESS) == null) { StringBuffer requestURL = req.getRequestURL(); if (StringUtils.isNotEmpty(req.getQueryString())) { requestURL.append("?").append(req.getQueryString()); } if (!FiltersHelper.isAuthenticated(req) || !FiltersHelper.isSessionValid((HttpServletRequest) request)) { log.debug("Redirecting to {}{}&app_url={}&locale={}", req.getServletContext().getContextPath(), loginUrl, URLEncoder.encode(requestURL.toString(), "UTF-8"), request.getAttribute("locale").toString()); res.sendRedirect(String.format("%s%s&app_url=%s&locale=%s", req.getServletContext().getContextPath(), loginUrl, URLEncoder.encode(requestURL.toString(), "UTF-8"), <START> request.getAttribute("locale").toString())); <END> } else { log.debug("Already logged in, executing next filter in chain."); res.addHeader("OVIRT-SSO-TOKEN", URLEncoder.encode((String) ((HttpServletRequest) request).getSession(true).getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY), "UTF-8")); chain.doFilter(request, response); } } log.debug("Exiting SSOLoginFilter"); }</code><technical_language>Please format URL reuse: String redirectTo = String.format( "%s%s&app_url=%s&locale=%s", req.getServletContext().getContextPath(), loginUrl, URLEncoder.encode(requestURL.toString(), "UTF-8"), request.getAttribute("locale").toString()); log.debug("Redirecting '{}'", redirectTo); res.sendRedirect(redirectTo); btw is URLBuilder instead of String.format</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { log.debug("Entered SSOLoginFilter"); HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse res = (HttpServletResponse) response; if (req.getSession(false) == null || req.getSession(false).getAttribute(FiltersHelper.Constants.LOGOUT_INPROGRESS) == null) { StringBuffer requestURL = req.getRequestURL(); if (StringUtils.isNotEmpty(req.getQueryString())) { requestURL.append("?").append(req.getQueryString()); } if (!FiltersHelper.isAuthenticated(req) || !FiltersHelper.isSessionValid((HttpServletRequest) request)) { String url = new URLBuilder(String.format("%s%s", req.getServletContext().getContextPath(), loginUrl)) .addParameter("app_url", requestURL.toString()) .addParameter("locale", request.getAttribute("locale").toString()) .build(); log.debug("Redirecting to {}", url); res.sendRedirect(url); } else { log.debug("Already logged in, executing next filter in chain."); res.addHeader("OVIRT-SSO-TOKEN", URLEncoder.encode((String) ((HttpServletRequest) request) .getSession(true) .getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY), "UTF-8")); chain.doFilter(request, response); } } log.debug("Exiting SSOLoginFilter"); }
Source:
<code>public void addCoFeature(final Gff3FeatureImpl coFeature) { if (!parents.equals(coFeature.getParents())) { <START> throw new TribbleException("Co-featrues " + baseData.id + " do not have same parents"); <END> } for (final Gff3FeatureImpl feature : coFeatures) { feature.addCoFeatureShallow(coFeature); coFeature.addCoFeatureShallow(feature); } addCoFeatureShallow(coFeature); coFeature.addCoFeatureShallow(this); }</code><technical_language>suggestion throw new TribbleException("Co-features " + baseData.id + " do parents");</technical_language>

Target:
public void addCoFeature(final Gff3FeatureImpl coFeature) { if (!parents.equals(coFeature.getParents())) { throw new TribbleException("Co-features " + baseData.id + " do not have same parents"); } for (final Gff3FeatureImpl feature : coFeatures) { feature.addCoFeatureShallow(coFeature); coFeature.addCoFeatureShallow(feature); } addCoFeatureShallow(coFeature); coFeature.addCoFeatureShallow(this); }
Source:
<code>public void onBackPressed(){ patientAdapter.cancelBackgroundTask(); listView.clearFocus(); super.onBackPressed(); if(getCurrentFocus() != null) { <START> System.out.println("Current focusssssssss: " + getCurrentFocus().toString()); <END> } else { System.out.println("Current focusssssssss: null"); } }</code><technical_language>Do need remove this</technical_language>

Target:
public void onBackPressed(){ patientAdapter.cancelBackgroundTask(); listView.clearFocus(); super.onBackPressed(); }
Source:
<code>protected Map<String, Object> computeInitialOffset( String tableOrQuery, Map<String, Object> partitionOffset, TimeZone timezone) { if (!(partitionOffset == null)) { return partitionOffset; } else { Map<String, Object> initialPartitionOffset = null; Long timestampInitial = config.getLong(JdbcSourceConnectorConfig.TIMESTAMP_INITIAL_CONFIG); if (timestampInitial != null) { if (timestampInitial == JdbcSourceConnectorConfig.TIMESTAMP_INITIAL_CURRENT) { <START> try (Connection con = cachedConnectionProvider.getConnection()) { <END> Calendar cal = Calendar.getInstance(timezone); timestampInitial = dialect.currentTimeOnDB(con, cal).getTime(); } catch (SQLException e) { throw new ConnectException("Error while getting initial timestamp from database", e); } } initialPartitionOffset = new HashMap<String, Object>(); initialPartitionOffset.put(TimestampIncrementingOffset.TIMESTAMP_FIELD, timestampInitial); log.info("No offsets found for '{}', so using configured timestamp {}", tableOrQuery, timestampInitial); } return initialPartitionOffset; } }</code><technical_language>pull getConnection of try-with-resources? a cached connection object, closing invalidates object forces task reconnect continuing. validateNonNullable for example</technical_language>

Target:
protected Map<String, Object> computeInitialOffset( String tableOrQuery, Map<String, Object> partitionOffset, TimeZone timezone) { if (!(partitionOffset == null)) { return partitionOffset; } else { Map<String, Object> initialPartitionOffset = null; Long timestampInitial = config.getLong(JdbcSourceConnectorConfig.TIMESTAMP_INITIAL_CONFIG); if (timestampInitial != null) { if (timestampInitial == JdbcSourceConnectorConfig.TIMESTAMP_INITIAL_CURRENT) { try { final Connection con = cachedConnectionProvider.getConnection(); Calendar cal = Calendar.getInstance(timezone); timestampInitial = dialect.currentTimeOnDB(con, cal).getTime(); } catch (SQLException e) { throw new ConnectException("Error while getting initial timestamp from database", e); } } initialPartitionOffset = new HashMap<String, Object>(); initialPartitionOffset.put(TimestampIncrementingOffset.TIMESTAMP_FIELD, timestampInitial); log.info("No offsets found for '{}', so using configured timestamp {}", tableOrQuery, timestampInitial); } return initialPartitionOffset; } }
Source:
<code><START> private int read(SelectionKey key) throws InterruptedException, IOException { <END> SocketChannel socketChannel = (SocketChannel)key.channel(); SocketServerInputSet input = null; if(key.attachment() == null) { input = new SocketServerInputSet(); key.attach(input); } else { input = (SocketServerInputSet)key.attachment(); } int bytesRead = input.readFrom(socketChannel); if(bytesRead == -1) return -1; logger.trace("bytes read from {}", socketChannel.socket().getRemoteSocketAddress()); if(input.isReadComplete()) { SocketServerRequest req = new SocketServerRequest(id, key, input); channel.sendRequest(req); key.attach(null); key.interestOps(key.interestOps() & (~SelectionKey.OP_READ)); logger.trace("resetting read interest for key for {}", ((SocketChannel) key.channel()).socket().getRemoteSocketAddress()); } else { if (logger.isTraceEnabled()) { logger.trace("Did not finish reading, registering for read again on connection {}", socketChannel.socket().getRemoteSocketAddress()); } key.interestOps(SelectionKey.OP_READ); wakeup(); } return bytesRead; }</code><technical_language>this void. close key get -1</technical_language>

Target:
private void read(SelectionKey key) throws InterruptedException, IOException { SocketChannel socketChannel = (SocketChannel) key.channel(); SocketServerInputSet input = null; if (key.attachment() == null) { input = new SocketServerInputSet(); key.attach(input); } else { input = (SocketServerInputSet) key.attachment(); } long bytesRead = input.readFrom(socketChannel); if (bytesRead == -1) { close(key); return; } logger.trace("bytes read from {}", socketChannel.socket().getRemoteSocketAddress()); if (input.isReadComplete()) { SocketServerRequest req = new SocketServerRequest(id, key, input); channel.sendRequest(req); key.attach(null); key.interestOps(key.interestOps() & (~SelectionKey.OP_READ)); logger.trace("resetting read interest for key for {}", ((SocketChannel) key.channel()).socket().getRemoteSocketAddress()); } else { if (logger.isTraceEnabled()) { logger.trace("Did not finish reading, registering for read again on connection {}", socketChannel.socket().getRemoteSocketAddress()); } key.interestOps(SelectionKey.OP_READ); wakeup(); } }
Source:
<code>protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR_ACTION_GEO_REP_RESUME); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_VOLUME); <START> } <END></code><technical_language>Add canDoAction verify session is in paused state. resume if session is paused</technical_language>

Target:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__RESUME); }
Source:
<code>public Function<Context, Context> contextPropagationFlag() { <START> return ctx -> ctx.put("ctxPropagated", true); <END> }</code><technical_language>a constant</technical_language>

Target:
public Function<Context, Context> contextPropagationFlag() { return ctx -> ctx.put(CTX_PROPAGATED_KEY, true); }
Source:
<code>public PullRequest getUpstreamPullRequest(final PullRequest pullRequest) throws MalformedURLException, NotFoundException { <START> Objects.requireNonNull(pullRequest, "url cannot be null"); <END> checkIssueTrackerExists(); if (this.isUpstreamRequired(pullRequest)) { final String body = pullRequest.getBody(); final String[] url = extractURLs(body, UPSTREAM_PR, false); if (url == null || url.length == 0 || url[0] == null) return null; else return getPullRequest(new URL(url[0])); } else { return null; } }</code><technical_language>incorrect message "url null"</technical_language>

Target:
public PullRequest getUpstreamPullRequest(final PullRequest pullRequest) throws MalformedURLException, NotFoundException { Objects.requireNonNull(pullRequest, "pull request cannot be null"); checkIssueTrackerExists(); if (this.isUpstreamRequired(pullRequest)) { final String body = pullRequest.getBody(); final String[] url = extractURLs(body, UPSTREAM_PR, false); if (url == null || url.length == 0 || url[0] == null) return null; else return getPullRequest(new URL(url[0])); } else { return null; } }
Source:
<code>private Stream<JavaFileScannerContext.Location> methodInvocationFlow(Constraint learnedConstraint, ExplodedGraph.Node currentNode, ExplodedGraph.Node parent) { MethodInvocationTree mit = (MethodInvocationTree) parent.programPoint.syntaxTree(); MethodYield selectedMethodYield = currentNode.selectedMethodYield(parent); if (selectedMethodYield == null) { return Stream.of(location(parent, String.format("'%s()' invoked.", mit.symbol().name()))); } Stream.Builder<JavaFileScannerContext.Location> flow = Stream.builder(); <START> if (selectedMethodYield.isExceptional()) { <END> Type exceptionType = selectedMethodYield.exceptionType(); String exception = exceptionType == null || exceptionType.isUnknown() ? "Exception" : exceptionType.name(); flow.add(location(parent, String.format("'%s' thrown by '%s()'.", exception, mit.symbol().name()))); } if (selectedMethodYield.resultConstraint == learnedConstraint) { flow.add(location(parent, String.format("'%s()' returns %s.", mit.symbol().name(), learnedConstraint.valueAsString()))); } int argIdx = correspondingArgumentIndex(symbolicValue, parent); if (argIdx != -1) { ExpressionTree argTree = mit.arguments().get(argIdx); String message = String.format("Implies '%s' is %s.", SyntaxTreeNameFinder.getName(argTree), learnedConstraint.valueAsString()); flow.add(new JavaFileScannerContext.Location(message, argTree)); } selectedMethodYield.flow(argIdx).forEach(flow::add); return flow.build(); }</code><technical_language>For this feature is part of this 2004 issue, this is anywhere. I this is a bad this part of a broader reflexion displaying path users. I personnally remove part this commit, if disagree feel free this</technical_language>

Target:
private Stream<JavaFileScannerContext.Location> methodInvocationFlow(Constraint learnedConstraint, ExplodedGraph.Node currentNode, ExplodedGraph.Node parent) { MethodInvocationTree mit = (MethodInvocationTree) parent.programPoint.syntaxTree(); Stream.Builder<JavaFileScannerContext.Location> flowBuilder = Stream.builder(); if (currentNode.programState.peekValue() == symbolicValue) { flowBuilder.add(location(parent, String.format("'%s()' returns %s.", mit.symbol().name(), learnedConstraint.valueAsString()))); } SymbolicValue methodIdentifier = parent.programState.peekValues(mit.arguments().size() + 1).get(mit.arguments().size()); if (methodIdentifier == symbolicValue) { flowBuilder.add(location(parent, "...")); } int argIdx = correspondingArgumentIndex(symbolicValue, parent); if (argIdx != -1) { ExpressionTree argTree = mit.arguments().get(argIdx); String message = String.format("Implies '%s' is %s.", SyntaxTreeNameFinder.getName(argTree), learnedConstraint.valueAsString()); flowBuilder.add(new JavaFileScannerContext.Location(message, argTree)); } MethodYield selectedMethodYield = currentNode.selectedMethodYield(parent); if (selectedMethodYield != null) { selectedMethodYield.flow(argIdx).forEach(flowBuilder::add); } return flowBuilder.build(); }
Source:
<code>public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { <START> if (other.getName().equals(this.getName()) && this.getClass() == other.getClass()) { <END> return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }</code><technical_language>suggest this.getName().equals(other.getName())) other.getName() _probably_ returns a value, this.getName() is guaranteed in constructor return a non-null value</technical_language>

Target:
public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (Objects.equals(getName(), other.getName()) && this.getClass() == other.getClass()) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
Source:
<code>private void handleGroupMessageRequest(GroupMessageRequest serviceRequest) { ServerRequest serverRequest = serviceRequest.parseRequestForServer(); try { mCacheHelper.addMessage(serviceRequest.getMessage(), serviceRequest.getReceivingGroup().getId()); } catch (CacheDatabaseException e) { } try { mCommunicationChannel.sendRequest(serverRequest); } catch (IOException e) { <START> mService.receiveError("no connection available : " + e.getMessage()); <END> } }</code><technical_language>Start a Capital letter. This is missing in other calls receiveError too. a uniform of handling Service exceptions. in case app is closed, show toasts. store errors show next app startup</technical_language>

Target:
private void handleGroupMessageRequest(GroupMessageRequest serviceRequest) { ServerRequest serverRequest = serviceRequest.parseRequestForServer(); try { mCacheHelper.addMessage(serviceRequest.getMessage(), serviceRequest.getReceivingGroup().getId()); } catch (CacheDatabaseException e) { } try { mCommunicationChannel.sendRequest(serverRequest); } catch (IOException e) { mService.receiveError("No connection available : " + e.getMessage()); } }
Source:
<code>public boolean isIncludesDependencies() { <START> return false; <END> }</code><technical_language>wrappedHandler</technical_language>

Target:
public boolean isIncludesDependencies() { return wrappedHandler.isIncludesDependencies(); }
Source:
<code>public PrimitiveLongIterator query( String... terms ) { MultiFieldQueryParser multiFieldQueryParser = new MultiFieldQueryParser( properties, analyzer ); multiFieldQueryParser.setDefaultOperator( QueryParser.Operator.OR ); Query query; try { <START> query = multiFieldQueryParser.parse( String.join( " ", terms ) ); <END> } catch ( ParseException e ) { query = parseFallbackBooleanQuery( multiFieldQueryParser, terms ); } return query( query ); }</code><technical_language>please explain this fall mechanics, do need it</technical_language>

Target:
public PrimitiveLongIterator query( String... terms ) { String concatenatedQuery = String.join( " ", terms ); return innerQuery( concatenatedQuery ); }
Source:
<code>protected LoginPackage preLogin() throws BankException, IOException { urlopen = new Urllib(context, CertificateReader.getCertificates(context, <START> R.raw.cert_americanexpress, R.raw.cert_americanexpress_global)); <END> urlopen.setAllowCircularRedirects(true); urlopen.setContentCharset(HTTP.ISO_8859_1); urlopen.addHeader("Face", "sv_SE"); return new LoginPackage(urlopen, null, null, "<LINK_0>"); }</code><technical_language>Do need cert_americanexpress</technical_language>

Target:
protected LoginPackage preLogin() throws BankException, IOException { urlopen = new Urllib(context, CertificateReader.getCertificates(context, R.raw.cert_americanexpress_global)); urlopen.setAllowCircularRedirects(true); urlopen.setContentCharset(HTTP.UTF_8); urlopen.addHeader("Face", "sv_SE"); return new LoginPackage(urlopen, null, null, "<LINK_0>"); }
Source:
<code>public Locale getLocale() { <START> return Optional.ofNullable(locale).orElse(DEFAULT_LOCALE); <END> }</code><technical_language>need do this. Skip logic requires locale set if used, rely @Required annotation for rest</technical_language>

Target:
public Locale getLocale() { return locale; }
Source:
<code>public void activate(){ toolBoxPanel = new ToolBoxPanel(this); dataUIManager = new DataUIManager(this); parameters = new DockingPanelParameters(); parameters.setTitle(I18N.tr("ToolBox")); parameters.setTitleIcon(ToolBoxIcon.getIcon(ToolBoxIcon.ORBIS_TOOLBOX)); parameters.setCloseable(true); parameters.setName(TOOLBOX_REFERENCE); ActionCommands dockingActions = new ActionCommands(); parameters.setDockActions(dockingActions.getActions()); dockingActions.addPropertyChangeListener(new ActionDockingListener(parameters)); dockingActions.addAction( new DefaultAction(ACTION_REFRESH, ACTION_REFRESH, I18N.tr("Refresh the selected node."), ToolBoxIcon.getIcon(ToolBoxIcon.REFRESH), EventHandler.create(ActionListener.class, this, "refreshAvailableScripts"), null) ); lee = new LogEditableElement(); openEditorList = new ArrayList<>(); le = new LogEditor(lee); dockingManager.addDockingPanel(le); openEditorList.add(le); jobStateListenerList = new ArrayList<>(); jobMap = new HashMap<>(); refreshAvailableScripts(); editorFactory = new ProcessEditorFactory(editorManager, this); <START> editorManager.addEditorFactory(editorFactory); <END> }</code><technical_language>ProcessEditorFactory a service place call editorManager.addEditorFactory</technical_language>

Target:
public void activate(){ toolBoxPanel = new ToolBoxPanel(this); dataUIManager = new DataUIManager(this); parameters = new DockingPanelParameters(); parameters.setTitle(I18N.tr("ToolBox")); parameters.setTitleIcon(ToolBoxIcon.getIcon(ToolBoxIcon.ORBIS_TOOLBOX)); parameters.setCloseable(true); parameters.setName(TOOLBOX_REFERENCE); ActionCommands dockingActions = new ActionCommands(); parameters.setDockActions(dockingActions.getActions()); dockingActions.addPropertyChangeListener(new ActionDockingListener(parameters)); dockingActions.addAction( new DefaultAction(ACTION_REFRESH, ACTION_REFRESH, I18N.tr("Refresh the selected node."), ToolBoxIcon.getIcon(ToolBoxIcon.REFRESH), EventHandler.create(ActionListener.class, this, "refreshAvailableScripts"), null) ); lee = new LogEditableElement(); openEditorList = new ArrayList<>(); le = new LogEditor(lee); dockingManager.addDockingPanel(le); openEditorList.add(le); jobStateListenerList = new ArrayList<>(); jobMap = new HashMap<>(); refreshAvailableScripts(); }
Source:
<code>public String toString() { String out = header() + "\n"; for (MafEntry entry: entries_){ <START> out += entry.src + " " <END> + Integer.toString(entry.start0) + " " + Integer.toString(entry.size) + " " + (entry.strand?"+":"-") + " " + Integer.toString(entry.srcSize) + " " + Integer.toString(entry.srcSize) + "\n"; } return out; }</code><technical_language>want stringbuilder here, String is immutable this results in a lot of extra object creation</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(header()+'\n'); for (MafEntry entry: entries_){ sb.append( entry.src + " " + Integer.toString(entry.start0) + " " + Integer.toString(entry.size) + " " + (entry.strand?"+":"-") + " " + Integer.toString(entry.srcSize) + " " + Integer.toString(entry.srcSize) + "\n"); } return sb.toString(); }