auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String getDosingType(DrugOrder drugOrder) { String dosingType = null; if (drugOrder.getDosingType() != null) { dosingType = drugOrder.getDosingType().getCanonicalName(); } return dosingType; }

Target:
public String getDosingType(DrugOrder drugOrder) { return (drugOrder.getDosingType() != null) ? drugOrder.getDosingType().getCanonicalName() : null; }
Source:
private <T, U> Map<T, U> getGuestTimeZone(){ Map resultMap = map(); resultMap.put("zone","Israel"); resultMap.put("offset", "120"); return resultMap; }

Target:
private Map<String, String> getGuestTimeZone(){ Map<String, String> resultMap = map(); resultMap.put("zone","Israel"); resultMap.put("offset", "120"); return resultMap; }
Source:
public void returnContext(DirContext context) { final ClassLoader oldClassLoader = setClassLoaderTo(targetClassLoader); try{ if (context == null) { return; } if (context instanceof InitialDirContext) { try { context.close(); log.debugf("Context [%s] was closed. Connection closed or just returned to the pool.", context); } catch (NamingException ignored) { } } }finally{ setClassLoaderTo(oldClassLoader); } }

Target:
public void returnContext(DirContext context) { if (context == null) { return; } if (context instanceof InitialDirContext) { final ClassLoader oldClassLoader = setClassLoaderTo(targetClassLoader); try { context.close(); log.debugf("Context [%s] was closed. Connection closed or just returned to the pool.", context); } catch (NamingException ignored) { } finally { setClassLoaderTo(oldClassLoader); } } }
Source:
public void testMultiThreadedShared() throws Exception { webClientFactory.activate(createConfigMap(10, 200, 60, 5, 10, 60)); 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(); }

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:
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) { result = 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; }

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:
public double price( ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, PriceType priceType, ReferenceData refData) { ArgChecker.notNull(cds, "cds"); 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(); }

Target:
public double price( ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, PriceType priceType, ReferenceData refData) { return price(cds, ratesProvider, cds.getFixedRate(), referenceDate, priceType, refData); }
Source:
public void readSpawnData(ByteBuf data) { type = GrenadeType.getGrenade(ByteBufUtils.readUTF8String(data)); { Entity ent = world.getEntityByID(data.readInt()); 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); }

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:
private static void queryRepository() { System.out.println("\n>>> Persons with name 'John' and 'Brad':"); 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 + "]"); }

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:
public MethodSource<JavaInterfaceSource> setAbstract(boolean abstrct) { if (abstrct) { modifiers.addModifier(method, ModifierKeyword.ABSTRACT_KEYWORD); return this; } else { throw new IllegalStateException("Method interface should be 'abstract'"); } }

Target:
public MethodSource<JavaInterfaceSource> setAbstract(boolean abstrct) { if (abstrct) { return super.setAbstract(abstrct); } else { throw new IllegalStateException("Method interface should be 'abstract'"); } }
Source:
public void testImportBreakpointsWithMissingProject() { contextManager.activateContext("contextWithBreakpoints"); IInteractionContext testContext = contextManager.getActiveContext(); List<IBreakpoint> breakpoints = BreakpointsContextUtil.importBreakpoints(testContext); assertTrue(breakpoints.size() == 0); }

Target:
public void testImportBreakpointsWithMissingProject() { contextManager.activateContext("contextWithBreakpoints"); IInteractionContext testContext = contextManager.getActiveContext(); List<IBreakpoint> breakpoints = BreakpointsContextUtil.importBreakpoints(testContext, null); assertEquals(Collections.emptyList(), breakpoints); }
Source:
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); } } }

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:
public void testCreateTransformer() { RtfQueryResponseAndMetacardTransformer transformer = createTransformer(); assertThat("Transformer cannot be null", transformer, notNullValue()); }

Target:
public void testCreateTransformer() throws MimeTypeParseException { RtfQueryResponseAndMetacardTransformer transformer = createTransformer(); assertThat("Transformer cannot be null", transformer, notNullValue()); }
Source:
public SensorSample(final DateTime dateTime, final float val, final int timeZoneOffset) { this.dateTime = dateTime; this.val = val; this.timeZoneOffset = timeZoneOffset; this.id = null; }

Target:
public SensorSample(final DateTime dateTime, final float val, final int timeZoneOffset) { this.dateTime = dateTime; this.val = val; this.timeZoneOffset = timeZoneOffset; }
Source:
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()); } }

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:
public Utf8OutputStreamWriter(final OutputStream output) { super(output, Charset.forName(Utf8OutputStreamWriter.ENCODING)); }

Target:
public Utf8OutputStreamWriter(final OutputStream output) { super(output, StandardCharsets.UTF_8); }
Source:
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){ 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(); } } }); }

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:
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(). lookupAttributeDouble(deviceId, OverspeedEventHandler.ATTRIBUTE_SPEED_LIMIT, 0, false), minimalOverspeedDuration, overspeedNotRepeat); if (event != null) { result.add(event); } return result; }

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:
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("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; }

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:
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 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)); } } }

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:
public void findAllByScChamberId_FOUND() { List<SupremeCourtChamberDivision> scChamberDivisions = scChamberDivisionRepository.findAllByScChamberId(division1.getId()); assertEquals(1, scChamberDivisions.size()); assertEquals(division1.getScChamber().getId(), scChamberDivisions.get(0).getId()); }

Target:
public void findAllByScChamberId_FOUND() { List<SupremeCourtChamberDivision> scChamberDivisions = scChamberDivisionRepository.findAllByScChamberId(chamberOne.getId()); assertEquals(1, scChamberDivisions.size()); assertEquals(chamberDivisionOne.getId(), scChamberDivisions.get(0).getId()); }
Source:
public B setWaitTillVerify(int waitPeriod) { _coolDown = waitPeriod; return (B) this; }

Target:
public B setWaitTillVerify(int waitPeriod) { _waitPeriodTillVerify = waitPeriod; return (B) this; }
Source:
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() .contains(operatingSystemFetcher.fetchCurrentOperationSystem())); } return result && filterTextMatcher.test(filterText.getValue(), application); }

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:
public void testInitialize() throws Exception{ CloudBigtableIO.initializeForSink(underTest); checkRegistry(Put.class); checkRegistry(Delete.class); checkRegistry(Mutation.class); try { registry.getCoder(TypeDescriptor.of(Append.class)); Assert.fail("Appends should not have Coders"); } 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); }

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:
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) .replaceAll("%message%", Matcher.quoteReplacement(msg)); if (placeholders != null) { for (Entry<String, String> e : placeholders.entrySet()) { message = message.replaceAll("%"+e.getKey()+"%", e.getValue()); } } return message; }

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:
public void rejectMessage() { if (!isAcknowledgementSent) { try { channel.basicReject(deliveryTag, isRequeueRejectedMessages); LOG.error(String.format("[consumer tag: %s] AMQP reject has been sent for message: %s", consumerTag, bodyStr)); isAcknowledgementSent = true; } catch (Exception e) { LOG.error(String.format("[consumer tag: %s] Got exception:", consumerTag), e); } } else { LOG.warn(ACK_WAS_ALREADY_SENT); } }

Target:
public void rejectMessage() { executeAck("reject", () -> { channel.basicReject(deliveryTag, false); LOG.debug(String.format("[consumer tag: %s] A message was discarded", consumerTag)); }); }
Source:
protected void onPushReceive(Context context, Intent intent) { JSONObject pushData = null; try { String pushDataStr = intent.getStringExtra(KEY_PUSH_DATA); PLog.v(TAG, pushDataStr); 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); } }

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:
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(); setEOS(); 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(); }

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:
public void testValuesWithNonTrivialType() { 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))"); 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); }

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:
private void populateGroupLabels(List<String> finalLabels, List<String> matchedLabels, Optional<String> suggestion) { Map<String, FlowPane> groupContent = getGroupContent(finalLabels, matchedLabels, suggestion); groupContent.entrySet().stream().forEach(entry -> { feedbackLabels.getChildren().addAll( createGroupTitle(entry.getKey()), entry.getValue()); }); }

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:
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; } mNosaraClient.track(EVENTS_PREFIX + eventName, user, userType); }

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:
public OpenAPI addServer(Server server) { 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); } return this; }

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:
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)) { throw new ProtocolAdapterException("Session provider: " + dlmsDevice.getCommunicationProvider() + " did not return an IP address for device: " + dlmsDevice.getDeviceIdentification() + "and iccId: " + dlmsDevice.getIccId()); } return deviceIpAddress; }

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:
public void close() throws IOException { commitMarkerCodec.close(); }

Target:
public void close() throws IOException { if (closed) { return; } try { commitMarkerCodec.close(); } finally { reader.close(); closed = true; } }
Source:
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl perunSession, AuditEvent message) throws InternalErrorException, WrongReferenceAttributeValueException, AttributeNotExistsException, WrongAttributeAssignmentException { List<AuditEvent> resolvingMessages = new ArrayList<>(); if (message instanceof AttributeSetForUser && isAffectedAttribute(((AttributeSetForUser) message).getAttribute().getFriendlyName())) { AttributeDefinition attributeDefinition = perunSession.getPerunBl().getAttributesManagerBl().getAttributeDefinition(perunSession, this.getAttributeDefinition().getName()); resolvingMessages.add(new AttributeChangedForUser(new Attribute(attributeDefinition), ((AttributeSetForUser) message).getUser())); } else if (message instanceof AttributeRemovedForUser && isAffectedAttribute(((AttributeRemovedForUser) message).getAttribute().getFriendlyName())) { AttributeDefinition attributeDefinition = perunSession.getPerunBl().getAttributesManagerBl().getAttributeDefinition(perunSession, this.getAttributeDefinition().getName()); resolvingMessages.add(new AttributeChangedForUser(new Attribute(attributeDefinition), ((AttributeRemovedForUser) message).getUser())); } else if (message instanceof AllAttributesRemovedForUser) { AttributeDefinition attributeDefinition = perunSession.getPerunBl().getAttributesManagerBl().getAttributeDefinition(perunSession, this.getAttributeDefinition().getName()); resolvingMessages.add(new AttributeChangedForUser(new Attribute(attributeDefinition), ((AllAttributesRemovedForUser) message).getUser())); } return resolvingMessages; }

Target:
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl perunSession, AuditEvent message) throws AttributeNotExistsException { List<AuditEvent> resolvingMessages = new ArrayList<>(); if (message instanceof AttributeSetForUser && isAffectedAttribute(((AttributeSetForUser) message).getAttribute().getFriendlyName())) { AttributeDefinition attributeDefinition = perunSession.getPerunBl().getAttributesManagerBl().getAttributeDefinition(perunSession, this.getAttributeDefinition().getName()); resolvingMessages.add(new AttributeChangedForUser(new Attribute(attributeDefinition), ((AttributeSetForUser) message).getUser())); } else if (message instanceof AttributeRemovedForUser && isAffectedAttribute(((AttributeRemovedForUser) message).getAttribute().getFriendlyName())) { AttributeDefinition attributeDefinition = perunSession.getPerunBl().getAttributesManagerBl().getAttributeDefinition(perunSession, this.getAttributeDefinition().getName()); resolvingMessages.add(new AttributeChangedForUser(new Attribute(attributeDefinition), ((AttributeRemovedForUser) message).getUser())); } else if (message instanceof AllAttributesRemovedForUser) { AttributeDefinition attributeDefinition = perunSession.getPerunBl().getAttributesManagerBl().getAttributeDefinition(perunSession, this.getAttributeDefinition().getName()); resolvingMessages.add(new AttributeChangedForUser(new Attribute(attributeDefinition), ((AllAttributesRemovedForUser) message).getUser())); } return resolvingMessages; }
Source:
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 { logger.error(e.getMessage(), e); Helper.setFehlerMeldung(Helper.getTranslation("exportError") + process.getTitle(), e); } logger.error("Export abgebrochen, xml-LeseFehler", e); return null; } }

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:
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 -> { if (getErrorCode(error.getCause()) == UNAUTHORIZED_GIT_OPERATION) { 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(); }

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:
public static 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(); }

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:
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()) { throw new FileNotFoundException(ERROR_INIT); } 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()); } }

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()); } }