auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> void start() { <END> if (running) { LOG.info("FeatureStateConsumer has already been started."); } else { synchronized (this) { if (running) { LOG.info("FeatureStateConsumer has already been started."); } else { try { LOG.info("Starting to start FeatureStateConsumer."); new Thread(this::run).start(); LOG.info("Successfully started FeatureStateConsumer."); running = true; initializationLatch.await(initializationTimeout.toMillis(), MILLISECONDS); LOG.info("Successfully initialized FeatureStateConsumer."); } catch (InterruptedException e) { throw new RuntimeException("An error occurred while awaiting initialization.", e); } } } } }</code><technical_language>suggest private</technical_language>

Target:
private synchronized void start() { if (running) { LOG.info("FeatureStateConsumer has already been started."); } else { try { LOG.debug("Starting to start FeatureStateConsumer."); asThreadWithExceptionHandler(this::run).start(); LOG.debug("Successfully started FeatureStateConsumer."); if (initializationLatch.await(initializationTimeout.toMillis(), MILLISECONDS)) { LOG.debug("Successfully initialized FeatureStateConsumer."); } else { throw new RuntimeException("Failed to initialize FeatureStateConsumer."); } } catch (InterruptedException e) { LOG.warn("Starting of FeatureStateConsumer was interrupted.", e); currentThread().interrupt(); } } }
Source:
<code>private String getAlternativeTitle(DocumentIndexingPackage dip) throws FedoraException, IndexingException { Resource resc = dip.getContentObject().getResource(); if (resc.hasProperty(DcElements.title)) { Statement dcTitle = resc.getProperty(DcElements.title); return dcTitle.getString(); <START> } else if (resc.hasProperty(Ebucore.filename)) { END> Statement filename = resc.getProperty(Ebucore.filename); return filename.getString(); } else { return dip.getPid().getId(); } }</code><technical_language>do empty checks returning values? StringUtils.isBlank catches null, blank, whitespace. If title is present empty, want fall other options</technical_language>

Target:
private String getAlternativeTitle(DocumentIndexingPackage dip) throws FedoraException, IndexingException { Resource resc = dip.getContentObject().getResource(); String dcTitle = titleText(resc, DcElements.title); String ebucoreTitle = titleText(resc, Ebucore.filename); if (!isBlank(dcTitle)) { return dcTitle; } else if (!isBlank(ebucoreTitle)) { return ebucoreTitle; } else { return dip.getPid().getId(); } }
Source:
<code>private void assertJsonFormat(final String metricPath) { <START> final String metric = WebClient.create(base.toExternalForm()) <END> .path(metricPath) .accept(MediaType.APPLICATION_JSON) .get(String.class); assertTrue(metric.contains("count")); assertTrue(metric.contains("meanRate")); assertTrue(metric.contains("fifteenMinRate")); assertTrue(metric.contains("fiveMinRate")); assertTrue(metric.contains("oneMinRate")); assertTrue(metric.contains("min")); assertTrue(metric.contains("max")); assertTrue(metric.contains("mean")); assertTrue(metric.contains("stddev")); assertTrue(metric.contains("p50")); assertTrue(metric.contains("p75")); assertTrue(metric.contains("p95")); assertTrue(metric.contains("p98")); assertTrue(metric.contains("p99")); assertTrue(metric.contains("p999")); }</code><technical_language>load JsonObject assert keys(), inline more reasable</technical_language>

Target:
private void assertJsonFormat(final String metricPath) { WebTarget webTarget = client.target(base.toExternalForm()); String metric = webTarget .path(metricPath) .request() .accept(MediaType.APPLICATION_JSON) .buildGet() .invoke() .readEntity(String.class); JsonObject expectedJson = Json.createReader(new StringReader(metric)).readObject(); String[] expected = { "count", "meanRate", "fifteenMinRate", "fiveMinRate", "oneMinRate", "min", "max", "mean", "stddev", "p50", "p75", "p95", "p98", "p99", "p999" }; Stream.of(expected) .forEach(text -> assertTrue( "Expected: " + text + " to be present in " + metric, expectedJson.getJsonObject("weather_day_status").get(text) != null)); }
Source:
<code>private void startSubscription() { Set<TopicPartition> registeredTopicPartitions = new HashSet<>(); registeredTopicPartitions.addAll(topicPartitionsToSSP.keySet()); <START> registeredTopicPartitions.addAll(topicPartitionToStartpointMap.keySet()); <END> LOG.info("{}: Consumer subscribes to {}", this, registeredTopicPartitions); try { synchronized (kafkaConsumer) { kafkaConsumer.assign(registeredTopicPartitions); } } catch (Exception e) { throw new SamzaException("Consumer subscription failed for " + this, e); } }</code><technical_language>is case this a TopicPartition, topicPartitionsToSSP it</technical_language>

Target:
private void startSubscription() { Set<TopicPartition> registeredTopicPartitions = new HashSet<>(topicPartitionToStartpointMap.keySet()); LOG.info("{}: Consumer subscribes to {}", this, registeredTopicPartitions); try { synchronized (kafkaConsumer) { kafkaConsumer.assign(registeredTopicPartitions); } } catch (Exception e) { throw new SamzaException("Consumer subscription failed for " + this, e); } }
Source:
<code>public CustomDatatype.Summary toHtmlSummary(CustomDatatype<T> datatype, String valueReference) { <START> return new CustomDatatype.Summary(valueReference, true); <END> }</code><technical_language>valueReference a uuid is want user see, instead this name property this is metadata, if is blank, call toString()</technical_language>

Target:
public CustomDatatype.Summary toHtmlSummary(CustomDatatype<T> datatype, String valueReference) { return toHtmlSummary(datatype, valueReference); }
Source:
<code>public ListBoxModel doFillProcessItems(@AncestorInPath Job defaultJob, @QueryParameter("jobName") String jobName) { if (!defaultJob.hasPermission(Item.CONFIGURE) && defaultJob.hasPermission(Item.EXTENDED_READ)) { return new ListBoxModel(); } defaultJob.checkPermission(Item.CONFIGURE); AbstractProject<?,?> j = null; if (jobName != null) { j = getProject(jobName); } ListBoxModel r = new ListBoxModel(); if (j!=null) { JobPropertyImpl pp = j.getProperty(JobPropertyImpl.class); if (pp!=null) { for (PromotionProcess proc : pp.getActiveItems()) { r.add(new Option(proc.getDisplayName(),proc.getName())); <START> } <END> } } return r; }</code><technical_language>a rule, PRs avoid changing formatting in unrelated code. reviewing diffs easier, merging cleaner, blame more effective</technical_language>

Target:
public ListBoxModel doFillProcessItems(@AncestorInPath Job defaultJob, @QueryParameter("jobName") String jobName) { if (!defaultJob.hasPermission(Item.CONFIGURE) && defaultJob.hasPermission(Item.EXTENDED_READ)) { return new ListBoxModel(); } defaultJob.checkPermission(Item.CONFIGURE); AbstractProject<?,?> j = null; if (jobName != null) { j = Jenkins.getInstance().getItemByFullName(jobName, AbstractProject.class); } ListBoxModel r = new ListBoxModel(); if (j!=null) { JobPropertyImpl pp = j.getProperty(JobPropertyImpl.class); if (pp!=null) { for (PromotionProcess proc : pp.getActiveItems()) { r.add(new Option(proc.getDisplayName(),proc.getName())); } } } return r; }
Source:
<code>public <T> T execute(Request<T> request, boolean authenticateIfNeeded, IProgressMonitor monitor) throws IOException, GerritException { String openIdProvider = getOpenIdProvider(); hostConfiguration = WebUtil.createHostConfiguration(httpClient, location, monitor); for (int attempt = 0; attempt < 2; attempt++) { if (authenticateIfNeeded) { if (needsAuthentication()) { AuthenticationCredentials credentials = location.getCredentials(AuthenticationType.REPOSITORY); if (openIdProvider != null || credentials != null) { authenticate(openIdProvider, monitor); } } if (!obtainedXsrfKey) { updateXsrfKey(monitor); } } HttpMethodBase method = request.createMethod(); if (obtainedXsrfKey) { method.setRequestHeader("X-Gerrit-Auth", xsrfKey); } try { WebUtil.execute(httpClient, hostConfiguration, method, monitor); } catch (IOException e) { WebUtil.releaseConnection(method, monitor); throw e; } catch (RuntimeException e) { WebUtil.releaseConnection(method, monitor); throw e; } int code = method.getStatusCode(); if (code == HttpURLConnection.HTTP_OK) { try { return request.process(method); } finally { WebUtil.releaseConnection(method, monitor); } } else { <START> request.handleError(method); <END> WebUtil.releaseConnection(method, monitor); if (code == HttpURLConnection.HTTP_UNAUTHORIZED || code == HttpURLConnection.HTTP_FORBIDDEN) { authenticate(openIdProvider, monitor); } else { throw new GerritHttpException(code); } } } throw new GerritLoginException(); }</code><technical_language>Put releaseConnection() a finally block</technical_language>

Target:
public <T> T execute(Request<T> request, boolean authenticateIfNeeded, IProgressMonitor monitor) throws IOException, GerritException { String openIdProvider = getOpenIdProvider(); hostConfiguration = WebUtil.createHostConfiguration(httpClient, location, monitor); for (int attempt = 0; attempt < 2; attempt++) { if (authenticateIfNeeded) { if (needsAuthentication()) { AuthenticationCredentials credentials = location.getCredentials(AuthenticationType.REPOSITORY); if (openIdProvider != null || credentials != null) { authenticate(openIdProvider, monitor); } } if (!obtainedXsrfKey) { updateXsrfKey(monitor); } } HttpMethodBase method = request.createMethod(); if (obtainedXsrfKey) { method.setRequestHeader("X-Gerrit-Auth", xsrfKey); } try { WebUtil.execute(httpClient, hostConfiguration, method, monitor); } catch (IOException e) { WebUtil.releaseConnection(method, monitor); throw e; } catch (RuntimeException e) { WebUtil.releaseConnection(method, monitor); throw e; } int code = method.getStatusCode(); if (code == HttpURLConnection.HTTP_OK) { try { return request.process(method); } finally { WebUtil.releaseConnection(method, monitor); } } else { try { request.handleError(method); } finally { WebUtil.releaseConnection(method, monitor); } if (code == HttpURLConnection.HTTP_UNAUTHORIZED || code == HttpURLConnection.HTTP_FORBIDDEN) { authenticate(openIdProvider, monitor); } else { throw new GerritHttpException(code); } } } throw new GerritLoginException(); }
Source:
<code>public ClusterEvent readObject(ObjectInput input) throws IOException, ClassNotFoundException { return new ClusterEvent(input.readObject(), input.readObject(), input.readObject(), <START> (Metadata)input.readObject(),(Type) MarshallUtil.unmarshallEnum(input, Type::valueOf), <END> (Address)input.readObject(), (GlobalTransaction)input.readObject(), input.readBoolean()); }</code><technical_language>unneeded cast :)</technical_language>

Target:
public ClusterEvent readObject(ObjectInput input) throws IOException, ClassNotFoundException { return new ClusterEvent(input.readObject(), input.readObject(), input.readObject(), (Metadata)input.readObject(),MarshallUtil.unmarshallEnum(input, Type::valueOf), (Address)input.readObject(), (GlobalTransaction)input.readObject(), input.readBoolean()); }
Source:
<code>protected boolean validatePage() { if (!getProjectName().isEmpty()) { IProject[] projects = IDEWorkbenchPlugin.getPluginWorkspace().getRoot().getProjects(); <START> for (IProject project : projects) { <END> if (getProjectHandle().getName().toUpperCase().equals(project.getName().toUpperCase())) { setErrorMessage(IDEWorkbenchMessages.WizardNewProjectCreationPage_projectExistsMessage); return false; } } } return super.validatePage(); }</code><technical_language>I path of project checked (a project name project folder contains it)</technical_language>

Target:
protected boolean validatePage() { boolean validProjectName = true; if (resourceExistsInWorkspace()) { validProjectName = false; } if (!StringUtil.isEmpty(getProjectName()) && validProjectName && isMacOrWindowsOS()) { if (resourceExistsOnDisk()) { validProjectName = false; } } if (validProjectName) { return super.validatePage(); } else { return false; } }
Source:
<code>public CompactAllPolicyTest() throws InterruptedException { Pair<MockBlobStore, StoreConfig> initState = CompactionPolicyTest.initializeBlobStore(properties, time, -1, -1, -1); <START> this.config = initState.getSecond(); <END> this.messageRetentionTimeInMs = config.storeDeletedMessageRetentionDays * Time.HoursPerDay * Time.SecsPerHour * Time.MsPerSec; this.blobStore = initState.getFirst(); this.compactionPolicy = new CompactAllPolicy(config, time); }</code><technical_language>minor: this qualifiers required</technical_language>

Target:
public CompactAllPolicyTest() throws InterruptedException { Pair<MockBlobStore, StoreConfig> initState = CompactionPolicyTest.initializeBlobStore(properties, time, -1, -1, -1); config = initState.getSecond(); messageRetentionTimeInMs = config.storeDeletedMessageRetentionDays * Time.HoursPerDay * Time.SecsPerHour * Time.MsPerSec; blobStore = initState.getFirst(); compactionPolicy = new CompactAllPolicy(config, time); }
Source:
<code>public void noTransactionsPerformanceReportEntitySerializesCorrectly() { given(mockPerformanceReportDao.aggregateNumberAndValueOfPaymentsByGatewayAccount()) <START> .willReturn(noTransactionsPerformanceReportEntity.stream()); <END> Response result = resource.getGatewayAccountPerformanceReport(); assertThat(result.getStatus(), is(OK.getStatusCode())); HashMap<String, ImmutableMap<String, Object>> unserializedResponse = (HashMap<String, ImmutableMap<String, Object>>) result.getEntity(); assertThat(unserializedResponse.size(), is(0)); }</code><technical_language>simply change mocks mock Streams mock Lists</technical_language>

Target:
public void noTransactionsPerformanceReportEntitySerializesCorrectly() { Stream<GatewayAccountPerformanceReportEntity> noTransactionsPerformanceReportEntity = Stream.empty(); given(mockPerformanceReportDao.aggregateNumberAndValueOfPaymentsByGatewayAccount()) .willReturn(noTransactionsPerformanceReportEntity); Response result = resource.getGatewayAccountPerformanceReport(); assertThat(result.getStatus(), is(OK.getStatusCode())); HashMap<String, ImmutableMap<String, Object>> unserializedResponse = (HashMap<String, ImmutableMap<String, Object>>) result.getEntity(); assertThat(unserializedResponse.size(), is(0)); }
Source:
<code>private long getNumberIssues() { long count = 0; <START> for (Map.Entry<VirtualFile, Collection<LocalIssuePointer>> entry : storePerFile.entrySet()) { <END> count += entry.getValue().size(); } return count; }</code><technical_language>storePerFile.values()</technical_language>

Target:
private long getNumberIssues() { long count = 0; for (Collection<LocalIssuePointer> issuePointers : storePerFile.values()) { count += issuePointers.size(); } return count; }
Source:
<code>public void close() throws IOException { LOG.info("Closing split (scanned rows)", scannedRows); currentRow = null; try { if (resultScanner != null) { resultScanner.close(); } if (table != null) { table.close(); } if (connection != null) { connection.close(); <START> } <END> } finally { resultScanner = null; table = null; connection = null; } }</code><technical_language>leak connection if table.close() resultScanner.close() fails exception. I proper wrap close in a separate try block, catch log error</technical_language>

Target:
public void close() throws IOException { LOG.info("Closing split (scanned rows)", scannedRows); currentRow = null; try { if (resultScanner != null) { resultScanner.close(); } closeTable(); } finally { resultScanner = null; } }
Source:
<code>private void propagateSubject(final SecurityContext target, final SecurityContext source) { final SecurityContextUtil previousUtil = source.getUtil(); final SecurityContextUtil currentUtil = target.getUtil(); if(target.getSecurityDomain() != null && source.getSecurityDomain() != null && target.getSecurityDomain().equals(source.getSecurityDomain())){ target.setSubjectInfo(source.getSubjectInfo()); } else { currentUtil.createSubjectInfo(previousUtil.getUserPrincipal(), previousUtil.getCredential(), previousUtil.getSubject()); } <START> if (previousUtil.getRoles() != null) { try { currentUtil.setRoles((RoleGroup) previousUtil.getRoles().clone()); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } } currentUtil.setIdentities(previousUtil.getIdentities(Identity.class)); <END> }</code><technical_language>is reason this block is needed? previous implementation manually cloning RoleGroup bug report in relation popping Principal. I considered role propagation in PicketBox domains a bit of undefined, sense cloning roles if domain</technical_language>

Target:
private void propagateSubject(final SecurityContext target, final SecurityContext source) { final SecurityContextUtil previousUtil = source.getUtil(); final SecurityContextUtil currentUtil = target.getUtil(); if(target.getSecurityDomain() != null && source.getSecurityDomain() != null && target.getSecurityDomain().equals(source.getSecurityDomain())){ target.setSubjectInfo(source.getSubjectInfo()); } else { currentUtil.createSubjectInfo(previousUtil.getUserPrincipal(), previousUtil.getCredential(), previousUtil.getSubject()); if (previousUtil.getRoles() != null) { try { currentUtil.setRoles((RoleGroup) previousUtil.getRoles().clone()); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } } currentUtil.setIdentities(previousUtil.getIdentities(Identity.class)); } }
Source:
<code>private OrcsScriptOutputHandler getOutputHandler(ScriptContext context) { OrcsScriptOutputHandler handler = null; String mediaType = (String) context.getAttribute("MediaType"); <START> if (mediaType != null && mediaType.compareTo("application/xml") == 0) { <END> handler = new ExcelOutputHandler(context); } else { handler = new JsonOutputHandler(context); } return handler; }</code><technical_language>me, mediaType.equals("application/xml") is more clear. also, is application/xml excel writer? if is excel file, a media type used. application/vnd.ms-excel. <LINK_0></technical_language>

Target:
private OrcsScriptOutputHandler getOutputHandler(ScriptContext context) { OrcsScriptOutputHandler handler = null; String mediaType = (String) context.getAttribute("MediaType"); if (mediaType != null && "application/vnd.ms-excel".equals(mediaType)) { handler = new ExcelOutputHandler(context); } else { handler = new JsonOutputHandler(context); } return handler; }
Source:
<code>static void addDeleteFromColumnMods( ByteString familyByteString, Cell cell, com.google.cloud.bigtable.data.v2.models.MutationApi<?> mutation ) { ByteString cellQualifierByteString = ByteString.copyFrom( cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength()); long endTimestamp = BigtableConstants.BIGTABLE_TIMEUNIT.convert( cell.getTimestamp() + 1, BigtableConstants.HBASE_TIMEUNIT); if (isPointDelete(cell)) { long startTimestamp = BigtableConstants.BIGTABLE_TIMEUNIT.convert( cell.getTimestamp(), BigtableConstants.HBASE_TIMEUNIT); <START> mutation.deleteCells(familyByteString.toStringUtf8(), cellQualifierByteString, Range.TimestampRange.create(startTimestamp, endTimestamp)); <END> } else { if (cell.getTimestamp() != HConstants.LATEST_TIMESTAMP) { mutation.deleteCells(familyByteString.toStringUtf8(), cellQualifierByteString, Range.TimestampRange.unbounded().endOpen(endTimestamp)); } else { mutation.deleteCells(familyByteString.toStringUtf8(), cellQualifierByteString); } } }</code><technical_language>s/Range.TimestampRange/TimestampRange/ (here else)</technical_language>

Target:
static void addDeleteFromColumnMods( ByteString familyByteString, Cell cell, com.google.cloud.bigtable.data.v2.models.MutationApi<?> mutation ) { ByteString cellQualifierByteString = ByteString.copyFrom( cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength()); long endTimestamp = BigtableConstants.BIGTABLE_TIMEUNIT.convert( cell.getTimestamp() + 1, BigtableConstants.HBASE_TIMEUNIT); if (isPointDelete(cell)) { long startTimestamp = BigtableConstants.BIGTABLE_TIMEUNIT.convert( cell.getTimestamp(), BigtableConstants.HBASE_TIMEUNIT); mutation.deleteCells(familyByteString.toStringUtf8(), cellQualifierByteString, TimestampRange.create(startTimestamp, endTimestamp)); } else { if (cell.getTimestamp() != HConstants.LATEST_TIMESTAMP) { mutation.deleteCells(familyByteString.toStringUtf8(), cellQualifierByteString, TimestampRange.unbounded().endOpen(endTimestamp)); } else { mutation.deleteCells(familyByteString.toStringUtf8(), cellQualifierByteString); } } }
Source:
<code>public void stopRunning( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { if ( this.isStopped() || sdi.isDisposed() ) { return; } <START> dbLock.writeLock().lock(); <END> try { meta = (TableInputMeta) smi; data = (TableInputData) sdi; setStopped( true ); if ( data.db != null && data.db.getConnection() != null && !data.isCanceled ) { data.db.cancelQuery(); data.isCanceled = true; } } finally { dbLock.writeLock().unlock(); } }</code><technical_language>creating a new pointer.... gives</technical_language>

Target:
public void stopRunning( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { if ( this.isStopped() || sdi.isDisposed() ) { return; } dbLock.lock(); try { meta = (TableInputMeta) smi; data = (TableInputData) sdi; setStopped( true ); if ( data.db != null && data.db.getConnection() != null && !data.isCanceled ) { data.db.cancelQuery(); data.isCanceled = true; } } finally { dbLock.unlock(); } }
Source:
<code>protected Stream<Sample> loadParents(List<Long> ids) throws IOException { Collection<Sample> results = sampleService.listByIdList(ids); templatesByProjectId = results.stream() .map(sam -> sam.getProject().getId()) .distinct() .map(projectId -> { try { return libraryTemplateService.listLibraryTemplatesForProject(projectId); } catch (IOException e) { <START> throw new RuntimeException(e); <END> } }) .filter(list -> !list.isEmpty()) .map(Dtos::asLibraryTemplateDtos) .collect(Collectors.toMap(list -> list.get(0).getProjectId(), list -> list)); SampleClass sampleClass = null; boolean hasPlain = false; for (Sample sample : results) { if (sample instanceof DetailedSample) { DetailedSample detailed = (DetailedSample) sample; if (sampleClass == null) { sampleClass = detailed.getSampleClass(); } else if (sampleClass.getId() != detailed.getSampleClass().getId()) { throw new IOException("Can only create libraries when samples all have the same class."); } } else { hasPlain = true; } } if (hasPlain && sampleClass != null) { throw new IOException("Cannot mix plain and detailed samples."); } return results.stream().sorted(new AliasComparator<>()); }</code><technical_language>WhineyFunction#rethrow instead (does thing): .map(WhineyFunction.rethrow(projectId -> libraryTemplateService.listLibraryTemplatesForProject(projectId)))</technical_language>

Target:
protected Stream<Sample> loadParents(List<Long> ids) throws IOException { Collection<Sample> results = sampleService.listByIdList(ids); templatesByProjectId = results.stream() .map(sam -> sam.getProject().getId()) .distinct() .map(WhineyFunction.rethrow(projectId -> { Map<Long, List<LibraryTemplateDto>> map = new HashMap<>(); map.put(projectId, Dtos.asLibraryTemplateDtos(libraryTemplateService.listLibraryTemplatesForProject(projectId))); return map; })) .filter(map -> !map.values().stream().allMatch(value -> value.isEmpty())) .flatMap(map -> map.entrySet().stream()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); SampleClass sampleClass = null; boolean hasPlain = false; for (Sample sample : results) { if (sample instanceof DetailedSample) { DetailedSample detailed = (DetailedSample) sample; if (sampleClass == null) { sampleClass = detailed.getSampleClass(); } else if (sampleClass.getId() != detailed.getSampleClass().getId()) { throw new IOException("Can only create libraries when samples all have the same class."); } } else { hasPlain = true; } } if (hasPlain && sampleClass != null) { throw new IOException("Cannot mix plain and detailed samples."); } return results.stream().sorted(new AliasComparator<>()); }
Source:
<code>protected void paint(Graphics graphics) { graphics.setColor(0x00FF0000); graphics.fillRect(0, 0, getWidth(), getHeight()); Image image = Image.createImage(150, 150); Graphics g = image.getGraphics(); g.setColor(0x00FFFFFF); g.fillRect(0, 0, 150, 150); g.setColor(0); g.setStrokeStyle(Graphics.SOLID); g.drawString("Roxors", 50, 50, Graphics.TOP | Graphics.LEFT); <START> graphics.drawImage(image, 50, 50, Graphics.TOP | Graphics.LEFT); <END> System.out.println("PAINTED"); }</code><technical_language>do a getRGB/setRGB for completeness</technical_language>

Target:
protected void paint(Graphics graphics) { graphics.setColor(0x00FF0000); graphics.fillRect(0, 0, getWidth(), getHeight()); Image image = Image.createImage(150, 150); Graphics g = image.getGraphics(); g.setColor(0x00FFFFFF); g.fillRect(0, 0, 150, 150); g.setColor(0); g.setStrokeStyle(Graphics.SOLID); g.drawString("Roxors", 50, 50, Graphics.TOP | Graphics.LEFT); int[] rgbData = new int[150 * 150]; image.getRGB(rgbData, 0, 150, 0, 0, 150, 150); g.drawRGB(rgbData, 0, 150, 0, 0, 150, 150, true); graphics.drawImage(image, 50, 50, Graphics.TOP | Graphics.LEFT); System.out.println("PAINTED"); }
Source:
<code>public void lookupAllByTypeCaching() throws Throwable { BaseService service = new AugmentedMethodService(); Method method = BaseService.class.getMethod("augmented"); injectParamsFromContextServiceMethodInvoker.invoke(service, method, null); injectParamsFromContextServiceMethodInvoker.invoke(service, method, null); <START> verify(registry).lookupAllByType(any()); <END> }</code><technical_language>add times(1) atMost(1) matchers</technical_language>

Target:
public void lookupAllByTypeCaching() throws Throwable { BaseService service = new AugmentedMethodService(); Method method = BaseService.class.getMethod("augmented"); injectParamsFromContextServiceMethodInvoker.invoke(service, method, null); injectParamsFromContextServiceMethodInvoker.invoke(service, method, null); verify(registry, times(1)).lookupAllByType(any()); }
Source:
<code>private int sortByScheduledDate(ITask task1, ITask task2, int sortDirection) { if (task1 instanceof AbstractTask && task2 instanceof AbstractTask) { DateRange date1 = ((AbstractTask) task1).getScheduledForDate(); DateRange date2 = ((AbstractTask) task2).getScheduledForDate(); <START> return compare(date1.getEndDate(), date2.getEndDate(), sortDirection); <END> } return 0; }</code><technical_language>this sort tasks scheduled for specific days next week tasks scheduled for "next week" scheduled for day of week, end date</technical_language>

Target:
private int sortByScheduledDate(ITask task1, ITask task2, int sortDirection) { if (task1 instanceof AbstractTask && task2 instanceof AbstractTask) { DateRange date1 = ((AbstractTask) task1).getScheduledForDate(); DateRange date2 = ((AbstractTask) task2).getScheduledForDate(); return compare(date1, date2, sortDirection); } return 0; }
Source:
<code>void timeout() { if (status.compareAndSet(Status.WAITING, Status.TIMED_OUT)) { <START> handler.handle(Future.failedFuture(new VertxException("Timed out waiting to get lock"))); <END> } }</code><technical_language>instead string version in order avoid creating a costly stack trace creation exception</technical_language>

Target:
void timeout() { if (status.compareAndSet(Status.WAITING, Status.TIMED_OUT)) { handler.handle(Future.failedFuture("Timed out waiting to get lock")); } }
Source:
<code>public static File fakeReplaceFile(String name, String newContent, InputStream in) throws IOException { Assert.notNull(name); Assert.notNull(in); File newArchive = FileUtils.createRandomTempFile(".tar.gz"); newArchive.deleteOnExit(); TarArchiveOutputStream newArchiveOut = new TarArchiveOutputStream(new GZIPOutputStream(new FileOutputStream(newArchive))); newArchiveOut.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); TarArchiveInputStream archiveIn = new TarArchiveInputStream(new GZIPInputStream(in)); String pathToReplace = null; try { <START> for (ArchiveEntry nextEntry; (nextEntry = archiveIn.getNextEntry()) != null;) { <END> if (nextEntry.getName().endsWith(name)) { pathToReplace = nextEntry.getName(); } newArchiveOut.putArchiveEntry(nextEntry); IOUtils.copy(archiveIn, newArchiveOut); newArchiveOut.closeArchiveEntry(); } if (pathToReplace == null) { throw new IllegalStateException("Could not find file " + name + " in the given archive."); } TarArchiveEntry newEntry = new TarArchiveEntry(pathToReplace); newEntry.setSize(newContent.length()); newArchiveOut.putArchiveEntry(newEntry); IOUtils.copy(new ByteArrayInputStream(newContent.getBytes()), newArchiveOut); newArchiveOut.closeArchiveEntry(); return newArchive; } finally { newArchiveOut.finish(); newArchiveOut.flush(); StreamUtils.close(archiveIn); StreamUtils.close(newArchiveOut); } }</code><technical_language>please dont remove explicit initialization</technical_language>

Target:
public static File fakeReplaceFile(String name, String newContent, InputStream in) throws IOException { Assert.notNull(name); Assert.notNull(in); File newArchive = FileUtils.createRandomTempFile(".tar.gz"); newArchive.deleteOnExit(); TarArchiveOutputStream newArchiveOut = new TarArchiveOutputStream(new GZIPOutputStream(new FileOutputStream(newArchive))); newArchiveOut.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); TarArchiveInputStream archiveIn = new TarArchiveInputStream(new GZIPInputStream(in)); String pathToReplace = null; try { for (ArchiveEntry nextEntry = null; (nextEntry = archiveIn.getNextEntry()) != null;) { if (nextEntry.getName().endsWith(name)) { pathToReplace = nextEntry.getName(); } newArchiveOut.putArchiveEntry(nextEntry); IOUtils.copy(archiveIn, newArchiveOut); newArchiveOut.closeArchiveEntry(); } if (pathToReplace == null) { throw new IllegalStateException("Could not find file " + name + " in the given archive."); } TarArchiveEntry newEntry = new TarArchiveEntry(pathToReplace); newEntry.setSize(newContent.length()); newArchiveOut.putArchiveEntry(newEntry); IOUtils.copy(new ByteArrayInputStream(newContent.getBytes()), newArchiveOut); newArchiveOut.closeArchiveEntry(); return newArchive; } finally { newArchiveOut.finish(); newArchiveOut.flush(); StreamUtils.close(archiveIn); StreamUtils.close(newArchiveOut); } }
Source:
<code>static <Z> Z transformUnsafe(ElasticsearchSearchProjection<?, Z> projection, LoadingResult<?> loadingResult, Object extractedData, SearchProjectionTransformContext context) { <START> return (Z) projection.transform( loadingResult, extractedData, context ); <END> }</code><technical_language>This cast is necessary bypass generics limitations of compiler. remove it</technical_language>

Target:
static <Z> Z transformUnsafe(ElasticsearchSearchProjection<?, Z> projection, LoadingResult<?> loadingResult, Object extractedData, SearchProjectionTransformContext context) { return (Z) ( (ElasticsearchSearchProjection) projection ).transform( loadingResult, extractedData, context ); }
Source:
<code><START> public static Scheduler initComputationScheduler(Callable<Scheduler> defaultScheduler) { <END> Function<Scheduler, Scheduler> f = onInitComputationHandler; if (f == null) { return callOrNull(defaultScheduler); } return apply(f, defaultScheduler); }</code><technical_language>throw a null callable? point of calling null</technical_language>

Target:
public static Scheduler initComputationScheduler(Callable<Scheduler> defaultScheduler) { ObjectHelper.requireNonNull(defaultScheduler, "Scheduler Callable can't be null"); Function<Callable<Scheduler>, Scheduler> f = onInitComputationHandler; if (f == null) { return callRequireNonNull(defaultScheduler); } return applyRequireNonNull(f, defaultScheduler); }
Source:
<code>public ScheduleToken schedule(Instant triggerDateTime, Object event) { <START> shutdownLatch.ifShuttingDown("Cannot dispatch new events as this scheduler is being shutdown"); <END> Channel channel = axonServerConnectionManager.getChannel(axonServerConfiguration.getContext()); EventSchedulerGrpc.EventSchedulerFutureStub scheduleStub = EventSchedulerGrpc.newFutureStub(channel); io.axoniq.axonserver.grpc.event.ScheduleToken response = null; try { response = scheduleStub.scheduleEvent(ScheduleEventRequest .newBuilder() .setInstant(triggerDateTime.toEpochMilli()) .setEvent(toEvent(event)) .build()) .get(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw GrpcExceptionParser.parse(e); } catch (ExecutionException e) { throw GrpcExceptionParser.parse(e.getCause()); } return new SimpleScheduleToken(response.getToken()); }</code><technical_language>potentially missed ShutdownLatch#registerActivity method. method latch waited a shutdown</technical_language>

Target:
public ScheduleToken schedule(Instant triggerDateTime, Object event) { Assert.isTrue(started.get(), () -> "Cannot dispatch new events as this scheduler is being shutdown"); io.axoniq.axonserver.grpc.event.ScheduleToken response = null; try { response = eventSchedulerStub().scheduleEvent(ScheduleEventRequest .newBuilder() .setInstant(triggerDateTime.toEpochMilli()) .setEvent(toEvent(event)) .build()) .get(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw GrpcExceptionParser.parse(e); } catch (ExecutionException e) { throw GrpcExceptionParser.parse(e.getCause()); } return new SimpleScheduleToken(response.getToken()); }
Source:
<code>public void notExisitQueue() throws IOException, InterruptedException { final Queue queue = this.client.getQueues().get("foo"); queue.put(SerialWorkerTest.DEFAULT_JOB_NAME, null, null); final SerialWorker worker = new SerialWorker( <START> Arrays.asList(new String[] {"foo"}), <END> this.client, null, 10); IntegrationTestJob.runningHistory.clear(); final Thread signal = new Thread() { @Override public void run() { try { Thread.sleep(2000); worker.shutDown(); } catch (final InterruptedException v) { System.out.println(v); } } }; signal.start(); worker.run(); assertThat(IntegrationTestJob.runningHistory.get(0), equalTo(SerialWorkerTest.DEFAULT_JOB_NAME + ".process")); }</code><technical_language>thing: Arrays.<String>asList(...)</technical_language>

Target:
public void notExisitQueue() throws IOException, InterruptedException { final Queue queue = this.client.getQueue("foo"); queue.put(SerialWorkerTest.DEFAULT_JOB_NAME, null, null); final SerialWorker worker = new SerialWorker( Arrays.asList("foo"), this.client, null, 10); IntegrationTestJob.runningHistory.clear(); final Thread signal = this.getWorkerThread(worker, 2); signal.start(); worker.run(); assertThat(IntegrationTestJob.runningHistory.get(0), equalTo(SerialWorkerTest.DEFAULT_JOB_NAME + ".process")); }
Source:
<code>private void loadApns(SQLiteDatabase db, XmlPullParser parser) { if (parser != null) { try { db.beginTransaction(); while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { XmlUtils.nextElement(parser); ContentValues row = getRow(parser); if (row == null) { <START> continue; <END> } insertAddingDefaults(db, CARRIERS_TABLE, row); } db.setTransactionSuccessful(); } catch (XmlPullParserException e) { Log.e(TAG, "Got XmlPullParserException while loading apns.", e); } catch (IOException e) { Log.e(TAG, "Got IOException while loading apns.", e); } catch (SQLException e) { Log.e(TAG, "Got SQLException while loading apns.", e); } finally { db.endTransaction(); } } }</code><technical_language>glad reached agreement this. request, row equal null if next elements is "apn" element means apn-file is malformed throw error here. Please replace "continue" with: throw new XmlPullParserException("Expected 'apn' tag", parser, null);</technical_language>

Target:
private void loadApns(SQLiteDatabase db, XmlPullParser parser) { if (parser != null) { try { db.beginTransaction(); while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { XmlUtils.nextElement(parser); ContentValues row = getRow(parser); if (row == null) { if (parser.getName() == null) { continue; } else { throw new XmlPullParserException("Expected 'apn' tag", parser, null); } } insertAddingDefaults(db, CARRIERS_TABLE, row); } db.setTransactionSuccessful(); } catch (XmlPullParserException e) { Log.e(TAG, "Got XmlPullParserException while loading apns.", e); } catch (IOException e) { Log.e(TAG, "Got IOException while loading apns.", e); } catch (SQLException e) { Log.e(TAG, "Got SQLException while loading apns.", e); } finally { db.endTransaction(); } } }
Source:
<code>protected Iterable<? extends RunningInstance> pollRunningInstances() { Iterable<? extends Set<? extends Reservation<? extends RunningInstance>>> reservations = transform(regions.get(), allInstancesInRegionFunction()); <START> return concat(concat(reservations)); <END> }</code><technical_language>concatDeep, I guess..? ;-)</technical_language>

Target:
protected Iterable<? extends RunningInstance> pollRunningInstances() { Iterable<? extends Set<? extends Reservation<? extends RunningInstance>>> reservations = transform(regions.get(), allInstancesInRegion()); return concat(concat(reservations)); }
Source:
<code>protected void writeAttributeRaw(String attributeName, String attributeValue) throws XMLStreamException { StringBuilder output = new StringBuilder(" "); output.append(attributeName); output.append("=\""); String escapedValue = <START> attributeValue.replace("&", <END> "&amp;"); escapedValue = escapedValue.replace("<", "&lt;"); escapedValue = escapedValue.replace(">", "&gt;"); escapedValue = escapedValue.replace("\"", "&quot;"); escapedValue = escapedValue.replace("\n", "&#10;"); output.append(escapedValue); output.append("\" "); try { outputStream.write(output.toString().getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { throw new XMLStreamException("Could not write raw attribute", e); } }</code><technical_language>This needs allocate times (for replace) full search times. Is do this in Java</technical_language>

Target:
protected void writeAttributeRaw(String attributeName, String attributeValue) throws XMLStreamException { try { outputStream.write(" ".getBytes(StandardCharsets.UTF_8)); outputStream.write(attributeName.getBytes(StandardCharsets.UTF_8)); outputStream.write("=\"".getBytes(StandardCharsets.UTF_8)); String escapedValue = attributeValue.replace("&", "&amp;"); escapedValue = escapedValue.replace("<", "&lt;"); escapedValue = escapedValue.replace(">", "&gt;"); escapedValue = escapedValue.replace("\"", "&quot;"); escapedValue = escapedValue.replace("\n", "&#10;"); outputStream.write(escapedValue.getBytes(StandardCharsets.UTF_8)); outputStream.write("\" ".getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { throw new XMLStreamException("Could not write raw attribute", e); } }
Source:
<code>private void showIntroductoryOverlay() { if (mIntroductoryOverlay != null) { mIntroductoryOverlay.remove(); } if ((mediaRouteMenuItem != null) && mediaRouteMenuItem.isVisible()) { new Handler().post(() -> { mIntroductoryOverlay = new IntroductoryOverlay .Builder(this, mediaRouteMenuItem) <START> .setTitleText(R.string.introducing_cast) <END> .setSingleTime() .setOnOverlayDismissedListener( () -> mIntroductoryOverlay = null) .build(); mIntroductoryOverlay.show(); }); } }</code><technical_language>Awesome</technical_language>

Target:
private void showIntroductoryOverlay() { if (mIntroductoryOverlay != null) { mIntroductoryOverlay.remove(); } if ((mediaRouteMenuItem != null) && mediaRouteMenuItem.isVisible()) { new Handler().post(() -> { mIntroductoryOverlay = new IntroductoryOverlay .Builder(this, mediaRouteMenuItem) .setTitleText("Introducing Cast") .setSingleTime() .setOnOverlayDismissedListener( () -> mIntroductoryOverlay = null) .build(); mIntroductoryOverlay.show(); }); } }
Source:
<code>public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) throws ExecutionException { List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, LTTngControlServiceConstants.OPTION_UST); if (isVersionSupported("2.1.0")) { command.add(LTTngControlServiceConstants.OPTION_FIELDS); } ICommandResult result = executeCommand(command, monitor, false); List<IUstProviderInfo> allProviders = new ArrayList<>(); if (!isVersionSupported("2.1.0") && (result.getResult() != 0)) { return allProviders; } if <START> (result.getErrorOutput().length > <END> 0) { if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN)) { return allProviders; } } if (isError(result)) { throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + result.toString()); } IUstProviderInfo provider = null; int index = 0; while (index < result.getOutput().length) { String line = result.getOutput()[index]; Matcher matcher = LTTngControlServiceConstants.UST_PROVIDER_PATTERN.matcher(line); if (matcher.matches()) { provider = new UstProviderInfo(matcher.group(2).trim()); provider.setPid(Integer.valueOf(matcher.group(1).trim())); List<IBaseEventInfo> events = new ArrayList<>(); index = getProviderEventInfo(result.getOutput(), ++index, events); provider.setEvents(events); allProviders.add(provider); } else { index++; } } return allProviders; }</code><technical_language>is this check necessary</technical_language>

Target:
public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) throws ExecutionException { List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, LTTngControlServiceConstants.OPTION_UST); if (isVersionSupported("2.1.0")) { command.add(LTTngControlServiceConstants.OPTION_FIELDS); } ICommandResult result = executeCommand(command, monitor, false); List<IUstProviderInfo> allProviders = new ArrayList<>(); if (!isVersionSupported("2.1.0") && (result.getResult() != 0)) { return allProviders; } if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN)) { return allProviders; } if (isError(result)) { throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + result.toString()); } IUstProviderInfo provider = null; int index = 0; while (index < result.getOutput().length) { String line = result.getOutput()[index]; Matcher matcher = LTTngControlServiceConstants.UST_PROVIDER_PATTERN.matcher(line); if (matcher.matches()) { provider = new UstProviderInfo(matcher.group(2).trim()); provider.setPid(Integer.valueOf(matcher.group(1).trim())); List<IBaseEventInfo> events = new ArrayList<>(); index = getProviderEventInfo(result.getOutput(), ++index, events); provider.setEvents(events); allProviders.add(provider); } else { index++; } } return allProviders; }
Source:
<code>public com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.UpdateFirmwareResponse getUpdateFirmwareResponse( @OrganisationIdentification final String organisationIdentification, @RequestPayload final UpdateFirmwareAsyncRequest request) throws OsgpException { LOGGER.info("GetUpdateFirmwareResponse Request received from organisation for device: {}.", organisationIdentification, request.getDeviceIdentification()); final com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.UpdateFirmwareResponse response = new com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.ObjectFactory() .createUpdateFirmwareResponse(); try { final MeterResponseData meterResponseData = this.configurationService.dequeueUpdateFirmwareResponse(request .getCorrelationUid()); <START> this.throwExceptionIfResultNotOk(meterResponseData, "updating firmware."); <END> if (meterResponseData != null) { response.setResult(OsgpResultType.fromValue(meterResponseData.getResultType().getValue())); if (meterResponseData.getMessageData() != null) { final List<FirmwareVersion> target = response.getFirmwareVersion(); final UpdateFirmwareResponse updateFirmwareResponse = (UpdateFirmwareResponse) meterResponseData .getMessageData(); target.addAll(this.configurationMapper.mapAsList(updateFirmwareResponse.getFirmwareVersions(), FirmwareVersion.class)); } else { LOGGER.info("Update Firmware response is null"); } } } catch (final Exception e) { this.handleException(e); } return response; }</code><technical_language>text for exceptionContext need include point</technical_language>

Target:
public com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.UpdateFirmwareResponse getUpdateFirmwareResponse( @OrganisationIdentification final String organisationIdentification, @RequestPayload final UpdateFirmwareAsyncRequest request) throws OsgpException { LOGGER.info("GetUpdateFirmwareResponse Request received from organisation for device: {}.", organisationIdentification, request.getDeviceIdentification()); final com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.UpdateFirmwareResponse response = new com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.UpdateFirmwareResponse(); try { final MeterResponseData meterResponseData = this.configurationService.dequeueUpdateFirmwareResponse(request .getCorrelationUid()); this.throwExceptionIfResultNotOk(meterResponseData, "updating firmware"); if (meterResponseData != null) { response.setResult(OsgpResultType.fromValue(meterResponseData.getResultType().getValue())); if (meterResponseData.getMessageData() != null) { final List<FirmwareVersion> target = response.getFirmwareVersion(); final UpdateFirmwareResponse updateFirmwareResponse = (UpdateFirmwareResponse) meterResponseData .getMessageData(); target.addAll(this.configurationMapper.mapAsList(updateFirmwareResponse.getFirmwareVersions(), FirmwareVersion.class)); } else { LOGGER.info("Update Firmware response is null"); } } } catch (final Exception e) { this.handleException(e); } return response; }
Source:
<code>public RateLimiter provideRateLimiter() { LocalRateLimiter localRateLimiter=getLocalRateLimiter(); RedisRateLimiter redisRateLimiter=getRedisRateLimiter(); return new RateLimiter(configuration.getRateLimiterConfig().getRate(), configuration.getRateLimiterConfig().getRateForPost(), configuration.getRateLimiterConfig().getAuditRate(), configuration.getRateLimiterConfig().getPerMillis(), configuration.getRateLimiterConfig().getNoOfNodes(), localRateLimiter, <START> getRedisRateLimiter()); <END> }</code><technical_language>this redisRateLimiter variable in line 71</technical_language>

Target:
public RateLimiter provideRateLimiter() { LocalRateLimiter localRateLimiter = getLocalRateLimiter(); RedisRateLimiter redisRateLimiter = getRedisRateLimiter(); return new RateLimiter(localRateLimiter, redisRateLimiter); }
Source:
<code>public void isInProgress_shouldReturnTrueIfPerformedStatusIsInProgress() throws Exception { <START> RadiologyStudy radiologystudy = new RadiologyStudy(); <END> radiologystudy.setPerformedStatus(PerformedProcedureStepStatus.IN_PROGRESS); assertTrue(radiologystudy.isInProgress()); }</code><technical_language>need rename variable. radiologyStudy</technical_language>

Target:
public void isInProgress_shouldReturnTrueIfPerformedStatusIsInProgress() throws Exception { RadiologyStudy radiologyStudy = new RadiologyStudy(); radiologyStudy.setPerformedStatus(PerformedProcedureStepStatus.IN_PROGRESS); assertTrue(radiologyStudy.isInProgress()); }
Source:
<code>private static void parseToken(DirectiveNode node) { String code = node.getCode(); <START> StreamTokenizer tokenizer = new StreamTokenizer(new StringReader(code)); <END> tokenizer.quoteChar('"'); try { while (tokenizer.nextToken() != StreamTokenizer.TT_EOF) { if (tokenizer.sval != null) { if (node.getNodeName() == null) { node.setNodeName(tokenizer.sval); } else { node.getAttributes().add(new Attribute(tokenizer.sval)); } } } } catch (IOException e) { } }</code><technical_language>StreamTokenizer closed</technical_language>

Target:
private static void parseToken(DirectiveNode node) { String code = node.getCode(); try(Reader reader = new StringReader(code)) { StreamTokenizer tokenizer = new StreamTokenizer(reader); tokenizer.quoteChar('"'); while (tokenizer.nextToken() != StreamTokenizer.TT_EOF) { if (tokenizer.sval != null) { if (node.getNodeName() == null) { node.setNodeName(tokenizer.sval); } else { node.getAttributes().add(new Attribute(tokenizer.sval)); } } } } catch (IOException e) { } }
Source:
<code>private void reportIssues() { Iterator<NPEContext> i = detectedIssues.iterator(); while (i.hasNext()) { NPEContext context = i.next(); reportIssue(context.symbolicValue, context.tree, context.node); <START> i.remove(); <END> } }</code><technical_language>clear collection loop ? : I need clear detectedIssues collection(but I is test in this commit showing if I right wrong)</technical_language>

Target:
private void reportIssues() { Set<NullDereferenceIssue> issues = detectedIssues.pop(); issues.forEach(issue -> reportIssue(issue.symbolicValue, issue.tree, issue.node)); }