auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public DynamicSchemaResolver(List<String> additionalFields) { this.tinyBinaryFunction = this::newTinyBinary; this.schemaFields = new SchemaFields(); metadataMaximumBytes = getMetadataSizeLimit(); anyTextFields = getAnyTextFields(); fieldsCache.add(Metacard.ID + SchemaFields.TEXT_SUFFIX); fieldsCache.add(Metacard.ID + SchemaFields.TEXT_SUFFIX + SchemaFields.TOKENIZED); fieldsCache.add( Metacard.ID + SchemaFields.TEXT_SUFFIX + SchemaFields.TOKENIZED + SchemaFields.HAS_CASE); fieldsCache.add(Metacard.TAGS + SchemaFields.TEXT_SUFFIX); <START> Set<String> basicTextAttributes = <END> MetacardImpl.BASIC_METACARD .getAttributeDescriptors() .stream() .filter(descriptor -> BasicTypes.STRING_TYPE.equals(descriptor.getType())) .map(stringDescriptor -> stringDescriptor.getName() + SchemaFields.TEXT_SUFFIX) .collect(Collectors.toSet()); fieldsCache.add(Validation.VALIDATION_ERRORS + SchemaFields.TEXT_SUFFIX); fieldsCache.add(Validation.VALIDATION_WARNINGS + SchemaFields.TEXT_SUFFIX); fieldsCache.add(SchemaFields.METACARD_TYPE_FIELD_NAME); fieldsCache.add(SchemaFields.METACARD_TYPE_OBJECT_FIELD_NAME); for (String field : additionalFields) { if (StringUtils.isNotBlank(field)) { fieldsCache.add(field); } } }</code><technical_language>this field is longer used</technical_language>

Target:
public DynamicSchemaResolver(List<String> additionalFields) { this.tinyBinaryFunction = this::newTinyBinary; this.schemaFields = new SchemaFields(); metadataMaximumBytes = getMetadataSizeLimit(); anyTextFields = getAnyTextFields(); fieldsCache.add(Metacard.ID + SchemaFields.TEXT_SUFFIX); fieldsCache.add(Metacard.ID + SchemaFields.TEXT_SUFFIX + SchemaFields.TOKENIZED); fieldsCache.add( Metacard.ID + SchemaFields.TEXT_SUFFIX + SchemaFields.TOKENIZED + SchemaFields.HAS_CASE); fieldsCache.add(Metacard.TAGS + SchemaFields.TEXT_SUFFIX); fieldsCache.add(Validation.VALIDATION_ERRORS + SchemaFields.TEXT_SUFFIX); fieldsCache.add(Validation.VALIDATION_WARNINGS + SchemaFields.TEXT_SUFFIX); fieldsCache.add(SchemaFields.METACARD_TYPE_FIELD_NAME); fieldsCache.add(SchemaFields.METACARD_TYPE_OBJECT_FIELD_NAME); for (String field : additionalFields) { if (StringUtils.isNotBlank(field)) { fieldsCache.add(field); } } }
Source:
<code>public void setMessageSender(WebServiceMessageSender messageSender) { <START> Assert.state(!this.webServiceTemplateExplicitlySet, <END> () -> "'messageSender' must be specified on the provided: " + this.webServiceTemplate); this.webServiceTemplate.setMessageSender(messageSender); }</code><technical_language>mind change logic in favor of calling a replacing API instead? is easier support changes in target logic afterward</technical_language>

Target:
public void setMessageSender(WebServiceMessageSender messageSender) { setMessageSenders(messageSender); }
Source:
<code>protected void doOperation() { Logic logic = new Logic(); try (Scanner scanner = new Scanner(System.in)) { System.out.println("Enter course to edit: "); String courseId = scanner.nextLine(); System.out.println("Enter new institute name: "); <START> String institute = scanner.nextLine(); <END> try { List<StudentAttributes> students = logic.getStudentsForCourse(courseId); for (StudentAttributes student : students) { if (student.googleId == null || student.googleId.isEmpty()) { continue; } AccountAttributes account = logic.getAccount(student.googleId); System.out.println("changed for " + account.email + " from " + account.institute + " to " + institute); account.institute = institute; logic.updateAccount(account); } } catch (Exception e) { e.printStackTrace(); } } }</code><technical_language>end try-with-resources block here. this line, scanner is useful anymore</technical_language>

Target:
protected void doOperation() { Logic logic = new Logic(); String courseId; String institute; try (Scanner scanner = new Scanner(System.in)) { System.out.println("Enter course to edit: "); courseId = scanner.nextLine(); System.out.println("Enter new institute name: "); institute = scanner.nextLine(); } try { List<StudentAttributes> students = logic.getStudentsForCourse(courseId); for (StudentAttributes student : students) { if (student.googleId == null || student.googleId.isEmpty()) { continue; } AccountAttributes account = logic.getAccount(student.googleId); System.out.println("changed for " + account.email + " from " + account.institute + " to " + institute); account.institute = institute; logic.updateAccount(account); } } catch (Exception e) { e.printStackTrace(); } }
Source:
<code>public Path getQuarantineFile(UUID shardUuid) { <START> return getFileSystemPath(baseQuarantineDir, shardUuid); <END> }</code><technical_language>throw errors for this</technical_language>

Target:
public Path getQuarantineFile(UUID shardUuid) { throw new PrestoException(RAPTOR_ERROR, "Possible data corruption is detected in metadata or remote storage"); }
Source:
<code>public HillCrestImuNode() { super(); Discovery discover = Discovery.getInstance(); discover.addListener(this); <START> registeredDevices = new ArrayList<>(); <END> }</code><technical_language>I this add this class a listener, end a race condition try add list initialized</technical_language>

Target:
public HillCrestImuNode() { super(); registeredDevices = new ArrayList<>(); Discovery discover = Discovery.getInstance(); discover.addListener(this); }
Source:
<code>public void reloadIfOutdated(final Injector injector, final String upToDateETag) { final boolean upToDate = _cached.getETag().equals(upToDateETag); _periodicMetrics.recordCounter("cached_job_conditional_reload", upToDate ? 1 : 0); if (upToDate) { return; } LOGGER.debug() .setMessage("job is stale; reloading") .addData("jobRef", _ref) .addData("oldETag", _cached.getETag()) .addData("newETag", upToDateETag) .log(); <START> reload(injector); <END> }</code><technical_language>issue is metrics. A call reloadIfOutdated generates cached_job_conditional_reload cached_job_reload causality of failures (if log 0s 1s) in cached_job_reload is unknown of this. Essentially, flows: 1) Reload success/failure 2) Cached reload is necessary/unnecessary 3) Cached reload success/failure (via reload) a common uninstrumented helper method disambiguate some improved metric names</technical_language>

Target:
public void reloadIfOutdated(final Injector injector, final String upToDateETag) throws NoSuchJobException { final boolean upToDate = _cached.getETag().equals(upToDateETag); _periodicMetrics.recordCounter("cached_job_conditional_reload_necessary", upToDate ? 1 : 0); if (upToDate) { return; } LOGGER.debug() .setMessage("job is stale; reloading") .addData("jobRef", _ref) .addData("oldETag", _cached.getETag()) .addData("newETag", upToDateETag) .log(); reload(injector); }
Source:
<code>private void doSyncAndPut(PersistentCacheManager cacheManager) throws InterruptedException { CustomValue customValue = new CustomValue("value"); Cache<String, Boolean> synCache = cacheManager.getCache(SYN_CACHE_NAME, String.class, Boolean.class); Cache<Long, CustomValue> customValueCache = cacheManager.getCache(CLUSTERED_CACHE_NAME, Long.class, CustomValue.class); String firstClientStartKey = "first_client_start", firstClientEndKey = "first_client_end"; <START> if (synCache.putIfAbsent(firstClientStartKey, true) == null) { <END> silentPuts(customValueCache); customValueCache.put(1L, customValue); assertThat(customValueCache.get(1L), is(customValue)); synCache.put(firstClientEndKey, true); } else { silentPuts(customValueCache); int retry = 0, maxRetryCount = 30; while (++retry <= maxRetryCount && synCache.get(firstClientEndKey) == null) { Thread.sleep(1000L); } if (retry > maxRetryCount) { Assert.fail("Couldn't find " + firstClientEndKey + " in synCache after " + maxRetryCount + " retries!"); } assertThat(customValueCache.get(1L), is(customValue)); } }</code><technical_language>If heavyweight yes. Easier is put a hook in code</technical_language>

Target:
private void doSyncAndPut(PersistentCacheManager cacheManager) throws InterruptedException { String customValue = "value"; Cache<String, Boolean> synCache = cacheManager.getCache(SYN_CACHE_NAME, String.class, Boolean.class); Cache<Long, String> customValueCache = cacheManager.getCache(CLUSTERED_CACHE_NAME, Long.class, String.class); String firstClientStartKey = "first_client_start", firstClientEndKey = "first_client_end"; if (synCache.putIfAbsent(firstClientStartKey, true) == null) { silentPuts(customValueCache); customValueCache.put(1L, customValue); assertThat(customValueCache.get(1L), is(customValue)); synCache.put(firstClientEndKey, true); } else { silentPuts(customValueCache); int retry = 0, maxRetryCount = 30; while (++retry <= maxRetryCount && synCache.get(firstClientEndKey) == null) { Thread.sleep(1000L); } if (retry > maxRetryCount) { Assert.fail("Couldn't find " + firstClientEndKey + " in synCache after " + maxRetryCount + " retries!"); } assertThat(customValueCache.get(1L), is(customValue)); } }
Source:
<code>void shouldReturnIssuesDetailWhenCallWithOutstandingLink() { DetailFactory detailFactory = new DetailFactory(); Run<?, ?> owner = mock(Run.class); AnalysisResult result = mock(AnalysisResult.class); Issues<?> allIssues = mock(Issues.class); Issues<?> newIssues = mock(Issues.class); Issues<?> outstandingIssues = mock(Issues.class); Issues<?> fixedIssues = mock(Issues.class); Charset sourceEncoding = Charset.defaultCharset(); IssuesDetail parent = mock(IssuesDetail.class); Object issuesDetail = detailFactory.createTrendDetails("outstanding", owner, result, allIssues, newIssues, outstandingIssues, fixedIssues, sourceEncoding, parent); <START> assertThat(issuesDetail).isInstanceOf(IssuesDetail.class); <END> }</code><technical_language>s.o. outstanding vorher == nachher</technical_language>

Target:
void shouldReturnIssuesDetailWhenCallWithOutstandingLink() { DetailFactory detailFactory = new DetailFactory(); Run<?, ?> owner = mock(Run.class); AnalysisResult result = mock(AnalysisResult.class); Charset sourceEncoding = Charset.defaultCharset(); IssuesDetail parent = mock(IssuesDetail.class); IssueBuilder builder = new IssueBuilder(); fixedIssues.add(builder.setMessage("fixed").build()); newIssues.add(builder.setMessage("new").build()); outstandingIssues.add(builder.setMessage("outstanding").build()); allIssues.add(builder.setMessage("all").build()); Object issuesDetail = detailFactory.createTrendDetails("outstanding", owner, result, allIssues, newIssues, outstandingIssues, fixedIssues, sourceEncoding, parent); assertThat(issuesDetail).isInstanceOf(IssuesDetail.class); assertThat(((IssuesDetail) issuesDetail).getIssues()).isEqualTo(outstandingIssues); }
Source:
<code>private void configureAsyncJobs() { bind(JobMessageDispatcher.class).to(ArtemisJobMessageDispatcher.class); bind(SchedulerFactory.class).to(StdSchedulerFactory.class); JobManager.registerJob(TestJob1.JOB_KEY, TestJob1.class); JobManager.registerJob(ExportJob.JOB_KEY, ExportJob.class); JobManager.registerJob(ImportJob.JOB_KEY, ImportJob.class); <START> JobManager.registerJob(org.candlepin.async.tasks.RefreshPoolsJob.JOB_KEY, <END> org.candlepin.async.tasks.RefreshPoolsJob.class); }</code><technical_language>import class for others</technical_language>

Target:
private void configureAsyncJobs() { bind(JobMessageDispatcher.class).to(ArtemisJobMessageDispatcher.class); bind(SchedulerFactory.class).to(StdSchedulerFactory.class); JobManager.registerJob(TestJob1.JOB_KEY, TestJob1.class); JobManager.registerJob(ExportJob.JOB_KEY, ExportJob.class); JobManager.registerJob(ImportJob.JOB_KEY, ImportJob.class); JobManager.registerJob(RefreshPoolsForProductJob.JOB_KEY, RefreshPoolsForProductJob.class); JobManager.registerJob(RefreshPoolsJob.JOB_KEY, RefreshPoolsJob.class); }
Source:
<code>public void setRelatedAlarms(Set<OnmsAlarm> alarms) { m_associatedAlarms.clear(); <START> alarms.stream().forEach(relatedAlarm -> m_associatedAlarms.add(new AlarmAssociation(this, relatedAlarm))); <END> }</code><technical_language>suggestion alarms.forEach(relatedAlarm -> m_associatedAlarms.add(new AlarmAssociation(this, relatedAlarm)));</technical_language>

Target:
public void setRelatedAlarms(Set<OnmsAlarm> alarms) { m_associatedAlarms.clear(); alarms.forEach(relatedAlarm -> m_associatedAlarms.add(new AlarmAssociation(this, relatedAlarm))); }
Source:
<code>public Map<String, Object> toMap() { ObjectMapper mapper = new ObjectMapper(); Map<String, Object> map = super.toMap(); try { <START> map.put(STREAM, stream != null ? mapper.writeValueAsString(stream) : ""); <END> map.put(ACTIONS, actions != null ? mapper.writerFor(new TypeReference<List<Action>>() { }).writeValueAsString(actions) : ""); } catch (Exception e) { throw new RuntimeException(e); } return map; }</code><technical_language>stream is a string this is needed. This is required serializing List,Map, objects Json strings stored in a DB column</technical_language>

Target:
public Map<String, Object> toMap() { ObjectMapper mapper = new ObjectMapper(); Map<String, Object> map = super.toMap(); try { map.put(ACTIONS, actions != null ? mapper.writerFor(new TypeReference<List<Action>>() { }).writeValueAsString(actions) : ""); } catch (Exception e) { throw new RuntimeException(e); } return map; }
Source:
<code>public GoogleCloudStorageImpl( GoogleCloudStorageOptions options, HttpRequestInitializer httpRequestInitializer) throws IOException { Preconditions.checkNotNull(options, "options must not be null"); options.throwIfNotValid(); logger.atFine().log("GCS(%s)", options.getAppName()); this.storageOptions = options; this.httpRequestInitializer = httpRequestInitializer; HttpTransport httpTransport = HttpTransportFactory.createHttpTransport( options.getTransportType(), options.getProxyAddress(), options.getProxyUsername(), options.getProxyPassword()); this.gcs = new Storage.Builder(httpTransport, JSON_FACTORY, httpRequestInitializer) .setRootUrl(options.getStorageRootUrl()) .setServicePath(options.getStorageServicePath()) .setApplicationName(options.getAppName()) .build(); if (storageOptions.isGrpcEnabled()) { this.storageStubProvider = new StorageStubProvider(options.getReadChannelOptions(), backgroundTasksThreadPool); } <START> initAuthorizationProvider(storageOptions.getAuthorizationProvider(), <END> storageOptions.getAuthorizationProviderInitArgument()); }</code><technical_language>delete this part</technical_language>

Target:
public GoogleCloudStorageImpl( GoogleCloudStorageOptions options, HttpRequestInitializer httpRequestInitializer) throws IOException { Preconditions.checkNotNull(options, "options must not be null"); options.throwIfNotValid(); logger.atFine().log("GCS(%s)", options.getAppName()); this.storageOptions = options; this.httpRequestInitializer = httpRequestInitializer; HttpTransport httpTransport = HttpTransportFactory.createHttpTransport( options.getTransportType(), options.getProxyAddress(), options.getProxyUsername(), options.getProxyPassword()); this.gcs = new Storage.Builder(httpTransport, JSON_FACTORY, httpRequestInitializer) .setRootUrl(options.getStorageRootUrl()) .setServicePath(options.getStorageServicePath()) .setApplicationName(options.getAppName()) .build(); if (storageOptions.isGrpcEnabled()) { this.storageStubProvider = new StorageStubProvider(options.getReadChannelOptions(), backgroundTasksThreadPool); } storageRequestAuthorizer = initializeStorageRequestAuthorizer(storageOptions); }
Source:
<code>public void testException() { BundleMessageDataContainerDto dto = new BundleMessageDataContainerDto(makeActions()); getStub(FindEventsQueryDto.class).failWith(new ProtocolAdapterException("simulate error")); List<ActionResponseDto> result = callExecutors(dto); <START> Assert.assertTrue(result != null); <END> }</code><technical_language>check size</technical_language>

Target:
public void testException() { final List<ActionDto> actionDtoList = this.makeActions(); BundleMessageDataContainerDto dto = new BundleMessageDataContainerDto(actionDtoList); getStub(FindEventsQueryDto.class).failWith(new ProtocolAdapterException("simulate error")); List<ActionResponseDto> result = callExecutors(dto); Assert.assertTrue(result != null); Assert.assertEquals(actionDtoList.size(), result.size()); }
Source:
<code><START> public Measurement addMeasurement(String report_id, Boolean write_file) { <END> Measurement measurement = new Measurement(); measurement.report_id = report_id; measurement.is_done = true; measurement.is_uploaded = true; measurement.save(); if (write_file){ File entryFile = Measurement.getEntryFile(c, measurement.id, measurement.test_name); entryFile.getParentFile().mkdirs(); try { FileUtils.writeStringToFile( entryFile, "", Charset.forName("UTF-8") ); } catch (IOException e) { e.printStackTrace(); } } return measurement; }</code><technical_language>pass true write_file. Is intended</technical_language>

Target:
private Measurement addMeasurement(String report_id, Boolean write_file) throws IOException { Measurement measurement = new Measurement(); measurement.report_id = report_id; measurement.is_done = true; measurement.is_uploaded = true; measurement.save(); if (write_file){ File entryFile = Measurement.getEntryFile(c, measurement.id, measurement.test_name); entryFile.getParentFile().mkdirs(); FileUtils.writeStringToFile( entryFile, "", Charset.forName("UTF-8") ); } return measurement; }
Source:
<code>public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); HttpServletRequest request = context.getServletRequest(); addVaryHeaders(invocation); String contextPath = request.getContextPath(); if (exemptedPaths.contains(contextPath)) { return invocation.invoke(); } if (resourceIsolationPolicy.isRequestAllowed(request)) { return invocation.invoke(); } <START> LOG.debug("Fetch metadata rejected cross-origin request to [{}]", contextPath); <END> return SC_FORBIDDEN; }</code><technical_language>improve, I .warn is better</technical_language>

Target:
public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); HttpServletRequest request = context.getServletRequest(); addVaryHeaders(invocation); String contextPath = request.getContextPath(); if (exemptedPaths.contains(contextPath)) { return invocation.invoke(); } if (resourceIsolationPolicy.isRequestAllowed(request)) { return invocation.invoke(); } LOG.info("Fetch metadata rejected cross-origin request to [{}]", contextPath); return SC_FORBIDDEN; }
Source:
<code>private Object readResolve() throws ObjectStreamException { try { String[] names = id.split("#"); <START> Field opField = Class.forName(names[0]).getDeclaredField(names[1]); <END> return opField.get(null); } catch (NoSuchFieldException e) { throw new RuntimeException(e); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } }</code><technical_language>Consider getField() instead, ~~it's implementation in OpenJDK 8 more performant.~~ semantics of method apply in this case, is a public field. _Edit: confirm claim_</technical_language>

Target:
private Object readResolve() throws ObjectStreamException { try { String[] names = id.split("#"); Field opField = Class.forName(names[0]).getField(names[1]); return opField.get(null); } catch (NoSuchFieldException e) { throw new RuntimeException(e); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } }
Source:
<code>public boolean isDiscoveryNode() { return id.length > 64; <START> } <END></code><technical_language>Honestly I idea of making ID 128 bytes length. code (including user) relies 64 bytes broken unpredictable place. identify Node host(IP)+port+nodeId (i.e. change equals method) set fake 0x00 x 64 ID? set 32 bytes zero for fake ID? prefer</technical_language>

Target:
public boolean isDiscoveryNode() { return isFakeNodeId; }
Source:
<code>public void visitToken(DetailAST arrayInit) { final DetailAST rcurly = arrayInit.findFirstToken(TokenTypes.RCURLY); final DetailAST previousSibling = rcurly.getPreviousSibling(); if (arrayInit.getChildCount() != 1 <START> && (alwaysDemandTrailingComma || !TokenUtil.areOnSameLine(rcurly, previousSibling)) && (alwaysDemandTrailingComma || !TokenUtil.areOnSameLine(arrayInit, previousSibling)) <END> && previousSibling.getType() != TokenTypes.COMMA) { log(previousSibling, MSG_KEY); } }</code><technical_language>I if easier/harder read if pulling out alwaysDemandTrailingComma, e.g. java && (alwaysDemandTrailingComma || (!TokenUtil.areOnSameLine(rcurly, previousSibling) && !TokenUtil.areOnSameLine(arrayInit, previousSibling)))</technical_language>

Target:
public void visitToken(DetailAST arrayInit) { final DetailAST rcurly = arrayInit.findFirstToken(TokenTypes.RCURLY); final DetailAST previousSibling = rcurly.getPreviousSibling(); if (arrayInit.getChildCount() != 1 && (alwaysDemandTrailingComma || !TokenUtil.areOnSameLine(rcurly, previousSibling) && !TokenUtil.areOnSameLine(arrayInit, previousSibling)) && previousSibling.getType() != TokenTypes.COMMA) { log(previousSibling, MSG_KEY); } }
Source:
<code>protected String[] customCommandLineValidation() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsReadable(EXTENDED_ILLUMINA_MANIFEST); IOUtil.assertFileIsWritable(OUTPUT); refSeq = ReferenceSequenceFileFactory.getReferenceSequenceFile(REFERENCE_SEQUENCE); final SAMSequenceDictionary sequenceDictionary = refSeq.getSequenceDictionary(); if (!sequenceDictionary.getSequence(0).getAssembly().equals("GRCh37")) { <START> return new String[]{"This tool is currently only implemented to support NCBI Build 37 / HG19 Reference Sequence."}; <END> } if (FINGERPRINT_GENOTYPES_VCF_FILE != null) { IOUtil.assertFileIsReadable(FINGERPRINT_GENOTYPES_VCF_FILE); } if (GENDER_GTC != null) { IOUtil.assertFileIsReadable(GENDER_GTC); } return super.customCommandLineValidation(); }</code><technical_language>include in error message build</technical_language>

Target:
protected String[] customCommandLineValidation() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsReadable(EXTENDED_ILLUMINA_MANIFEST); IOUtil.assertFileIsWritable(OUTPUT); refSeq = ReferenceSequenceFileFactory.getReferenceSequenceFile(REFERENCE_SEQUENCE); final SAMSequenceDictionary sequenceDictionary = refSeq.getSequenceDictionary(); final String assembly = sequenceDictionary.getSequence(0).getAssembly(); if (!assembly.equals("GRCh37")) { return new String[]{"The selected reference sequence ('" + assembly + "') is not supported. This tool is currently only implemented to support NCBI Build 37 / HG19 Reference Sequence."}; } if (FINGERPRINT_GENOTYPES_VCF_FILE != null) { IOUtil.assertFileIsReadable(FINGERPRINT_GENOTYPES_VCF_FILE); } if (GENDER_GTC != null) { IOUtil.assertFileIsReadable(GENDER_GTC); } return super.customCommandLineValidation(); }
Source:
<code>public void handleInvocation(EJBClientInvocationContext context) throws Exception { <START> log.info("In the client interceptor handleInvocation : " + this.getClass().getName() + " " + context.getViewClass() + " " + context.getLocator()); <END> context.getContextData().put("ClientInterceptorInvoked", this.getClass().getName() + " " + context.getViewClass() + " " + context.getLocator()); context.sendRequest(); }</code><technical_language>Please log debug trace</technical_language>

Target:
public void handleInvocation(EJBClientInvocationContext context) throws Exception { log.debug("In the client interceptor handleInvocation : " + this.getClass().getName() + " " + context.getViewClass() + " " + context.getLocator()); context.sendRequest(); }
Source:
<code>private List<DiskImage> getImagesToPreview() { if (imagesToPreview == null) { List<DiskImage> allSnapshotsForVm = diskImageDao.getAllSnapshotsForVmSnapshot(getDstSnapshot().getId()); Set<Guid> <START> guidsAllSnapshotsForVm = <END> allSnapshotsForVm.stream() .map(BaseDisk::getId) .collect(Collectors.toSet()); if (getParameters().getDiskIds() != null) { imagesToPreview = getParameters().getDiskIds().stream() .filter(guidsAllSnapshotsForVm::contains) .map(g -> diskImageDao.getSnapshotById(g)) .collect(Collectors.toList()); } else { imagesToPreview = allSnapshotsForVm; } } return imagesToPreview; }</code><technical_language>1. imo renamed allSnapshotIdsForVm 2. more useful for replace a map of guid disk image for processing</technical_language>

Target:
private List<DiskImage> getImagesToPreview() { if (imagesToPreview == null) { List<DiskImage> allSnapshotsForVm = diskImageDao.getAllSnapshotsForVmSnapshot(getDstSnapshot().getId()); if (getParameters().getDiskIds() != null) { Map<Guid, DiskImage> guidDiskImageMap = allSnapshotsForVm.stream() .collect(Collectors.toMap(BaseDisk::getId, disk -> disk)); diskImagesForDiskIds = guidDiskImageMap.entrySet().stream() .filter(entry -> getParameters().getDiskIds().contains(entry.getKey())) .map(Map.Entry::getValue) .collect(Collectors.toList()); imagesToPreview = diskImagesForDiskIds; } else { imagesToPreview = allSnapshotsForVm; } } return imagesToPreview; }
Source:
<code>public void afterExam() throws Exception { <START> getServiceManager().stopManagedService(openSearchPid); <END> getServiceManager().stopManagedService(cswPid); getServiceManager().stopManagedService(cswPid2); getServiceManager().stopManagedService(cswPid3); getServiceManager().stopManagedService(gmdPid); if (cswServer != null) { cswServer.stop(); } }</code><technical_language>Do if stopManagedService() accepts null arguments? is null if initialization failed set</technical_language>

Target:
public void afterExam() throws Exception { if (openSearchPid != null) { getServiceManager().stopManagedService(openSearchPid); } if (cswPid != null) { getServiceManager().stopManagedService(cswPid); } if (cswPid2 != null) { getServiceManager().stopManagedService(cswPid2); } if (cswPid3 != null) { getServiceManager().stopManagedService(cswPid3); } if (gmdPid != null) { getServiceManager().stopManagedService(gmdPid); } if (cswServer != null) { cswServer.stop(); } }
Source:
<code>public void startingVmCompleted(Guid vmId, String cause) { <START> if (log.isDebugEnabled() && startingVms.contains(vmId)) { <END> log.debug("Startup of VM completed ({})", vmId, cause); } startingVms.remove(vmId); }</code><technical_language>remove vm anyway, this replaced with: if (startingVms.remove(vmId) && log.isDebugEnabled()) right</technical_language>

Target:
public void startingVmCompleted(Guid vmId, String cause) { if (startingVms.remove(vmId)) { log.debug("Startup of VM completed ({})", vmId, cause); } }
Source:
<code>private List<Integer> generateIntegerList(final int size) { <START> final List<Integer> integerList = new ArrayList<Integer>(size); <END> for (int i = 0; i < size; i++) { integerList.add(random.nextInt()); } return integerList; }</code><technical_language>omit Integer</technical_language>

Target:
private List<Integer> generateIntegerList(final int size) { final List<Integer> integerList = new ArrayList<>(size); for (int i = 0; i < size; i++) { integerList.add(random.nextInt()); } return integerList; }
Source:
<code>public void send_request(ClientRequestInfo clientRequestInfo) throws ForwardRequest { if (openTracingService == null) { return; } Tracer tracer = GlobalTracer.get(); if (!GlobalTracer.isRegistered()) { Tracer tracerImpl = openTracingService.getTracer(PAYARA_CORBA_RMI_TRACER_NAME); if (tracerImpl == null) { return; } else { GlobalTracer.register(tracerImpl); } } Span activeSpan = tracer.activeSpan(); if (activeSpan == null) { return; } OpenTracingIiopTextMap textMap = new OpenTracingIiopTextMap(); tracer.inject(activeSpan.context(), Format.Builtin.TEXT_MAP, textMap); try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) { <START> ObjectOutputStream out = new ObjectOutputStream(bos); <END> out.writeObject(textMap); out.flush(); ServiceContext serviceContext = new ServiceContext(OPENTRACING_IIOP_ID, bos.toByteArray()); clientRequestInfo.add_request_service_context(serviceContext, true); } catch (IOException ex) { Logger.getLogger(OpenTracingIiopClientInterceptor.class.getName()).log(Level.SEVERE, "Exception caught propagating span context"); } }</code><technical_language>out part of try resources block</technical_language>

Target:
public void send_request(ClientRequestInfo clientRequestInfo) throws ForwardRequest { if (!GlobalTracer.isRegistered()) { registerTracer(); if (!GlobalTracer.isRegistered()) { return; } } Span activeSpan = tracer.activeSpan(); if (activeSpan == null) { return; } OpenTracingIiopTextMap textMap = new OpenTracingIiopTextMap(); tracer.inject(activeSpan.context(), Format.Builtin.TEXT_MAP, textMap); try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(bos)) { out.writeObject(textMap); out.flush(); ServiceContext serviceContext = new ServiceContext(OPENTRACING_IIOP_ID, bos.toByteArray()); clientRequestInfo.add_request_service_context(serviceContext, true); } catch (IOException ex) { Logger.getLogger(OpenTracingIiopClientInterceptor.class.getName()).log(Level.SEVERE, "Exception caught propagating span context"); } }
Source:
<code>public void createNoAccess() throws Exception { ObjectMapper mapper = new ObjectMapper(); BitstreamFormatRest bitstreamFormatRest = this.createRandomMockBitstreamRest(false); getClient(null).perform(post("/api/core/bitstreamformats/") .content(mapper.writeValueAsBytes(bitstreamFormatRest)).contentType(contentType)) <START> .andExpect(status().isUnauthorized()); <END> }</code><technical_language>add a check bitstreamformat created</technical_language>

Target:
public void createNoAccess() throws Exception { ObjectMapper mapper = new ObjectMapper(); BitstreamFormatRest bitstreamFormatRest = this.createRandomMockBitstreamRest(false); getClient(null).perform(post("/api/core/bitstreamformats/") .content(mapper.writeValueAsBytes(bitstreamFormatRest)).contentType(contentType)) .andExpect(status().isUnauthorized()); getClient().perform(get("/api/core/bitstreamformats/")) .andExpect(status().isOk()) .andExpect(jsonPath("$.page.totalElements", is(DEFAULT_AMOUNT_FORMATS))); }
Source:
<code>private static SwitchType getSwitchType(Version clusterVersion, Map<String, Object> networkProperties) { Object switchType = networkProperties.get(VdsProperties.SWITCH_KEY); boolean <START> switchTypeShouldBeReportedByOvs = <END> FeatureSupported.ovsSupported(clusterVersion); if (switchTypeShouldBeReportedByOvs && switchType == null) { throw new IllegalStateException("Required SwitchType is not reported."); } return switchType != null ? SwitchType.parse(switchType.toString()) : null; }</code><technical_language>a typo; end in 'Vdsm'</technical_language>

Target:
private static SwitchType getSwitchType(Version clusterVersion, Map<String, Object> networkProperties) { Object switchType = networkProperties.get(VdsProperties.SWITCH_KEY); boolean switchTypeShouldBeReportedByVdsm = FeatureSupported.ovsSupported(clusterVersion); if (switchTypeShouldBeReportedByVdsm && switchType == null) { throw new IllegalStateException("Required SwitchType is not reported."); } return SwitchType.parse(Objects.toString(switchType, null)); }
Source:
<code>protected void bind(@NonNull User user) { Statistics statistics = user.getStats(); episodes.setValue(statistics.getWatchedEpisodes()); hours.setValue((int) (statistics.getWatchedHours() + 0.5F)); <START> days.setValue((int) (statistics.getWatchedDays() + 0.5F)); <END> Observable.from(user.getFriends()) .compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW)) .subscribeOn(Schedulers.computation()) .filter(f -> f.getWastedTime() > user.getWastedTime()) .count() .observeOn(AndroidSchedulers.mainThread()) .subscribe(n -> place.setText(getActivity().getString(R.string.place, n + 1))); }</code><technical_language>Math.ceil</technical_language>

Target:
protected void bind(@NonNull User user) { Statistics statistics = user.getStats(); episodes.setValue(statistics.getWatchedEpisodes()); hours.setValue((int) Math.ceil(statistics.getWatchedHours())); days.setValue((int) Math.ceil(statistics.getWatchedDays())); Observable.from(user.getFriends()) .compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW)) .subscribeOn(Schedulers.computation()) .filter(f -> f.getWastedTime() > user.getWastedTime()) .count() .observeOn(AndroidSchedulers.mainThread()) .subscribe(n -> place.setText(getActivity().getString(R.string.place, n + 1))); }
Source:
<code>public StructuredRecord.Builder startCurrentValue() throws IOException, InterruptedException { if (schema != null) { return recordTransformer.transform(delegate.getCurrentKey().datum(), schema, pathField); } Schema schema = recordTransformer.generateStructuredSchema(delegate.getCurrentKey().datum()); <START> return recordTransformer.transform(delegate.getCurrentKey().datum(), addFieldToSchema(schema, pathField), <END> pathField); }</code><technical_language>this break path field is null, add field if path is null</technical_language>

Target:
public StructuredRecord.Builder startCurrentValue() throws IOException, InterruptedException { GenericRecord genericRecord = delegate.getCurrentKey().datum(); Schema recordSchema = schema; if (recordSchema == null) { recordSchema = recordTransformer.convertSchema(genericRecord.getSchema()); if (pathField != null) { recordSchema = addFieldToSchema(recordSchema, pathField); } } return recordTransformer.transform(genericRecord, recordSchema, pathField); }
Source:
<code>void fillChunks() { try { PutChunk chunkToFill; while (!isChunkFillingDone()) { if (channelReadBuffer == null) { channelReadBuffer = chunkFillerChannel.getNextChunk(0); } if (channelReadBuffer != null) { maybeStopTrackingWaitForChannelDataTime(); <START> chunkToFill = getChunkToFill(); <END> if (chunkToFill == null) { maybeStartTrackingWaitForChunkTime(); break; } else { maybeStopTrackingWaitForChunkTime(); bytesFilledSoFar += chunkToFill.fillFrom(channelReadBuffer); if (chunkToFill.isReady()) { routerCallback.onPollReady(); } if (!channelReadBuffer.hasRemaining()) { chunkFillerChannel.resolveOldestChunk(null); channelReadBuffer = null; } } } else { if (getFreeChunk() != null) { maybeStartTrackingWaitForChannelDataTime(); } break; } } if (chunkFillingCompletedSuccessfully) { PutChunk lastChunk = getBuildingChunk(); if (lastChunk != null) { if (chunkCounter != 0 && lastChunk.buf.position() == 0) { logger.trace("The last buffer(s) received from chunkFillerChannel have no data, discarding them."); } else { lastChunk.onFillComplete(true, true); updateChunkFillerWaitTimeMetrics(); } } routerCallback.onPollReady(); } } catch (Exception e) { RouterException routerException = e instanceof RouterException ? (RouterException) e : new RouterException("PutOperation fillChunks encountered unexpected error", e, RouterErrorCode.UnexpectedInternalError); routerMetrics.chunkFillerUnexpectedErrorCount.inc(); routerCallback.onPollReady(); setOperationExceptionAndComplete(routerException); } }</code><technical_language>this removed</technical_language>

Target:
void fillChunks() { try { PutChunk chunkToFill; while (!isChunkFillingDone()) { if (channelReadBuffer == null) { channelReadBuffer = chunkFillerChannel.getNextChunk(0); } if (channelReadBuffer != null) { maybeStopTrackingWaitForChannelDataTime(); chunkToFill = getChunkToFill(); if (chunkToFill == null) { maybeStartTrackingWaitForChunkTime(); break; } else { maybeStopTrackingWaitForChunkTime(); bytesFilledSoFar += chunkToFill.fillFrom(channelReadBuffer); if (chunkToFill.isReady() && !chunkToFill.chunkBlobProperties.isEncrypted()) { routerCallback.onPollReady(); } if (!channelReadBuffer.hasRemaining()) { chunkFillerChannel.resolveOldestChunk(null); channelReadBuffer = null; } } } else { if (getFreeChunk() != null) { maybeStartTrackingWaitForChannelDataTime(); } break; } } if (chunkFillingCompletedSuccessfully) { PutChunk lastChunk = getBuildingChunk(); if (lastChunk != null) { if (chunkCounter != 0 && lastChunk.buf.position() == 0) { logger.trace("The last buffer(s) received from chunkFillerChannel have no data, discarding them."); } else { lastChunk.onFillComplete(true); updateChunkFillerWaitTimeMetrics(); } if (lastChunk.isReady()) { routerCallback.onPollReady(); } } } } catch (Exception e) { RouterException routerException = e instanceof RouterException ? (RouterException) e : new RouterException("PutOperation fillChunks encountered unexpected error", e, RouterErrorCode.UnexpectedInternalError); routerMetrics.chunkFillerUnexpectedErrorCount.inc(); routerCallback.onPollReady(); setOperationExceptionAndComplete(routerException); } }
Source:
<code>protected void fireEvalStateChanged() { Runnable r= new Runnable() { @Override public void run() { Shell shell= getShell(); if (fSnippetStateListeners != null && shell != null && !shell.isDisposed()) { for (ISnippetStateChangedListener <START> l : <END> new ArrayList<>(fSnippetStateListeners)) { l.snippetStateChanged(JavaSnippetEditor.this); } } } }; Shell shell= getShell(); if (shell != null) { getShell().getDisplay().asyncExec(r); } }</code><technical_language>rename listener</technical_language>

Target:
protected void fireEvalStateChanged() { Runnable r= new Runnable() { @Override public void run() { Shell shell= getShell(); if (fSnippetStateListeners != null && shell != null && !shell.isDisposed()) { for (ISnippetStateChangedListener listener : new ArrayList<>(fSnippetStateListeners)) { listener.snippetStateChanged(JavaSnippetEditor.this); } } } }; Shell shell= getShell(); if (shell != null) { getShell().getDisplay().asyncExec(r); } }
Source:
<code>public BlockManagerImpl(final Configuration conf, final StorageContainerManager scm) { Objects.requireNonNull(scm, "SCM cannot be null"); this.pipelineManager = scm.getPipelineManager(); this.containerManager = scm.getContainerManager(); this.containerSize = (long)conf.getStorageSize( ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE, ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE_DEFAULT, StorageUnit.BYTES); mxBean = MBeans.register("BlockManager", "BlockManagerImpl", this); deletedBlockLog = new DeletedBlockLogImpl(conf, scm.getContainerManager(), scm.getScmMetadataStore()); long svcInterval = conf.getTimeDuration(OZONE_BLOCK_DELETING_SERVICE_INTERVAL, OZONE_BLOCK_DELETING_SERVICE_INTERVAL_DEFAULT, TimeUnit.MILLISECONDS); long serviceTimeout = conf.getTimeDuration( OZONE_BLOCK_DELETING_SERVICE_TIMEOUT, OZONE_BLOCK_DELETING_SERVICE_TIMEOUT_DEFAULT, TimeUnit.MILLISECONDS); blockDeletingService = new SCMBlockDeletingService(deletedBlockLog, containerManager, scm.getScmNodeManager(), scm.getEventQueue(), svcInterval, serviceTimeout, conf); safeModePrecheck = new SafeModePrecheck(conf); long heartbeatInterval = conf.getTimeDuration( HddsConfigKeys.HDDS_HEARTBEAT_INTERVAL, <START> HddsConfigKeys.HDDS_COMMAND_STATUS_REPORT_INTERVAL, <END> TimeUnit.MILLISECONDS); long commandStatusReportInterval = conf.getTimeDuration( HddsConfigKeys.HDDS_COMMAND_STATUS_REPORT_INTERVAL, HddsConfigKeys.HDDS_COMMAND_STATUS_REPORT_INTERVAL_DEFAULT, TimeUnit.MILLISECONDS); Preconditions.checkState(heartbeatInterval <= commandStatusReportInterval, "Heartbeat interval is smaller than command status report interval"); pipelineCreateWaitTimeout = ((commandStatusReportInterval + heartbeatInterval - 1) / heartbeatInterval) * heartbeatInterval + 5000L; }</code><technical_language>this HDDS_HEARTBEAT_INTERVAL_DEFAULT</technical_language>

Target:
public BlockManagerImpl(final Configuration conf, final StorageContainerManager scm) { Objects.requireNonNull(scm, "SCM cannot be null"); this.pipelineManager = scm.getPipelineManager(); this.containerManager = scm.getContainerManager(); this.containerSize = (long)conf.getStorageSize( ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE, ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE_DEFAULT, StorageUnit.BYTES); mxBean = MBeans.register("BlockManager", "BlockManagerImpl", this); deletedBlockLog = new DeletedBlockLogImpl(conf, scm.getContainerManager(), scm.getScmMetadataStore()); long svcInterval = conf.getTimeDuration(OZONE_BLOCK_DELETING_SERVICE_INTERVAL, OZONE_BLOCK_DELETING_SERVICE_INTERVAL_DEFAULT, TimeUnit.MILLISECONDS); long serviceTimeout = conf.getTimeDuration( OZONE_BLOCK_DELETING_SERVICE_TIMEOUT, OZONE_BLOCK_DELETING_SERVICE_TIMEOUT_DEFAULT, TimeUnit.MILLISECONDS); blockDeletingService = new SCMBlockDeletingService(deletedBlockLog, containerManager, scm.getScmNodeManager(), scm.getEventQueue(), svcInterval, serviceTimeout, conf); safeModePrecheck = new SafeModePrecheck(conf); }
Source:
<code>public void testExecute_curlLogger() throws Exception { LogRecordingHandler recorder = new LogRecordingHandler(); HttpTransport.LOGGER.setLevel(Level.CONFIG); HttpTransport.LOGGER.addHandler(recorder); new MockHttpTransport() .createRequestFactory() .buildGetRequest(new GenericUrl("<LINK_0>'b'c")) .execute(); boolean found = false; for (String message : recorder.messages()) { if (message.startsWith("curl")) { found = true; <START> assert(message.contains("curl -v --compressed -H 'Accept-Encoding: gzip'")); <END> assert(message.contains("-H 'User-Agent: Google-HTTP-Java-Client/" + HttpRequest.VERSION + " (gzip)'")); assert(message.contains("' -- '<LINK_0>'\"'\"'b'\"'\"'c'")); } } assertTrue(found); }</code><technical_language>this assertTrue</technical_language>

Target:
public void testExecute_curlLogger() throws Exception { LogRecordingHandler recorder = new LogRecordingHandler(); HttpTransport.LOGGER.setLevel(Level.CONFIG); HttpTransport.LOGGER.addHandler(recorder); new MockHttpTransport() .createRequestFactory() .buildGetRequest(new GenericUrl("<LINK_0>'b'c")) .execute(); boolean found = false; for (String message : recorder.messages()) { if (message.startsWith("curl")) { found = true; assertTrue(message.contains("curl -v --compressed -H 'Accept-Encoding: gzip'")); assertTrue(message.contains("-H 'User-Agent: Google-HTTP-Java-Client/" + HttpRequest.VERSION + " (gzip)'")); assertTrue(message.contains("' -- '<LINK_0>'\"'\"'b'\"'\"'c'")); } } assertTrue(found); }
Source:
<code>public ResponseEntity<Integer> createTransaction( @PathVariable final String cropName, @PathVariable final String lotId, @ApiParam("Transaction to be created") @RequestBody final TransactionDto transactionDto) { final String userName = SecurityUtil.getLoggedInUserName(); final WorkbenchUser user = this.userService.getUserByUsername(userName); transactionDto.setUser(user.getUserid().toString()); <START> return new ResponseEntity<>(this.transactionService.saveTransaction(transactionDto, lotId, TransactionStatus.COMMITTED), HttpStatus.CREATED); <END> }</code><technical_language>@vmaletta TransactionDto contains a lot so, set lotId TransactionDTO avoid passing lotId param. TransactionStatus passed a param. inferred. Deposits Committed status</technical_language>

Target:
public ResponseEntity<Integer> createTransaction( @PathVariable final String cropName, @PathVariable final String lotId, @ApiParam("Transaction to be created") @RequestBody final TransactionDto transactionDto) { final WorkbenchUser user = this.securityService.getCurrentlyLoggedInUser(); transactionDto.setUser(user.getUserid().toString()); if (transactionDto.getLot() == null) { transactionDto.setLot(new ExtendedLotDto()); } transactionDto.getLot().setLotId(Integer.valueOf(lotId)); return new ResponseEntity<>(this.transactionService.saveTransaction(transactionDto), HttpStatus.CREATED); }
Source:
<code>private FAsyncCallback recvContestStart(String op, FProtocolFactory pf, ContestStartHandler handler) { return new FAsyncCallback() { public void onMessage(TTransport tr) throws TException { FProtocol iprot = pf.getProtocol(tr); FContext ctx = iprot.readRequestHeader(); TMessage msg = iprot.readMessageBegin(); if (!msg.name.equals(op)) { TProtocolUtil.skip(iprot, TType.STRUCT); iprot.readMessageEnd(); <START> throw new TApplicationException(FrugalTApplicationExceptionType.UNKNOWN_METHOD); <END> } org.apache.thrift.protocol.TList elem42 = iprot.readListBegin(); java.util.List<Album> received = new ArrayList<Album>(elem42.size); for (int elem43 = 0; elem43 < elem42.size; ++elem43) { Album elem44 = new Album(); elem44.read(iprot); received.add(elem44); } iprot.readListEnd(); iprot.readMessageEnd(); handler.onContestStart(ctx, received); } }; }</code><technical_language>latest v2 merged this? I thought this changed</technical_language>

Target:
private FAsyncCallback recvContestStart(String op, FProtocolFactory pf, ContestStartHandler handler) { return new FAsyncCallback() { public void onMessage(TTransport tr) throws TException { FProtocol iprot = pf.getProtocol(tr); FContext ctx = iprot.readRequestHeader(); TMessage msg = iprot.readMessageBegin(); if (!msg.name.equals(op)) { TProtocolUtil.skip(iprot, TType.STRUCT); iprot.readMessageEnd(); throw new TApplicationException(TApplicationExceptionType.UNKNOWN_METHOD); } org.apache.thrift.protocol.TList elem42 = iprot.readListBegin(); java.util.List<Album> received = new ArrayList<Album>(elem42.size); for (int elem43 = 0; elem43 < elem42.size; ++elem43) { Album elem44 = new Album(); elem44.read(iprot); received.add(elem44); } iprot.readListEnd(); iprot.readMessageEnd(); handler.onContestStart(ctx, received); } }; }
Source:
<code>protected void handleRequest(RestRequest request, RestChannel channel, Client client) throws Exception { String uri = request.uri(); logger.debug("uri: {}", uri); logger.debug("action: {}", request.param("action")); <START> if (uri.indexOf("list") > -1) { <END> list(request, channel); return; } else if (uri.endsWith("start")) { start(request, channel, client); return; } else if (uri.endsWith("stop")) { stop(request, channel, client); return; } else if (uri.endsWith("delete")) { delete(request, channel, client); return; } respondError(request, channel, "action not found: " + uri, RestStatus.OK); }</code><technical_language>This feels a bit hacky (e.g. if adds a query parameter list in name another call). do this, I is more point of is meant? request.path().endsWith("list")</technical_language>

Target:
protected void handleRequest(RestRequest request, RestChannel channel, Client client) throws Exception { String uri = request.uri(); logger.debug("uri: {}", uri); logger.debug("action: {}", request.param("action")); if (request.path().endsWith("list")) { list(request, channel); return; } else if (uri.endsWith("start")) { start(request, channel, client); return; } else if (uri.endsWith("stop")) { stop(request, channel, client); return; } else if (uri.endsWith("delete")) { delete(request, channel, client); return; } respondError(request, channel, "action not found: " + uri, RestStatus.OK); }
Source:
<code>protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { if (root != null) { return root; } root = new DiffNode(Differencer.NO_CHANGE); <START> for (IFileItem item : items.getItems()) { <END> if (item.getBase().getContent() != null) { FileItemNode node = new FileItemNode(behavior, (IFileItem) item, monitor); DiffNode parent = findNode(root, node.getPath()); parent.add(node); } } for (IDiffElement child : root.getChildren()) { if (child instanceof FileItemNode) { flattenTree((FileItemNode) child); } } return root; }</code><technical_language>original version suggests some of items of type IFileItem - I lines 59-62 intact add check (line 59) line 64 (in original)</technical_language>

Target:
protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { if (root != null) { return root; } root = new DiffNode(Differencer.NO_CHANGE); for (IReviewItem item : items.getItems()) { if (!(item instanceof IFileItem)) { continue; } else if (item instanceof IFileItem && ((IFileItem) item).getBase().getContent() != null) { FileItemNode node = new FileItemNode(behavior, (IFileItem) item, monitor); DiffNode parent = findNode(root, node.getPath()); parent.add(node); } } for (IDiffElement child : root.getChildren()) { if (child instanceof FileItemNode) { flattenTree((FileItemNode) child); } } return root; }