auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testMultiThreadedShared() throws Exception { webClientFactory.activate(createConfigMap(10, 200, 60, 5, 10, 60)); <START> <END> ThreadPoolExecutor workers = new ThreadPoolExecutor(20, 80, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(50 * 50)); List<HttpClient> clients = new ArrayList<>(); final int CLIENTS = 2; final int REQUESTS = 2; for (int i = 0; i < CLIENTS; i++) { HttpClient httpClient = webClientFactory.getCommonHttpClient(); clients.add(httpClient); } final List<String> failures = new ArrayList<>(); for (int i = 0; i < REQUESTS; i++) { for (final HttpClient client : clients) { workers.execute(new Runnable() { @Override public void run() { try { ContentResponse response = client.GET(TEST_URL); if (response.getStatus() != 200) { failures.add("Statuscode != 200"); } } catch (InterruptedException | ExecutionException | TimeoutException e) { failures.add("Unexpected exception:" + e.getMessage()); } } }); } } workers.shutdown(); workers.awaitTermination(120, TimeUnit.SECONDS); if (!failures.isEmpty()) { fail(failures.toString()); } webClientFactory.deactivate(); }</code><technical_language>long method in place (deprecated), imho leave tests in place</technical_language>

Target:
public void testMultiThreadedShared() throws Exception { ThreadPoolExecutor workers = new ThreadPoolExecutor(20, 80, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(50 * 50)); List<HttpClient> clients = new ArrayList<>(); final int CLIENTS = 2; final int REQUESTS = 2; for (int i = 0; i < CLIENTS; i++) { HttpClient httpClient = webClientFactory.getCommonHttpClient(); clients.add(httpClient); } final List<String> failures = new ArrayList<>(); for (int i = 0; i < REQUESTS; i++) { for (final HttpClient client : clients) { workers.execute(new Runnable() { @Override public void run() { try { ContentResponse response = client.GET(TEST_URL); if (response.getStatus() != 200) { failures.add("Statuscode != 200"); } } catch (InterruptedException | ExecutionException | TimeoutException e) { failures.add("Unexpected exception:" + e.getMessage()); } } }); } } workers.shutdown(); workers.awaitTermination(120, TimeUnit.SECONDS); if (!failures.isEmpty()) { fail(failures.toString()); } }
Source:
<code>protected int resolveLevelForType(char[] qualifiedPattern, TypeBinding type) { if (qualifiedPattern == null) return ACCURATE_MATCH; if (type == null || !type.isValidBinding()) return INACCURATE_MATCH; if (type.isTypeVariable()) return IMPOSSIBLE_MATCH; if (type instanceof IntersectionTypeBinding18) { int result = IMPOSSIBLE_MATCH; IntersectionTypeBinding18 i18 = (IntersectionTypeBinding18) type; for (ReferenceBinding ref : i18.intersectingTypes) { <START> result = <END> resolveLevelForType(qualifiedPattern, ref); if (result == ACCURATE_MATCH) break; } return result; } char[] qualifiedPackageName = type.qualifiedPackageName(); char[] qualifiedSourceName = qualifiedSourceName(type); char[] fullyQualifiedTypeName = qualifiedPackageName.length == 0 ? qualifiedSourceName : CharOperation.concat(qualifiedPackageName, qualifiedSourceName, '.'); return CharOperation.match(qualifiedPattern, fullyQualifiedTypeName, this.isCaseSensitive) ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; }</code><technical_language>do possibly expect some INACCURATE_MATCH here? In case a result discarded this loop, wrong me. change good me</technical_language>

Target:
protected int resolveLevelForType(char[] qualifiedPattern, TypeBinding type) { if (qualifiedPattern == null) return ACCURATE_MATCH; if (type == null || !type.isValidBinding()) return INACCURATE_MATCH; if (type.isTypeVariable()) return IMPOSSIBLE_MATCH; if (type instanceof IntersectionTypeBinding18) { int result = IMPOSSIBLE_MATCH, prev = IMPOSSIBLE_MATCH; IntersectionTypeBinding18 i18 = (IntersectionTypeBinding18) type; for (ReferenceBinding ref : i18.intersectingTypes) { result = resolveLevelForType(qualifiedPattern, ref); if (result == ACCURATE_MATCH) return result; if (result == IMPOSSIBLE_MATCH) continue; if (prev == IMPOSSIBLE_MATCH) prev = result; } return prev; } char[] qualifiedPackageName = type.qualifiedPackageName(); char[] qualifiedSourceName = qualifiedSourceName(type); char[] fullyQualifiedTypeName = qualifiedPackageName.length == 0 ? qualifiedSourceName : CharOperation.concat(qualifiedPackageName, qualifiedSourceName, '.'); return CharOperation.match(qualifiedPattern, fullyQualifiedTypeName, this.isCaseSensitive) ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; }
Source:
<code>public double price( ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, PriceType priceType, ReferenceData refData) { <START> ArgChecker.notNull(cds, "cds"); <END> ArgChecker.notNull(ratesProvider, "ratesProvider"); ArgChecker.notNull(referenceDate, "referenceDate"); ArgChecker.notNull(refData, "refData"); if (!cds.getProtectionEndDate().isAfter(ratesProvider.getValuationDate())) { return 0d; } LocalDate stepinDate = cds.getStepinDateOffset().adjust(ratesProvider.getValuationDate(), refData); LocalDate effectiveStartDate = cds.getEffectiveStartDate(stepinDate); double recoveryRate = recoveryRate(cds, ratesProvider); Pair<CreditDiscountFactors, LegalEntitySurvivalProbabilities> rates = reduceDiscountFactors(cds, ratesProvider); double protectionLeg = protectionLeg(cds, rates.getFirst(), rates.getSecond(), referenceDate, effectiveStartDate, recoveryRate); double rpv01 = riskyAnnuity( cds, rates.getFirst(), rates.getSecond(), referenceDate, stepinDate, effectiveStartDate, priceType); return protectionLeg - rpv01 * cds.getFixedRate(); }</code><technical_language>longer ArgChecker.notNull methods this (we methods create state in objects). (and other methods)</technical_language>

Target:
public double price( ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, PriceType priceType, ReferenceData refData) { return price(cds, ratesProvider, cds.getFixedRate(), referenceDate, priceType, refData); }
Source:
<code>public void readSpawnData(ByteBuf data) { type = GrenadeType.getGrenade(ByteBufUtils.readUTF8String(data)); { <START> Entity ent = world.getEntityByID(data.readInt()); <END> if (ent instanceof EntityPlayer) { player = Optional.of((EntityPlayer)ent); } else { player = Optional.empty(); } } thrower = Optional.ofNullable(world.getEntityByID(data.readInt())); setRotation(data.readFloat(), data.readFloat()); prevRotationYaw = rotationYaw; prevRotationPitch = rotationPitch; axes.setAngles(rotationYaw, rotationPitch, 0F); if(type.spinWhenThrown) angularVelocity = new Vector3f(0F, 0F, 10F); }</code><technical_language>player = ent instanceof EntityPlayer ? Optional.of((EntityPlayer) ent) : Optional.empty(); preferred, especially this code formatting braces new lines :roll_eyes:</technical_language>

Target:
public void readSpawnData(ByteBuf data) { type = GrenadeType.getGrenade(ByteBufUtils.readUTF8String(data)); { Entity ent = world.getEntityByID(data.readInt()); player = ent instanceof EntityPlayer ? Optional.of((EntityPlayer) ent) : Optional.empty(); } thrower = Optional.ofNullable(world.getEntityByID(data.readInt())); setRotation(data.readFloat(), data.readFloat()); prevRotationYaw = rotationYaw; prevRotationPitch = rotationPitch; axes.setAngles(rotationYaw, rotationPitch, 0F); if(type.spinWhenThrown) angularVelocity = new Vector3f(0F, 0F, 10F); }
Source:
<code>private static void queryRepository() { <START> System.out.println("\n>>> Persons with name 'John' and 'Brad':"); <END> List<Person> persons = repo.findByFirstName("John"); for (Person person: persons) System.out.println(" >>> " + person); Cache.Entry<Long, Person> topPerson = repo.findTopByLastNameLike("Smith"); System.out.println("\n>>> Top Person with surname 'Smith': " + topPerson.getValue()); List<Long> ids = repo.selectId(1000L, new PageRequest(0, 4)); System.out.println("\n>>> Persons working for organization with ID > 1000: "); for (Long id: ids) System.out.println(" >>> [id=" + id + "]"); }</code><technical_language>update this value? reflect below</technical_language>

Target:
private static void queryRepository() { System.out.println("\n>>> Persons with name 'John':"); List<Person> persons = repo.findByFirstName("John"); for (Person person : persons) System.out.println(" >>> " + person); Cache.Entry<Long, Person> topPerson = repo.findTopByLastNameLike("Smith"); System.out.println("\n>>> Top Person with surname 'Smith': " + topPerson.getValue()); List<Long> ids = repo.selectId(1000L, new PageRequest(0, 4)); System.out.println("\n>>> Persons working for organization with ID > 1000: "); for (Long id: ids) System.out.println(" >>> [id=" + id + "]"); }
Source:
<code>public MethodSource<JavaInterfaceSource> setAbstract(boolean abstrct) { if (abstrct) { <START> modifiers.addModifier(method, ModifierKeyword.ABSTRACT_KEYWORD); <END> return this; } else { throw new IllegalStateException("Method interface should be 'abstract'"); } }</code><technical_language>Call super.setAbstract here? This avoid modifiers attribute declared protected</technical_language>

Target:
public MethodSource<JavaInterfaceSource> setAbstract(boolean abstrct) { if (abstrct) { return super.setAbstract(abstrct); } else { throw new IllegalStateException("Method interface should be 'abstract'"); } }
Source:
<code>public void testImportBreakpointsWithMissingProject() { contextManager.activateContext("contextWithBreakpoints"); IInteractionContext testContext = contextManager.getActiveContext(); List<IBreakpoint> breakpoints = BreakpointsContextUtil.importBreakpoints(testContext); <START> assertTrue(breakpoints.size() == 0); <END> }</code><technical_language>assertEquals(Collections.emptyList(), ...). error more meaningful in case of assertion failure</technical_language>

Target:
public void testImportBreakpointsWithMissingProject() { contextManager.activateContext("contextWithBreakpoints"); IInteractionContext testContext = contextManager.getActiveContext(); List<IBreakpoint> breakpoints = BreakpointsContextUtil.importBreakpoints(testContext, null); assertEquals(Collections.emptyList(), breakpoints); }
Source:
<code>public void write(Object object) throws IOException { if (object == null) { return; } successfulWrites.clear(); inputRecord = (IndexedRecord) object; result.totalCount++; result.apiCalls++; if (inputSchema == null) { inputSchema = inputRecord.getSchema(); } if (isDynamic) { <START> adaptSchemaToDynamic(); <END> } Object lkv = inputRecord.get(inputSchema.getField(properties.leadKeyValues.getValue()).pos()); properties.leadKeyValues.setValue(lkv.toString()); MarketoRecordResult result = client.getMultipleLeads(properties, null); if (!result.isSuccess()) { if (dieOnError) { throw new IOException(result.getErrorsString()); } LOG.error(result.getErrors().toString()); } for (IndexedRecord record : result.getRecords()) { if (record != null) { this.result.successCount++; successfulWrites.add(record); } } }</code><technical_language>call adaptSchemaToDynamic for record ? I reduce efficiency</technical_language>

Target:
public void write(Object object) throws IOException { if (object == null) { return; } successfulWrites.clear(); inputRecord = (IndexedRecord) object; result.totalCount++; result.apiCalls++; if (inputSchema == null) { inputSchema = inputRecord.getSchema(); if (isDynamic) { adaptSchemaToDynamic(); } } Object lkv = inputRecord.get(inputSchema.getField(properties.leadKeyValues.getValue()).pos()); properties.leadKeyValues.setValue(lkv.toString()); MarketoRecordResult result = client.getMultipleLeads(properties, null); if (!result.isSuccess()) { if (dieOnError) { throw new IOException(result.getErrorsString()); } LOG.error(result.getErrors().toString()); } for (IndexedRecord record : result.getRecords()) { if (record != null) { this.result.successCount++; successfulWrites.add(record); } } }
Source:
<code>public void testCreateTransformer() { RtfQueryResponseAndMetacardTransformer transformer = createTransformer(); assertThat("Transformer cannot be null", transformer, notNullValue()); <START> } <END></code><technical_language>of this test? Moreover, I need assert transformer is non-null in test</technical_language>

Target:
public void testCreateTransformer() throws MimeTypeParseException { RtfQueryResponseAndMetacardTransformer transformer = createTransformer(); assertThat("Transformer cannot be null", transformer, notNullValue()); }
Source:
<code>public SensorSample(final DateTime dateTime, final float val, final int timeZoneOffset) { this.dateTime = dateTime; this.val = val; this.timeZoneOffset = timeZoneOffset; <START> this.id = null; <END> }</code><technical_language>Please Optional if a missing. null values lead lots of NullPointerExceptions</technical_language>

Target:
public SensorSample(final DateTime dateTime, final float val, final int timeZoneOffset) { this.dateTime = dateTime; this.val = val; this.timeZoneOffset = timeZoneOffset; }
Source:
<code>public void toggleUseJournalStore() throws IOException, InterruptedException { try { editCheckboxAndVerify(address, USE_JOURNAL_STORE, USE_JOURNAL_STORE_ATTR, false); Console.withBrowser(browser).dismissReloadRequiredWindowIfPresent(); editCheckboxAndVerify(address, USE_JOURNAL_STORE, USE_JOURNAL_STORE_ATTR, true); } finally { dispatcher.execute(new Operation.Builder("write-attribute", address) .param("name", USE_JOURNAL_STORE) .param("value", false) .build()); <START> } <END> }</code><technical_language>creaper. dispatcher deprecated moving creaper</technical_language>

Target:
public void toggleUseJournalStore() throws Exception { ModelNode value = operations.readAttribute(TRANSACTIONS_ADDRESS, USE_JOURNAL_STORE_ATTR); try { page.getConfigFragment().editCheckboxAndSave(USE_JOURNAL_STORE_ATTR, true); new ResourceVerifier(TRANSACTIONS_ADDRESS, client).verifyAttribute(USE_JOURNAL_STORE_ATTR, true); Console.withBrowser(browser).dismissReloadRequiredWindowIfPresent(); page.getConfigFragment().editCheckboxAndSave(USE_JOURNAL_STORE_ATTR, false); new ResourceVerifier(TRANSACTIONS_ADDRESS, client).verifyAttribute(USE_JOURNAL_STORE_ATTR, false); } finally { operations.writeAttribute(TRANSACTIONS_ADDRESS, USE_JOURNAL_STORE_ATTR, value); } }
Source:
<code>public Utf8OutputStreamWriter(final OutputStream output) { <START> super(output, Charset.forName(Utf8OutputStreamWriter.ENCODING)); <END> }</code><technical_language>@dalifreire StandardCharsets.UTF_8</technical_language>

Target:
public Utf8OutputStreamWriter(final OutputStream output) { super(output, StandardCharsets.UTF_8); }
Source:
<code>private void configureEnrollButton() { try { List<EnrolledCoursesResponse> enrolledCoursesResponse = executeStrict(courseApi.getEnrolledCoursesFromCache()); for (EnrolledCoursesResponse course : enrolledCoursesResponse) { if (course.getCourse().getId().equals(courseDetail.course_id)) { mEnrolled = true; } } } catch (Exception ex) { logger.debug("Unable to get cached enrollments list"); } if (mEnrolled) { mEnrollButton.setText(R.string.view_course_button_text); <START> } else if (courseDetail.invitation_only){ <END> mEnrollButton.setText(R.string.invitation_only_button_text); mEnrollButton.setBackgroundColor(getResources().getColor(R.color.edx_brand_gray_back)); mEnrollButton.setEnabled(false); } else { mEnrollButton.setText(R.string.enroll_now_button_text); } mEnrollButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (!mEnrolled) { enrollInCourse(); } else { openCourseDashboard(); } } }); }</code><technical_language>Nit: fix spacing ) {</technical_language>

Target:
private void configureEnrollButton() { try { List<EnrolledCoursesResponse> enrolledCoursesResponse = executeStrict(courseApi.getEnrolledCoursesFromCache()); for (EnrolledCoursesResponse course : enrolledCoursesResponse) { if (course.getCourse().getId().equals(courseDetail.course_id)) { mEnrolled = true; } } } catch (Exception ex) { logger.debug("Unable to get cached enrollments list"); } if (mEnrolled) { mEnrollButton.setText(R.string.view_course_button_text); } else if (courseDetail.invitation_only != null && courseDetail.invitation_only) { mEnrollButton.setText(R.string.invitation_only_button_text); mEnrollButton.setEnabled(false); } else { mEnrollButton.setText(R.string.enroll_now_button_text); } mEnrollButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (!mEnrolled) { enrollInCourse(); } else { openCourseDashboard(); } } }); }
Source:
<code>public Set<Event> updateDeviceState(long deviceId) { DeviceState deviceState = Context.getDeviceManager().getDeviceState(deviceId); Set<Event> result = new HashSet<>(); Event event = MotionEventHandler.updateMotionState(deviceState, tripsConfig); if (event != null) { result.add(event); } event = OverspeedEventHandler.updateOverspeedState(deviceState, Context.getDeviceManager(). <START> lookupAttributeDouble(deviceId, OverspeedEventHandler.ATTRIBUTE_SPEED_LIMIT, 0, false), <END> minimalOverspeedDuration, overspeedNotRepeat); if (event != null) { result.add(event); } return result; }</code><technical_language>Another I noticed is is a mess attributes. place. Some here, some in event handler. OverspeedEventHandler a singleton do there, instead of duplication everywhere? solution. I need time right</technical_language>

Target:
public Set<Event> updateDeviceState(long deviceId) { DeviceState deviceState = Context.getDeviceManager().getDeviceState(deviceId); Set<Event> result = new HashSet<>(); Event event = Context.getMotionEventHandler().updateMotionState(deviceState); if (event != null) { result.add(event); } event = Context.getOverspeedEventHandler().updateOverspeedState(deviceState, Context.getDeviceManager(). lookupAttributeDouble(deviceId, OverspeedEventHandler.ATTRIBUTE_SPEED_LIMIT, 0, false)); if (event != null) { result.add(event); } return result; }
Source:
<code>public boolean doLocalClear(PartitionedRegion region) throws ForceReattemptException { BucketRegion bucketRegion = region.getDataStore().getInitializedBucketForId(null, this.bucketId); boolean lockedForPrimary = bucketRegion.doLockForPrimary(false); if (!lockedForPrimary) { throw new ForceReattemptException(BUCKET_NON_PRIMARY_MESSAGE); } try { <START> RegionEventImpl regionEvent = new RegionEventImpl(); <END> regionEvent.setOperation(Operation.REGION_CLEAR); regionEvent.setRegion(bucketRegion); bucketRegion.cmnClearRegion(regionEvent, true, true); } catch (PartitionOfflineException poe) { logger.info("There is no member to hold bukcet {}, not to retry any more", this.bucketId, poe); throw poe; } catch (Exception ex) { throw new ForceReattemptException( EXCEPTION_THROWN_DURING_CLEAR_OPERATION + ex.getClass().getName(), ex); } finally { bucketRegion.doUnlockForPrimary(); } return true; }</code><technical_language>other non-zero-argument constructor of RegionEventImpl? setters in next lines. Is concern of side effect</technical_language>

Target:
public boolean doLocalClear(PartitionedRegion region) throws ForceReattemptException { BucketRegion bucketRegion = region.getDataStore().getInitializedBucketForId(null, this.bucketId); boolean lockedForPrimary = bucketRegion.doLockForPrimary(false); if (!lockedForPrimary) { throw new ForceReattemptException(BUCKET_NON_PRIMARY_MESSAGE); } try { RegionEventImpl regionEvent = new RegionEventImpl(); regionEvent.setOperation(Operation.REGION_CLEAR); regionEvent.setRegion(bucketRegion); bucketRegion.cmnClearRegion(regionEvent, true, true); } catch (PartitionOfflineException poe) { logger.info( "All members holding data for bucket are offline, no more retries will be attempted", this.bucketId, poe); throw poe; } catch (Exception ex) { throw new ForceReattemptException( EXCEPTION_THROWN_DURING_CLEAR_OPERATION + ex.getClass().getName(), ex); } finally { bucketRegion.doUnlockForPrimary(); } return true; }
Source:
<code>private void checkCycle(List<ResolverBundle> cycle) { int cycleSize = cycle.size(); if (cycleSize == 0) return; cycleLoop: <START> for (Iterator<ResolverBundle> iCycle = cycle.iterator(); iCycle.hasNext();) <END> { ResolverBundle cycleBundle = iCycle.next(); if (!cycleBundle.isResolvable()) { iCycle.remove(); continue cycleLoop; } ResolverImport[] imports = cycleBundle.getImportPackages(); for (ResolverImport import1 : imports) { while (import1.getSelectedSupplier() != null) { ResolverExport importSupplier = (ResolverExport) import1.getSelectedSupplier(); if (importSupplier.getSubstitute() != null) { import1.selectNextSupplier(); } else { break; } } if (!import1.isDynamic() && !import1.isOptional() && import1.getSelectedSupplier() == null) { cycleBundle.setResolvable(false); state.addResolverError(import1.getVersionConstraint().getBundle(), ResolverError.MISSING_IMPORT_PACKAGE, import1.getVersionConstraint().toString(), import1.getVersionConstraint()); iCycle.remove(); continue cycleLoop; } } } if (cycle.size() != cycleSize) { for (int i = 0; i < cycle.size(); i++) { ResolverBundle cycleBundle = cycle.get(i); cycleBundle.clearWires(); } List<ResolverBundle> innerCycle = new ArrayList<>(cycle.size()); for (int i = 0; i < cycle.size(); i++) resolveBundle(cycle.get(i), innerCycle); checkCycle(innerCycle); } else { for (int i = 0; i < cycle.size(); i++) { if (DEBUG || DEBUG_CYCLES) ResolverImpl.log("Pushing " + cycle.get(i) + " to RESOLVED"); setBundleResolved(cycle.get(i)); } } }</code><technical_language>missed a loop here</technical_language>

Target:
private void checkCycle(List<ResolverBundle> cycle) { int cycleSize = cycle.size(); if (cycleSize == 0) return; cycleLoop: for (Iterator<ResolverBundle> iCycle = cycle.iterator(); iCycle.hasNext();) { ResolverBundle cycleBundle = iCycle.next(); if (!cycleBundle.isResolvable()) { iCycle.remove(); continue cycleLoop; } ResolverImport[] imports = cycleBundle.getImportPackages(); for (ResolverImport resolverImport : imports) { while (resolverImport.getSelectedSupplier() != null) { ResolverExport importSupplier = (ResolverExport) resolverImport.getSelectedSupplier(); if (importSupplier.getSubstitute() != null) { resolverImport.selectNextSupplier(); } else { break; } } if (!resolverImport.isDynamic() && !resolverImport.isOptional() && resolverImport.getSelectedSupplier() == null) { cycleBundle.setResolvable(false); state.addResolverError(resolverImport.getVersionConstraint().getBundle(), ResolverError.MISSING_IMPORT_PACKAGE, resolverImport.getVersionConstraint().toString(), resolverImport.getVersionConstraint()); iCycle.remove(); continue cycleLoop; } } } if (cycle.size() != cycleSize) { for (int i = 0; i < cycle.size(); i++) { ResolverBundle cycleBundle = cycle.get(i); cycleBundle.clearWires(); } List<ResolverBundle> innerCycle = new ArrayList<>(cycle.size()); for (int i = 0; i < cycle.size(); i++) resolveBundle(cycle.get(i), innerCycle); checkCycle(innerCycle); } else { for (int i = 0; i < cycle.size(); i++) { if (DEBUG || DEBUG_CYCLES) ResolverImpl.log("Pushing " + cycle.get(i) + " to RESOLVED"); setBundleResolved(cycle.get(i)); } } }
Source:
<code>public void findAllByScChamberId_FOUND() { <START> List<SupremeCourtChamberDivision> scChamberDivisions = scChamberDivisionRepository.findAllByScChamberId(division1.getId()); <END> assertEquals(1, scChamberDivisions.size()); assertEquals(division1.getScChamber().getId(), scChamberDivisions.get(0).getId()); }</code><technical_language>J) chamberId instead of divisionId. is coincidence divisionId is equal chamberId</technical_language>

Target:
public void findAllByScChamberId_FOUND() { List<SupremeCourtChamberDivision> scChamberDivisions = scChamberDivisionRepository.findAllByScChamberId(chamberOne.getId()); assertEquals(1, scChamberDivisions.size()); assertEquals(chamberDivisionOne.getId(), scChamberDivisions.get(0).getId()); }
Source:
<code>public B setWaitTillVerify(int waitPeriod) { <START> _coolDown = waitPeriod; <END> return (B) this; }</code><technical_language>call "waitPeriodTillVerify. Cooldown is obvious name</technical_language>

Target:
public B setWaitTillVerify(int waitPeriod) { _waitPeriodTillVerify = waitPeriod; return (B) this; }
Source:
<code>public boolean filter(ApplicationDTO application) { boolean result = true; if (filterCategory.isPresent()) { result &= filterCategory.get().getApplications().contains(application); } if (!containCommercialApplications.getValue()) { result &= application.getScripts().stream().anyMatch(script -> script.isFree()); } if (containRequiresPatchApplications.getValue()) { result &= application.getScripts().stream().anyMatch(script -> !script.isRequiresPatch()); } if (!containTestingApplications.getValue()) { result &= application.getScripts().stream() .anyMatch(script -> CollectionUtils.isEmpty(script.getTestingOperatingSystems())); } if (!containAllOSCompatibleApplications.getValue()) { result &= application.getScripts().stream() .anyMatch(script -> script.getCompatibleOperatingSystems() <START> .contains(operatingSystemFetcher.fetchCurrentOperationSystem())); <END> } return result && filterTextMatcher.test(filterText.getValue(), application); }</code><technical_language>I guess this crash if getCompatibleOperatingSystems() returns null</technical_language>

Target:
public boolean filter(ApplicationDTO application) { boolean result = true; if (filterCategory.isPresent()) { result &= filterCategory.get().getApplications().contains(application); } if (!containCommercialApplications.getValue()) { result &= application.getScripts().stream().anyMatch(script -> script.isFree()); } if (containRequiresPatchApplications.getValue()) { result &= application.getScripts().stream().anyMatch(script -> !script.isRequiresPatch()); } if (!containTestingApplications.getValue()) { result &= application.getScripts().stream() .anyMatch(script -> CollectionUtils.isEmpty(script.getTestingOperatingSystems())); } if (!containAllOSCompatibleApplications.getValue()) { result &= application.getScripts().stream() .filter(script -> !CollectionUtils.isEmpty(script.getCompatibleOperatingSystems())) .anyMatch(script -> script.getCompatibleOperatingSystems() .contains(operatingSystemFetcher.fetchCurrentOperationSystem())); } return result && filterTextMatcher.test(filterText.getValue(), application); }
Source:
<code>public void testInitialize() throws Exception{ CloudBigtableIO.initializeForSink(underTest); checkRegistry(Put.class); checkRegistry(Delete.class); checkRegistry(Mutation.class); try { registry.getCoder(TypeDescriptor.of(Append.class)); <START> Assert.fail("Appends should not have Coders"); <END> } catch (CannotProvideCoderException expected) { } try { registry.getCoder(TypeDescriptor.of(Increment.class)); fail("Increments should not have Coders"); } catch (CannotProvideCoderException expected) { } CloudBigtableIO.Sink sink = new CloudBigtableIO.Sink(config); sink.validate(cbtOptions); sink.createWriteOperation(null).createWriter(null); }</code><technical_language>Prefer smaller tests @Rule ExpectedException for verifying exceptions</technical_language>

Target:
public void testInitialize() throws Exception{ checkRegistry(Put.class); checkRegistry(Delete.class); checkRegistry(Mutation.class); CloudBigtableIO.CloudBigtableWriteTransform writeTransform = (CloudBigtableIO.CloudBigtableWriteTransform) CloudBigtableIO.writeToTable(config); writeTransform.validate(null); }
Source:
<code>public static String formatClanChat(ClanPlayer cp, String msg, Map<String, String> placeholders) { SettingsManager sm = SimpleClans.getInstance().getSettingsManager(); String leaderColor = sm.getClanChatLeaderColor(); String memberColor = sm.getClanChatMemberColor(); String rank = cp.getRank().isEmpty() ? null : ChatColor.translateAlternateColorCodes('&', cp.getRank()); String rankFormat = rank != null ? ChatColor.translateAlternateColorCodes('&', sm.getClanChatRank()).replaceAll("%rank%", rank) : ""; String message = ChatColor.translateAlternateColorCodes('&', sm.getClanChatFormat()) .replaceAll("%clan%", cp.getClan().getColorTag()) .replaceAll("%nick-color%", (cp.isLeader() ? leaderColor : memberColor)) .replaceAll("%player%", cp.getName()) .replaceAll("%rank%", rankFormat) <START> .replaceAll("%message%", Matcher.quoteReplacement(msg)); <END> if (placeholders != null) { for (Entry<String, String> e : placeholders.entrySet()) { message = message.replaceAll("%"+e.getKey()+"%", e.getValue()); } } return message; }</code><technical_language>regex desired, method is replace() replaceAll(). This negate need do Matcher.quoteReplacement()</technical_language>

Target:
public static String formatClanChat(ClanPlayer cp, String msg, Map<String, String> placeholders) { SettingsManager sm = SimpleClans.getInstance().getSettingsManager(); String leaderColor = sm.getClanChatLeaderColor(); String memberColor = sm.getClanChatMemberColor(); String rank = cp.getRank().isEmpty() ? null : ChatColor.translateAlternateColorCodes('&', cp.getRank()); String rankFormat = rank != null ? ChatColor.translateAlternateColorCodes('&', sm.getClanChatRank()).replaceAll("%rank%", rank) : ""; String message = replacePlaceholders(sm, cp, leaderColor, memberColor, rankFormat, msg); if (placeholders != null) { for (Entry<String, String> e : placeholders.entrySet()) { message = message.replaceAll("%"+e.getKey()+"%", e.getValue()); } } return message; }
Source:
<code>public void rejectMessage() { if (!isAcknowledgementSent) { try { channel.basicReject(deliveryTag, isRequeueRejectedMessages); <START> LOG.error(String.format("[consumer tag: %s] AMQP reject has been sent for message: %s", consumerTag, bodyStr)); <END> isAcknowledgementSent = true; } catch (Exception e) { LOG.error(String.format("[consumer tag: %s] Got exception:", consumerTag), e); } } else { LOG.warn(ACK_WAS_ALREADY_SENT); } }</code><technical_language>Please consider "debug" message reject is a valid option of a client</technical_language>

Target:
public void rejectMessage() { executeAck("reject", () -> { channel.basicReject(deliveryTag, false); LOG.debug(String.format("[consumer tag: %s] A message was discarded", consumerTag)); }); }
Source:
<code>protected void onPushReceive(Context context, Intent intent) { JSONObject pushData = null; try { String pushDataStr = intent.getStringExtra(KEY_PUSH_DATA); <START> PLog.v(TAG, pushDataStr); <END> pushData = new JSONObject(pushDataStr); } catch (JSONException e) { PLog.e(TAG, "Unexpected JSONException when receiving push data: ", e); } String action = null; if (pushData != null) { action = pushData.optString("action", null); } if (action != null) { Bundle extras = intent.getExtras(); Intent broadcastIntent = new Intent(); broadcastIntent.putExtras(extras); broadcastIntent.setAction(action); broadcastIntent.setPackage(context.getPackageName()); context.sendBroadcast(broadcastIntent); } Notification notification = getNotification(context, intent); if (notification != null) { ParseNotificationManager.getInstance().showNotification(context, notification); } }</code><technical_language>fine. similar .NET</technical_language>

Target:
protected void onPushReceive(Context context, Intent intent) { String pushDataStr = intent.getStringExtra(KEY_PUSH_DATA); if (pushDataStr == null) { PLog.e(TAG, "Can not get push data from intent."); return; } PLog.v(TAG, "Received push data: " + pushDataStr); JSONObject pushData = null; try { pushData = new JSONObject(pushDataStr); } catch (JSONException e) { PLog.e(TAG, "Unexpected JSONException when receiving push data: ", e); } String action = null; if (pushData != null) { action = pushData.optString("action", null); } if (action != null) { Bundle extras = intent.getExtras(); Intent broadcastIntent = new Intent(); broadcastIntent.putExtras(extras); broadcastIntent.setAction(action); broadcastIntent.setPackage(context.getPackageName()); context.sendBroadcast(broadcastIntent); } Notification notification = getNotification(context, intent); if (notification != null) { ParseNotificationManager.getInstance().showNotification(context, notification); } }
Source:
<code>protected TupleBatch fetchNextReady() throws Exception { if (!computedSamplingInfo) { TupleBatch tb = getLeft().nextReady(); if (tb == null) return null; extractSamplingInfo(tb); getLeft().close(); if (sampleType.equals("WoR")) { Preconditions.checkState(sampleSize <= streamSize, "Cannot SampleWoR %s tuples from a population of size %s", sampleSize, streamSize); } if (sampleType.equals("WR")) { samples = generateIndicesWR(streamSize, sampleSize); } else if (sampleType.equals("WoR")) { samples = generateIndicesWoR(streamSize, sampleSize); } else { throw new DbException("Invalid sampleType: " + sampleType); } computedSamplingInfo = true; } TupleBatch nexttb = ans.popAny(); if (nexttb != null) { return nexttb; } if (curSampIdx >= samples.length) { getRight().close(); <START> setEOS(); <END> return null; } Operator right = getRight(); for (TupleBatch tb = right.nextReady(); tb != null; tb = right.nextReady()) { if (curSampIdx >= samples.length) { break; } if (samples[curSampIdx] > tupleNum + tb.numTuples()) { tupleNum += tb.numTuples(); continue; } while (curSampIdx < samples.length && samples[curSampIdx] < tupleNum + tb.numTuples()) { ans.put(tb, samples[curSampIdx] - tupleNum); curSampIdx++; } tupleNum += tb.numTuples(); if (ans.hasFilledTB()) { return ans.popFilled(); } } return ans.popAny(); }</code><technical_language>This unnecessary if children closed</technical_language>

Target:
protected TupleBatch fetchNextReady() throws Exception { if (!computedSamplingInfo) { TupleBatch tb = getLeft().nextReady(); if (tb == null) { return null; } extractSamplingInfo(tb); getLeft().close(); if (sampleType == SamplingType.WithoutReplacement) { Preconditions.checkState(sampleSize <= streamSize, "Cannot SampleWoR %s tuples from a population of size %s", sampleSize, streamSize); } if (sampleType == SamplingType.WithReplacement) { sampleIndices = generateIndicesWR(streamSize, sampleSize); } else if (sampleType == SamplingType.WithoutReplacement) { sampleIndices = generateIndicesWoR(streamSize, sampleSize); } else { throw new DbException("Invalid sampleType: " + sampleType); } computedSamplingInfo = true; } TupleBatch nexttb = ans.popAny(); if (nexttb != null) { return nexttb; } if (curSampIdx >= sampleIndices.length) { getRight().close(); return null; } Operator right = getRight(); for (TupleBatch tb = right.nextReady(); tb != null; tb = right.nextReady()) { if (curSampIdx >= sampleIndices.length) { break; } if (sampleIndices[curSampIdx] >= tuplesSeen + tb.numTuples()) { tuplesSeen += tb.numTuples(); continue; } while (curSampIdx < sampleIndices.length && sampleIndices[curSampIdx] < tuplesSeen + tb.numTuples()) { ans.put(tb, sampleIndices[curSampIdx] - tuplesSeen); curSampIdx++; } tuplesSeen += tb.numTuples(); if (ans.hasFilledTB()) { return ans.popFilled(); } } return ans.popAny(); }
Source:
<code>public void testValuesWithNonTrivialType() { <START> MaterializedResult actual = computeActual("VALUES (0.0/CAST(0.0 AS DOUBLE), 1.0/CAST(0.0 AS DOUBLE), -1.0/CAST(0.0 AS DOUBLE))"); <END> List<MaterializedRow> rows = actual.getMaterializedRows(); assertEquals(rows.size(), 1); MaterializedRow row = rows.get(0); assertTrue(((Double) row.getField(0)).isNaN()); assertEquals(row.getField(1), Double.POSITIVE_INFINITY); assertEquals(row.getField(2), Double.NEGATIVE_INFINITY); }</code><technical_language>0E0</technical_language>

Target:
public void testValuesWithNonTrivialType() { MaterializedResult actual = computeActual("VALUES (0E0/0E0, 1E0/0E0, -1E0/0E0)"); List<MaterializedRow> rows = actual.getMaterializedRows(); assertEquals(rows.size(), 1); MaterializedRow row = rows.get(0); assertTrue(((Double) row.getField(0)).isNaN()); assertEquals(row.getField(1), Double.POSITIVE_INFINITY); assertEquals(row.getField(2), Double.NEGATIVE_INFINITY); }
Source:
<code>private void populateGroupLabels(List<String> finalLabels, List<String> matchedLabels, Optional<String> suggestion) { Map<String, FlowPane> groupContent = getGroupContent(finalLabels, matchedLabels, suggestion); <START> groupContent.entrySet().stream().forEach(entry -> { <END> feedbackLabels.getChildren().addAll( createGroupTitle(entry.getKey()), entry.getValue()); }); }</code><technical_language>stream() is necessary here</technical_language>

Target:
private final void populateGroupLabels(List<String> finalLabels, List<String> matchedLabels, Optional<String> suggestion) { Map<String, FlowPane> groupContent = getGroupContent(finalLabels, matchedLabels, suggestion); groupContent.entrySet().forEach(entry -> { feedbackLabels.getChildren().addAll( createGroupTitle(entry.getKey()), entry.getValue()); }); }
Source:
<code><START> public void track(AnalyticsTracker.Stat stat, String category, String label, Map<String, ?> properties) { <END> if (mNosaraClient == null) { return; } String eventName = stat.name().toLowerCase(); final String user; final TracksClient.NosaraUserType userType; if (mUserName != null) { user = mUserName; userType = TracksClient.NosaraUserType.SIMPLENOTE; } else { if (getAnonID() == null) { user = generateNewAnonID(); } else { user = getAnonID(); } userType = TracksClient.NosaraUserType.ANON; } mNosaraClient.track(EVENTS_PREFIX + eventName, user, userType); }</code><technical_language>label is here</technical_language>

Target:
public void track(AnalyticsTracker.Stat stat, String category, String label, Map<String, ?> properties) { if (mNosaraClient == null) { return; } String eventName = stat.name().toLowerCase(); final String user; final TracksClient.NosaraUserType userType; if (mUserName != null) { user = mUserName; userType = TracksClient.NosaraUserType.SIMPLENOTE; } else { if (getAnonID() == null) { user = generateNewAnonID(); } else { user = getAnonID(); } userType = TracksClient.NosaraUserType.ANON; } if (properties != null) { JSONObject propertiesJson = new JSONObject(properties); mNosaraClient.track(EVENTS_PREFIX + eventName, propertiesJson, user, userType); } else { mNosaraClient.track(EVENTS_PREFIX + eventName, user, userType); } }
Source:
<code>public OpenAPI addServer(Server server) { <START> if (server != null) { if (servers == null) { servers = createList(); } if (server.getUrl() != null) { for (Server existingServer : getServers()) { if (server.getUrl().equals(existingServer.getUrl())) { ModelUtils.merge(server, existingServer, true); return this; } } } servers.add(server); } <END> return this; }</code><technical_language>suggestion if (server == null || server.getUrl() == null)) { return this; } if (servers == null) { servers = createList(); } for (Server existingServer : getServers()) { // If a server URL is found, merge if (server.getUrl().equals(existingServer.getUrl())) { ModelUtils.merge(server, existingServer, true); return this; } } // If a server URL exist, create servers.add(server); reduces complexity</technical_language>

Target:
public OpenAPI addServer(Server server) { if (server == null) { return this; } final String serverUrl = server.getUrl(); if (serverUrl == null) { return this; } if (servers == null) { servers = createList(); } for (Server existingServer : getServers()) { if (serverUrl.equals(existingServer.getUrl())) { ModelUtils.merge(server, existingServer, true); return this; } } servers.add(server); return this; }
Source:
<code>private String getDeviceIpAddressFromSessionProvider(final DlmsDevice dlmsDevice) throws ProtocolAdapterException, FunctionalException { final SessionProvider sessionProvider = this.sessionProviderService .getSessionProvider(dlmsDevice.getCommunicationProvider()); String deviceIpAddress = null; try { deviceIpAddress = sessionProvider.getIpAddress(dlmsDevice.getIccId()); if (deviceIpAddress != null) { return deviceIpAddress; } this.jasperWirelessSmsClient.sendWakeUpSMS(dlmsDevice.getIccId()); deviceIpAddress = this.pollForSession(sessionProvider, dlmsDevice); } catch (final SessionProviderException e) { LOGGER.error("Invalid key format exception", e); throw new FunctionalException(FunctionalExceptionType.INVALID_KEY_FORMAT, ComponentType.PROTOCOL_DLMS, e); } if ((deviceIpAddress == null) || "".equals(deviceIpAddress)) { <START> throw new ProtocolAdapterException("Session provider: " + dlmsDevice.getCommunicationProvider() <END> + " did not return an IP address for device: " + dlmsDevice.getDeviceIdentification() + "and iccId: " + dlmsDevice.getIccId()); } return deviceIpAddress; }</code><technical_language>throw a FunctionalException !</technical_language>

Target:
private String getDeviceIpAddressFromSessionProvider(final DlmsDevice dlmsDevice) throws ProtocolAdapterException, FunctionalException { final SessionProvider sessionProvider = this.sessionProviderService .getSessionProvider(dlmsDevice.getCommunicationProvider()); String deviceIpAddress = null; try { deviceIpAddress = sessionProvider.getIpAddress(dlmsDevice.getIccId()); if (deviceIpAddress != null) { return deviceIpAddress; } this.jasperWirelessSmsClient.sendWakeUpSMS(dlmsDevice.getIccId()); deviceIpAddress = this.pollForSession(sessionProvider, dlmsDevice); } catch (final SessionProviderException e) { LOGGER.error("Invalid key format exception", e); throw new FunctionalException(FunctionalExceptionType.INVALID_DLMS_KEY_FORMAT, ComponentType.PROTOCOL_DLMS, e); } if ((deviceIpAddress == null) || "".equals(deviceIpAddress)) { throw new ProtocolAdapterException("Session provider: " + dlmsDevice.getCommunicationProvider() + " did not return an IP address for device: " + dlmsDevice.getDeviceIdentification() + "and iccId: " + dlmsDevice.getIccId()); } return deviceIpAddress; }
Source:
<code>public void close() throws IOException { <START> commitMarkerCodec.close(); <END> }</code><technical_language>need close reader here, right</technical_language>

Target:
public void close() throws IOException { if (closed) { return; } try { commitMarkerCodec.close(); } finally { reader.close(); closed = true; } }
Source:
<code>private FileformatInterface readDocument(Process process, DigitalDocumentInterface newFile) { FileformatInterface gdzfile; try { switch (MetadataFormat.findFileFormatsHelperByName(process.getProject().getFileFormatDmsExport())) { case METS: gdzfile = UghImplementation.INSTANCE.createMetsModsImportExport(this.myPrefs); break; case METS_AND_RDF: default: gdzfile = UghImplementation.INSTANCE.createRDFFile(this.myPrefs); break; } gdzfile.setDigitalDocument(newFile); return gdzfile; } catch (Exception e) { if (exportDmsTask != null) { exportDmsTask.setException(e); } else { <START> logger.error(e.getMessage(), e); <END> Helper.setFehlerMeldung(Helper.getTranslation("exportError") + process.getTitle(), e); } logger.error("Export abgebrochen, xml-LeseFehler", e); return null; } }</code><technical_language>setErrorMessage</technical_language>

Target:
private FileformatInterface readDocument(Process process, DigitalDocumentInterface newFile) { FileformatInterface gdzfile; try { switch (MetadataFormat.findFileFormatsHelperByName(process.getProject().getFileFormatDmsExport())) { case METS: gdzfile = UghImplementation.INSTANCE.createMetsModsImportExport(this.myPrefs); break; case METS_AND_RDF: default: gdzfile = UghImplementation.INSTANCE.createRDFFile(this.myPrefs); break; } gdzfile.setDigitalDocument(newFile); return gdzfile; } catch (PreferencesException | RuntimeException e) { if (exportDmsTask != null) { exportDmsTask.setException(e); logger.error("Export abgebrochen, xml-LeseFehler", e); } else { Helper.setErrorMessage(Helper.getTranslation("exportError") + process.getTitle(), logger, e); } return null; } }
Source:
<code>public void onFetchClicked() { final String remoteUrl = view.getRepositoryUrl(); final StatusNotification notification = notificationManager.notify(constant.fetchProcess(), PROGRESS, FLOAT_MODE); final GitOutputConsole console = gitOutputConsoleFactory.create(FETCH_COMMAND_NAME); service .fetch( project.getLocation(), view.getRepositoryName(), getRefs(), view.isRemoveDeletedRefs()) .then( ignored -> { console.print(constant.fetchSuccess(remoteUrl)); processesPanelPresenter.addCommandOutput(console); notification.setStatus(SUCCESS); notification.setTitle(constant.fetchSuccess(remoteUrl)); }) .catchError( error -> { <START> if (getErrorCode(error.getCause()) == UNAUTHORIZED_GIT_OPERATION) { <END> Map<String, String> attributes = getAttributes(error.getCause()); String providerName = attributes.get(PROVIDER_NAME); if (!StringUtils.isNullOrEmpty(providerName)) { fetchAuthenticated(providerName, remoteUrl, console, notification); return; } } handleError(error.getCause(), remoteUrl, notification, console); processesPanelPresenter.addCommandOutput(console); }); view.close(); }</code><technical_language>I code times. a method perform logic</technical_language>

Target:
public void onFetchClicked() { final String remoteUrl = view.getRepositoryUrl(); final StatusNotification notification = notificationManager.notify(locale.fetchProcess(), PROGRESS, FLOAT_MODE); final GitOutputConsole console = gitOutputConsoleFactory.create(FETCH_COMMAND_NAME); performOperationWithTokenRequestIfNeeded( new RemoteGitOperation<Void>() { @Override public Promise<Void> perform(Credentials credentials) { return service.fetch( project.getLocation(), view.getRepositoryName(), getRefs(), view.isRemoveDeletedRefs(), credentials); } }) .then( ignored -> { console.print(locale.fetchSuccess(remoteUrl)); processesPanelPresenter.addCommandOutput(console); notification.setStatus(SUCCESS); notification.setTitle(locale.fetchSuccess(remoteUrl)); }) .catchError( error -> { handleError(error.getCause(), remoteUrl, notification, console); processesPanelPresenter.addCommandOutput(console); }); view.close(); }
Source:
<code><START> public static <END> String composeObjectId(AuditLogableBase logable, AuditLogType logType, Guid userId) { final StringBuilder builder = new StringBuilder(); compose(builder, "type", logType.toString()); compose(builder, "sd", nullToEmptyString(logable.getStorageDomainId())); compose(builder, "dc", nullToEmptyString(logable.getStoragePoolId())); compose(builder, "user", nullToEmptyString(userId)); compose(builder, "cluster", logable.getClusterId().toString()); compose(builder, "vds", logable.getVdsId().toString()); compose(builder, "vm", emptyGuidToEmptyString(logable.getVmId())); compose(builder, "template", emptyGuidToEmptyString(logable.getVmTemplateId())); compose(builder, "customId", StringUtils.defaultString(logable.getCustomId())); return builder.toString(); }</code><technical_language>this method non-static private - clients other 2 exposed methods, else this :-)</technical_language>

Target:
private String composeObjectId(AuditLogableBase logable, AuditLogType logType, Guid userId) { final StringBuilder builder = new StringBuilder(); compose(builder, "type", logType.toString()); compose(builder, "sd", nullToEmptyString(logable.getStorageDomainId())); compose(builder, "dc", nullToEmptyString(logable.getStoragePoolId())); compose(builder, "user", nullToEmptyString(userId)); compose(builder, "cluster", logable.getClusterId().toString()); compose(builder, "vds", logable.getVdsId().toString()); compose(builder, "vm", emptyGuidToEmptyString(logable.getVmId())); compose(builder, "template", emptyGuidToEmptyString(logable.getVmTemplateId())); compose(builder, "customId", StringUtils.defaultString(logable.getCustomId())); return builder.toString(); }
Source:
<code>public @Nullable ITmfTrace openMinimalTrace(String projectName, String traceName, @ScriptParameter(defaultValue = "false") boolean isExperiment) throws FileNotFoundException { String path = getTracePath(projectName, traceName, isExperiment); IFile file = getFile(path); IPath location = file.getLocation(); if (location == null) { return null; } if (!file.exists() || !file.isAccessible()) { <START> throw new FileNotFoundException(ERROR_INIT); <END> } try { String traceFileName = location.toFile().getName(); return openAndInitializeTrace(file, Objects.requireNonNull(location.toOSString()), traceFileName, ""); } catch (InstantiationException | IllegalAccessException | TmfTraceException | TmfTraceImportException e) { throw new NullPointerException(e.toString()); } }</code><technical_language>Strangely enough, this throws exception here, if file exist..</technical_language>

Target:
public @Nullable ITmfTrace openMinimalTrace(String projectName, String traceName, @ScriptParameter(defaultValue = "false") boolean isExperiment) throws FileNotFoundException { String path = getTracePath(projectName, traceName, isExperiment); IFile file = getFile(path); IPath location = file.getLocation(); if (location == null) { return null; } if (!Paths.get(path).toFile().exists() && !location.toFile().exists()) { throw new FileNotFoundException(Messages.traceDeleted); } try { String traceFileName = location.toFile().getName(); return openAndInitializeTrace(file, Objects.requireNonNull(location.toOSString()), traceFileName, ""); } catch (InstantiationException | IllegalAccessException | TmfTraceException | TmfTraceImportException e) { throw new NullPointerException(e.toString()); } }