auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void configure() throws ConfigurationException { super.configure(); <START> if(StringUtils.isNotEmpty(tempFolder)) { <END> File outputLocation = new File(tempFolder); if (!outputLocation.exists()) { throw new ConfigurationException( "Pdf output location does not exist. Please specify an existing location "); } if (!outputLocation.isDirectory()) { throw new ConfigurationException("Pdf output location is not directory. Please specify a diretory"); } } if (!availableActions.contains(action)) { throw new ConfigurationException( "Please specify an action for pdf pipe. Possible values: {convert, combine}"); } if (StringUtils.isEmpty(license)) { throw new ConfigurationException("Please specify the full path to aspose license including file name."); } try (InputStream inputStream = new FileInputStream(license)) { } catch (FileNotFoundException notFound) { throw new ConfigurationException("Specified file for aspose license is not found", notFound); } catch (IOException e1) { throw new ConfigurationException(e1); } try { loader = new AsposeLicenseLoader(license, fontsDirectory); loader.loadLicense(); } catch (Exception e) { throw new ConfigurationException(e); } }</code><technical_language>I expected this code moved start(). is in duplicate</technical_language>

Target:
public void configure() throws ConfigurationException { super.configure(); if(StringUtils.isNotEmpty(pdfOutputLocation)) { File outputLocation = new File(pdfOutputLocation); if (!outputLocation.exists()) { throw new ConfigurationException( "Pdf output location does not exist. Please specify an existing location "); } if (!outputLocation.isDirectory()) { throw new ConfigurationException("Pdf output location is not directory. Please specify a diretory"); } } if (!availableActions.contains(action)) { throw new ConfigurationException( "Please specify an action for pdf pipe. Possible values: {convert, combine}"); } if (StringUtils.isEmpty(license)) { ConfigurationWarnings.add(this, log, "Aspose License is not configured. There will be evaluation watermarks on the converted documents. There are also some restrictions in the API use. License field could be set with a valid information to avoid this. "); }else { if(ClassUtils.getResourceURL(this, license) == null) { throw new ConfigurationException("Specified file for aspose license is not found"); } } try { loader = new AsposeLicenseLoader(license, fontsDirectory); loader.loadLicense(); } catch (Exception e) { throw new ConfigurationException("Error occured while loading the license", e); } }
Source:
<code>public void assertAndConsume() { TestSubscriber<Integer> ts = TestSubscriber.create(); ts.assertNoValues(); ts.onNext(1); ts.assertAndConsume(1); ts.assertNoValues(); ts.onNext(2); ts.onNext(3); ts.assertValueCount(2); ts.assertAndConsume(2, 3); ts.onNext(4); ts.onNext(5); try { ts.assertAndConsume(4); Assert.fail("Should have thrown AssertionError"); } catch (AssertionError ex) { } ts.assertValueCount(2); try { ts.assertAndConsume(4, 5, 6); <START> Assert.fail("Should have thrown AssertionError"); <END> } catch (AssertionError ex) { } ts.assertAndConsume(4, 5); ts.assertNoValues(); }</code><technical_language>In IntelliJ I write fail( hit ALT + ENTER apply static import, IntellIJ applies for file</technical_language>

Target:
public void assertAndConsume() { TestSubscriber<Integer> ts = TestSubscriber.create(); ts.assertNoValues(); ts.onNext(1); ts.assertValuesAndClear(1); ts.assertNoValues(); ts.onNext(2); ts.onNext(3); ts.assertValueCount(2); ts.assertValuesAndClear(2, 3); ts.onNext(4); ts.onNext(5); try { ts.assertValuesAndClear(4); Assert.fail("Should have thrown AssertionError"); } catch (AssertionError ex) { } ts.assertValueCount(2); try { ts.assertValuesAndClear(4, 5, 6); Assert.fail("Should have thrown AssertionError"); } catch (AssertionError ex) { } ts.assertValuesAndClear(4, 5); ts.assertNoValues(); }
Source:
<code>protected SAMSequenceDictionary findAndLoadSequenceDictionary(final Path fasta) { final Path dictPath = findSequenceDictionary(path); if (dictPath == null) { return null; } else { IOUtil.assertFileIsReadable(dictPath); try (InputStream dictionaryIn = IOUtil.openFileForReading(dictPath)) { return ReferenceSequenceFileFactory.loadDictionary(dictionaryIn); } <START> catch (Exception e) { <END> throw new SAMException("Could not open sequence dictionary file: " + dictPath, e); } } }</code><technical_language>catch previous line. Also, is a more specific exception type here, e.g. IOException</technical_language>

Target:
protected SAMSequenceDictionary findAndLoadSequenceDictionary(final Path fasta) { final Path dictPath = findSequenceDictionary(path); if (dictPath == null) return null; IOUtil.assertFileIsReadable(dictPath); try (InputStream dictionaryIn = IOUtil.openFileForReading(dictPath)) { return ReferenceSequenceFileFactory.loadDictionary(dictionaryIn); } catch (Exception e) { throw new SAMException("Could not open sequence dictionary file: " + dictPath, e); } }
Source:
<code>public void setIgnoredPlayer(IUser user, boolean set) { <START> String uuid = user.getBase().getUniqueId().toString(); <END> if (set) { if (!ignoredPlayers.contains(uuid)) { ignoredPlayers.add(uuid); } } else { ignoredPlayers.remove(uuid); } setIgnoredPlayers(ignoredPlayers); }</code><technical_language>prefer stored actual UUID objects, Strings representing</technical_language>

Target:
public void setIgnoredPlayer(IUser user, boolean set) { UUID uuid = user.getBase().getUniqueId(); if (set) { if (!ignoredPlayers.contains(uuid)) { ignoredPlayers.add(uuid); } } else { ignoredPlayers.remove(uuid); } setIgnoredPlayerUUIDs(ignoredPlayers); }
Source:
<code>public void testDoesNotAttemptToDeserializeExtremelyBigNumbers() { <START> assertThatExceptionOfType(JsonMappingException.class).isThrownBy( <END> () -> objectMapper.readValue("{\"id\": 42, \"duration\": 1e1000000000}", Task.class)); }</code><technical_language>this test confirm exception message contains out of range</technical_language>

Target:
public void testDoesNotAttemptToDeserializeExtremelyBigNumbers() { assertThatExceptionOfType(JsonMappingException.class).isThrownBy( () -> objectMapper.readValue("{\"id\": 42, \"duration\": 1e1000000000}", Task.class)) .withMessageStartingWith("Value is out of range of Duration"); }
Source:
<code>public HQLQueryPlan getHQLQueryPlan(String queryString, boolean shallow, Map<String, Filter> enabledFilters) throws QueryException, MappingException { final HQLQueryPlanKey key = new HQLQueryPlanKey( queryString, shallow, enabledFilters ); HQLQueryPlan value = (HQLQueryPlan) queryPlanCache.get( key ); final StatisticsImplementor statistics = factory.getStatistics(); boolean stats = statistics.isStatisticsEnabled(); if ( value == null ) { final long startTime = ( stats ) ? System.nanoTime() : 0L; LOG.tracev( "Unable to locate HQL query plan in cache; generating ({0})", queryString ); <START> value = createHQLQueryPlan( queryString, shallow, enabledFilters, factory ); <END> if ( stats ) { final long endTime = System.nanoTime(); final long microseconds = TimeUnit.MICROSECONDS.convert( endTime - startTime, TimeUnit.NANOSECONDS ); statistics.queryCompiled( queryString, microseconds ); } queryPlanCache.putIfAbsent( key, value ); } else { LOG.tracev( "Located HQL query plan in cache ({0})", queryString ); if ( stats ) { statistics.queryPlanCacheHit( queryString ); } } return value; }</code><technical_language>guys inheritance everywhere? *really* want subclass of these? pass in functionals create plan? SessionFactory (I assume subclass SessionFactory, Session, etc) simply pass in a one. I mean, feel free subclassing everything, personally minimize I need subclass</technical_language>

Target:
public HQLQueryPlan getHQLQueryPlan(String queryString, boolean shallow, Map<String, Filter> enabledFilters) throws QueryException, MappingException { final HQLQueryPlanKey key = new HQLQueryPlanKey( queryString, shallow, enabledFilters ); HQLQueryPlan value = (HQLQueryPlan) queryPlanCache.get( key ); final StatisticsImplementor statistics = factory.getStatistics(); boolean stats = statistics.isStatisticsEnabled(); if ( value == null ) { final long startTime = ( stats ) ? System.nanoTime() : 0L; LOG.tracev( "Unable to locate HQL query plan in cache; generating ({0})", queryString ); value = queryPlanCreator.createQueryPlan( queryString, shallow, enabledFilters, factory ); if ( stats ) { final long endTime = System.nanoTime(); final long microseconds = TimeUnit.MICROSECONDS.convert( endTime - startTime, TimeUnit.NANOSECONDS ); statistics.queryCompiled( queryString, microseconds ); } queryPlanCache.putIfAbsent( key, value ); } else { LOG.tracev( "Located HQL query plan in cache ({0})", queryString ); if ( stats ) { statistics.queryPlanCacheHit( queryString ); } } return value; }
Source:
<code>private void safeMove( final String s3Bucket, final String s3Path, final String targetS3Bucket, final String targetS3Path ) throws ServiceException, SegmentLoadingException { try { S3Utils.retryS3Operation( (Callable<Void>) () -> { final String copyMsg = StringUtils.format( "[s3://%s/%s] to [s3://%s/%s]", s3Bucket, s3Path, targetS3Bucket, targetS3Path ); try { selfCheckingMove(s3Bucket, targetS3Bucket, s3Path, targetS3Path, copyMsg); return null; } <START> catch (Exception e) { <END> log.info(e, "Error while trying to move " + copyMsg); throw e; } } ); } catch (Exception e) { Throwables.propagateIfInstanceOf(e, ServiceException.class); Throwables.propagateIfInstanceOf(e, SegmentLoadingException.class); throw Throwables.propagate(e); } }</code><technical_language>this swallow InterruptedException</technical_language>

Target:
private void safeMove( final String s3Bucket, final String s3Path, final String targetS3Bucket, final String targetS3Path ) throws ServiceException, SegmentLoadingException { try { S3Utils.retryS3Operation( (Callable<Void>) () -> { final String copyMsg = StringUtils.format( "[s3://%s/%s] to [s3://%s/%s]", s3Bucket, s3Path, targetS3Bucket, targetS3Path ); try { selfCheckingMove(s3Bucket, targetS3Bucket, s3Path, targetS3Path, copyMsg); return null; } catch (ServiceException | IOException | SegmentLoadingException e) { log.info(e, "Error while trying to move " + copyMsg); throw e; } } ); } catch (Exception e) { Throwables.propagateIfInstanceOf(e, ServiceException.class); Throwables.propagateIfInstanceOf(e, SegmentLoadingException.class); throw Throwables.propagate(e); } }
Source:
<code>public String getCrepoKey() { <START> return entry; <END> }</code><technical_language>this key</technical_language>

Target:
public String getCrepoKey() { return key; }
Source:
<code>public void createActions(IComparisonScope scope, Comparison comparison) { if (menuManager.isEmpty()) { IDifferenceFilter.Registry registry = EMFCompareRCPUIPlugin.getDefault() .getFilterActionRegistry(); Collection<IDifferenceFilter> filters = registry.getFilters(scope, comparison); for (IDifferenceFilter filter : filters) { FilterAction action = new FilterAction(filter.getLabel(), structureMergeViewerFilter, filter); if (filter.defaultSelected()) { action.setChecked(true); } menuManager.add(action); } <START> structureMergeViewerFilter.addFilters(filters); <END> } }</code><technical_language>add filters defaultSelected? build a temporary list filters added..</technical_language>

Target:
public void createActions(IComparisonScope scope, Comparison comparison) { if (menuManager.isEmpty()) { IDifferenceFilter.Registry registry = EMFCompareRCPUIPlugin.getDefault() .getFilterActionRegistry(); Collection<IDifferenceFilter> filters = registry.getFilters(scope, comparison); Collection<IDifferenceFilter> filtersSelected = Lists.newArrayList(); for (IDifferenceFilter filter : filters) { FilterAction action = new FilterAction(filter.getLabel(), structureMergeViewerFilter, filter); if (filter.defaultSelected()) { action.setChecked(true); filtersSelected.add(filter); } menuManager.add(action); } structureMergeViewerFilter.addFilters(filtersSelected); } }
Source:
<code>protected boolean validateDiscardAfterDeleteLegal(StorageDomainValidator storageDomainValidator, Version compatibilityVersion) { <START> if (getStorageDomain().isDiscardAfterDelete() && <END> !FeatureSupported.discardAfterDeleteSupported(compatibilityVersion)) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_DISCARD_AFTER_DELETE_NOT_SUPPORTED_BY_DC_VERSION, String.format("$dataCenterVersion %s", compatibilityVersion.toString())); } ArrayList<LUNs> luns = (ArrayList<LUNs>) runVdsCommand(VDSCommandType.GetDeviceList, new GetDeviceListVDSCommandParameters(getVds().getId(), getStorageDomain().getStorageType(), false, getParameters().getLunIds())).getReturnValue(); return validate(storageDomainValidator.isDiscardAfterDeleteLegalForNewBlockStorageDomain(luns)); }</code><technical_language>Extract this check StorageDomainValidator replace call in UpdateStorageDomainCommand</technical_language>

Target:
protected boolean validateDiscardAfterDeleteLegal(StorageDomainValidator storageDomainValidator, Version compatibilityVersion) { if (!validate(storageDomainValidator.isDiscardAfterDeleteSupportedByDcVersion(compatibilityVersion))) { return false; } ArrayList<LUNs> luns = (ArrayList<LUNs>) runVdsCommand(VDSCommandType.GetDeviceList, new GetDeviceListVDSCommandParameters(getVds().getId(), getStorageDomain().getStorageType(), false, getParameters().getLunIds())).getReturnValue(); return validate(storageDomainValidator.isDiscardAfterDeleteLegalForNewBlockStorageDomain(luns)); }
Source:
<code>public Optional<String> namespace() { <START> return Optional.of("Jdbc namespace"); <END> }</code><technical_language>spaces OK in namespace strings</technical_language>

Target:
public Optional<String> namespace() { return Optional.empty(); }
Source:
<code>private void toggleFollowStatus() { if (!NetworkUtils.checkConnection(getContext())) { return; } final boolean isAskingToFollow; if (mFeedId != 0) { isAskingToFollow = !ReaderBlogTable.isFollowedFeed(mFeedId); } else { isAskingToFollow = !ReaderBlogTable.isFollowedBlog(mBlogId); } ReaderActions.ActionListener listener = new ReaderActions.ActionListener() { @Override public void onActionResult(boolean succeeded) { <START> if (!succeeded && getContext() != null) { <END> int errResId = isAskingToFollow ? R.string.reader_toast_err_follow_blog : R.string.reader_toast_err_unfollow_blog; ToastUtils.showToast(getContext(), errResId); mFollowButton.setIsFollowed(!isAskingToFollow); } } }; boolean result; if (mFeedId != 0) { result = ReaderBlogActions.followFeedById(mFeedId, isAskingToFollow, listener); } else { result = ReaderBlogActions.followBlogById(mBlogId, isAskingToFollow, listener); } if (result) { mFollowButton.setIsFollowedAnimated(isAskingToFollow); } }</code><technical_language>hold a reference listener limit requests a time. Pressing in succession lead contradictory toast messages. assuming happen a slow connection</technical_language>

Target:
private void toggleFollowStatus() { if (!NetworkUtils.checkConnection(getContext())) { return; } final boolean isAskingToFollow; if (mFeedId != 0) { isAskingToFollow = !ReaderBlogTable.isFollowedFeed(mFeedId); } else { isAskingToFollow = !ReaderBlogTable.isFollowedBlog(mBlogId); } ReaderActions.ActionListener listener = new ReaderActions.ActionListener() { @Override public void onActionResult(boolean succeeded) { if (getContext() == null) { return; } mFollowButton.setEnabled(true); if (!succeeded) { int errResId = isAskingToFollow ? R.string.reader_toast_err_follow_blog : R.string.reader_toast_err_unfollow_blog; ToastUtils.showToast(getContext(), errResId); mFollowButton.setIsFollowed(!isAskingToFollow); } } }; mFollowButton.setEnabled(false); boolean result; if (mFeedId != 0) { result = ReaderBlogActions.followFeedById(mFeedId, isAskingToFollow, listener); } else { result = ReaderBlogActions.followBlogById(mBlogId, isAskingToFollow, listener); } if (result) { mFollowButton.setIsFollowedAnimated(isAskingToFollow); } }
Source:
<code>public Map<TaskId, TaskState> getHMTasks() { Map<String, TaskStateData> taskStateMap = jobStateData.getTasks(); Map<TaskId, TaskState> hmTasks = new HashMap<>(); <START> for (TaskStateData ts : taskStateMap.values()) { <END> TaskIdData taskIdData = ts.getTaskInfo().getTaskId(); hmTasks.put(DataUtility.taskId(DataUtility.jobId(jobStateData.getJobInfo().getJobId()), taskIdData), DataUtility.taskState(ts)); } return hmTasks; }</code><technical_language>call ts "taskStateData"</technical_language>

Target:
public Map<TaskId, TaskState> getHMTasks() { Map<String, TaskStateData> taskStateDataMap = jobStateData.getTasks(); Map<TaskId, TaskState> taskStateMap = new HashMap<>(); for (TaskStateData taskStateData : taskStateDataMap.values()) { TaskIdData taskIdData = taskStateData.getTaskInfo().getTaskId(); taskStateMap.put(DataUtility.taskId(DataUtility.jobId(jobStateData.getJobInfo().getJobId()), taskIdData), DataUtility.taskState(taskStateData)); } return taskStateMap; }
Source:
<code>protected Void doInBackground(Void... params) { MimeMessage message; try { message = createMessage(); <START> } catch (Exception me) { <END> Log.e(K9.LOG_TAG, "Failed to create new message for send or save.", me); throw new RuntimeException("Failed to create a new message for send or save.", me); } try { mContacts.markAsContacted(message.getRecipients(RecipientType.TO)); mContacts.markAsContacted(message.getRecipients(RecipientType.CC)); mContacts.markAsContacted(message.getRecipients(RecipientType.BCC)); } catch (Exception e) { Log.e(K9.LOG_TAG, "Failed to mark contact as contacted.", e); } MessagingController.getInstance(getApplication()).sendMessage(mAccount, message, null); long draftId = mDraftId; if (draftId != INVALID_DRAFT_ID) { mDraftId = INVALID_DRAFT_ID; MessagingController.getInstance(getApplication()).deleteDraft(mAccount, draftId); } return null; }</code><technical_language>this a bad idea. list exceptions explicitly</technical_language>

Target:
protected Void doInBackground(Void... params) { MimeMessage message; try { message = createMessage(); } catch (OpenPgpApiException e){ Log.e(K9.LOG_TAG, "Failed to create new message for send or save.", e); throw new RuntimeException("Failed to create a new message for send or save.", e); } catch (MessagingException me) { Log.e(K9.LOG_TAG, "Failed to create new message for send or save.", me); throw new RuntimeException("Failed to create a new message for send or save.", me); } try { mContacts.markAsContacted(message.getRecipients(RecipientType.TO)); mContacts.markAsContacted(message.getRecipients(RecipientType.CC)); mContacts.markAsContacted(message.getRecipients(RecipientType.BCC)); } catch (Exception e) { Log.e(K9.LOG_TAG, "Failed to mark contact as contacted.", e); } MessagingController.getInstance(getApplication()).sendMessage(mAccount, message, null); long draftId = mDraftId; if (draftId != INVALID_DRAFT_ID) { mDraftId = INVALID_DRAFT_ID; MessagingController.getInstance(getApplication()).deleteDraft(mAccount, draftId); } return null; }
Source:
<code>public static void compareAndSetMaxLong( Object object, long fieldOffset, long newValue ) { long currentValue; do { <START> currentValue = UnsafeUtil.getLong( object, fieldOffset ); <END> if ( currentValue >= newValue ) { return; } } while ( !UnsafeUtil.compareAndSwapLong( object, fieldOffset, currentValue, newValue ) ); }</code><technical_language>I this needs a getLongVolatile</technical_language>

Target:
public static void compareAndSetMaxLong( Object object, long fieldOffset, long newValue ) { long currentValue; do { currentValue = UnsafeUtil.getLongVolatile( object, fieldOffset ); if ( currentValue >= newValue ) { return; } } while ( !UnsafeUtil.compareAndSwapLong( object, fieldOffset, currentValue, newValue ) ); }
Source:
<code>public Iterator<List<ExternalTupleSet>> getValidIndexCombos( List<ExternalTupleSet> indexSet) { Collections.shuffle(indexSet); final List<ExternalTupleSet> list = indexSet; final Iterator<List<Integer>> iter = getValidCombos(list); return new Iterator<List<ExternalTupleSet>>() { private List<ExternalTupleSet> next = null; private List<Integer> nextCombo = null; private boolean hasNextCalled = false; private boolean isEmpty = false; @Override public boolean hasNext() { if (!hasNextCalled && !isEmpty) { if (!iter.hasNext()) { isEmpty = true; return false; } else { nextCombo = iter.next(); List<ExternalTupleSet> indexCombo = Lists .newArrayList(); for (Integer i : nextCombo) { indexCombo.add(list.get(i)); } next = indexCombo; hasNextCalled = true; return true; } } else <START> return !isEmpty; <END> } @Override public List<ExternalTupleSet> next() { if (hasNextCalled) { hasNextCalled = false; return next; } else if (isEmpty) { throw new NoSuchElementException(); } else { if (this.hasNext()) { hasNextCalled = false; return next; } else { throw new NoSuchElementException(); } } } @Override public void remove() { throw new UnsupportedOperationException( "Cannot delete from iterator!"); } }; }</code><technical_language>do remove curly braces else</technical_language>

Target:
public Iterator<List<ExternalTupleSet>> getValidIndexCombos( List<ExternalTupleSet> indexSet) { Collections.shuffle(indexSet); final List<ExternalTupleSet> list = indexSet; final Iterator<List<Integer>> iter = getValidCombos(list); return new Iterator<List<ExternalTupleSet>>() { private List<ExternalTupleSet> next = null; private List<Integer> nextCombo = null; private boolean hasNextCalled = false; private boolean isEmpty = false; @Override public boolean hasNext() { if (!hasNextCalled && !isEmpty) { if (!iter.hasNext()) { isEmpty = true; return false; } else { nextCombo = iter.next(); List<ExternalTupleSet> indexCombo = Lists .newArrayList(); for (Integer i : nextCombo) { indexCombo.add(list.get(i)); } next = indexCombo; hasNextCalled = true; return true; } } else { return !isEmpty; } } @Override public List<ExternalTupleSet> next() { if (hasNextCalled) { hasNextCalled = false; return next; } else if (isEmpty) { throw new NoSuchElementException(); } else { if (this.hasNext()) { hasNextCalled = false; return next; } else { throw new NoSuchElementException(); } } } @Override public void remove() { throw new UnsupportedOperationException( "Cannot delete from iterator!"); } }; }
Source:
<code>public List<TaskInfo> apply(ConfigResource resource) throws AuthException, ResourceNotFoundException { CurrentUser user = self.get(); <START> if (user instanceof AnonymousUser) { throw new AuthException("Authentication required"); } else if (!user.isIdentifiedUser()) { throw new ResourceNotFoundException(); } <END> List<TaskInfo> allTasks = getTasks(); if (user.getCapabilities().canViewQueue()) { return allTasks; } else { List<TaskInfo> visibleTasks = new ArrayList<>(); for (TaskInfo task : allTasks) { if (task.projectName != null) { ProjectState e = projectCache.get(new Project.NameKey(task.projectName)); if (e != null && e.controlFor(user).isVisible()) { visibleTasks.add(task); } } } return visibleTasks; } }</code><technical_language>Is this say: if (!user.isIdentifiedUser()) { throw new AuthException("Authentication required"); } ? else branch is hit</technical_language>

Target:
public List<TaskInfo> apply(ConfigResource resource) throws AuthException { CurrentUser user = self.get(); if (!user.isIdentifiedUser()) { throw new AuthException("Authentication required"); } List<TaskInfo> allTasks = getTasks(); if (user.getCapabilities().canViewQueue()) { return allTasks; } else { Map<String, Boolean> visibilityCache = new HashMap<>(); List<TaskInfo> visibleTasks = new ArrayList<>(); for (TaskInfo task : allTasks) { if (task.projectName != null) { Boolean visible = visibilityCache.get(task.projectName); if (visible == null) { ProjectState e = projectCache.get(new Project.NameKey(task.projectName)); visible = e != null ? e.controlFor(user).isVisible() : false; visibilityCache.put(task.projectName, visible); } if (visible) { visibleTasks.add(task); } } } return visibleTasks; } }
Source:
<code>private StatusAdapter getSingleSelection() { IStructuredSelection <START> rawSelection = <END> statusListViewer.getStructuredSelection(); if (rawSelection != null && rawSelection.size() == 1) { return (StatusAdapter) rawSelection.getFirstElement(); } return null; }</code><technical_language>rename 'selection'</technical_language>

Target:
private StatusAdapter getSingleSelection() { IStructuredSelection selection = statusListViewer.getStructuredSelection(); if (selection != null && selection.size() == 1) { return (StatusAdapter) selection.getFirstElement(); } return null; }
Source:
<code>public void test_sleepJ() { long stime = 0, ftime = 0; try { stime = System.currentTimeMillis(); Thread.sleep(1000); ftime = System.currentTimeMillis(); } catch (InterruptedException e) { fail("Unexpected interrupt received"); } long <START> result = <END> ftime - stime; assertTrue("Failed to sleep long enough: " + result, result >= 998); assertTrue("Overslept: " + result, result <= 1300); }</code><technical_language>naming: consider renaming this line 849 elapsedMillis? you</technical_language>

Target:
public void test_sleepJ() { long stime = 0, ftime = 0; try { stime = System.currentTimeMillis(); Thread.sleep(1000); ftime = System.currentTimeMillis(); } catch (InterruptedException e) { fail("Unexpected interrupt received"); } long elapsedMillis = ftime - stime; assertTrue("Failed to sleep long enough: " + elapsedMillis, elapsedMillis >= 998); assertTrue("Overslept: " + elapsedMillis, elapsedMillis <= 1300); }
Source:
<code>protected void close() { try { task.stop(); } catch (Throwable t) { log.warn("Could not stop task", t); } if (consumer != null) { try { consumer.close(); } catch (Throwable t) { log.warn("Could not close consumer", t); } } try { transformationChain.close(); } catch (Throwable t) { log.warn("Could not close transformation chain", t); } <START> try { retryWithToleranceOperator.close(); } catch (Throwable t) { log.warn("Could not close retry operator", t); } <END> }</code><technical_language>suggestion Utils.closeQuietly(retryWithToleranceOperator, "retry operator");</technical_language>

Target:
protected void close() { try { task.stop(); } catch (Throwable t) { log.warn("Could not stop task", t); } if (consumer != null) { try { consumer.close(); } catch (Throwable t) { log.warn("Could not close consumer", t); } } try { transformationChain.close(); } catch (Throwable t) { log.warn("Could not close transformation chain", t); } Utils.closeQuietly(retryWithToleranceOperator, "retry operator"); }
Source:
<code>public static String getUserTimeZonePostfix() { if (!useUserTimeZone()) { return ""; } <START> TimeZone tz = TimeZone.getTimeZone(getUserTimeZone()); <END> return tz.getDisplayName(tz.observesDaylightTime(), TimeZone.SHORT); }</code><technical_language>happen if string converted? some error handling protective code is missing</technical_language>

Target:
public static String getUserTimeZonePostfix() { if (!isUserTimeZoneOverride()) { return ""; } TimeZone tz = TimeZone.getTimeZone(getUserTimeZone()); return tz.getDisplayName(tz.observesDaylightTime(), TimeZone.SHORT); }
Source:
<code>public void setDeviceTags() { setTag("Device", DeviceUtils.getModel()); setTag("OS", "Android " + DeviceUtils.getOsVersion()); setTag("Language", DeviceUtils.getLanguage()); setTag("Time Zone", DeviceUtils.getTimeZone()); try { <START> PackageInfo packageInfo = GrowthbeatCore.getInstance().getContext().getPackageManager() <END> .getPackageInfo(GrowthbeatCore.getInstance().getContext().getPackageName(), PackageManager.GET_META_DATA); setTag("Version", packageInfo.versionName); setTag("Build", String.valueOf(packageInfo.versionCode)); } catch (PackageManager.NameNotFoundException e) { } }</code><technical_language>AppUtils <LINK_0></technical_language>

Target:
public void setDeviceTags() { setTag("Device", DeviceUtils.getModel()); setTag("OS", "Android " + DeviceUtils.getOsVersion()); setTag("Language", DeviceUtils.getLanguage()); setTag("Time Zone", DeviceUtils.getTimeZone()); setTag("Version", AppUtils.getaAppVersion(GrowthbeatCore.getInstance().getContext())); setTag("Build", AppUtils.getAppBuild(GrowthbeatCore.getInstance().getContext())); }
Source:
<code>public void getConceptByNameOrIdOrMap_shouldFindAConceptByItsUuid() { String uuid = "0cbe2ed3-cd5f-4f46-9459-26127c9265ab"; Concept concept = Context.getConceptService().getConceptByNameOrIdOrMap(uuid); <START> Assert.assertEquals(3, (int) concept.getConceptId()); <END> }</code><technical_language>explicit typecasting is required</technical_language>

Target:
public void getConceptByNameOrIdOrMap_shouldFindAConceptByItsUuid() { String uuid = "7d104a6f-8337-4afa-b936-41083a5d9d88"; Assert.assertEquals(uuid, conceptService.getConceptByNameOrIdOrMap(uuid).getUuid()); }
Source:
<code><START> private void setIncludedResources(Set<IResource> includedResources) { <END> this.includedPaths = includedResources; Set<String> paths = new LinkedHashSet<String>(includedResources.size()); RepositoryMapping rm = RepositoryMapping.findRepositoryMapping(repo); for (IResource resource : includedResources) { String repoRelativePath = rm.getRepoRelativePath(resource); if (repoRelativePath.length() > 0) paths.add(repoRelativePath); } if (!paths.isEmpty()) pathFilter = PathFilterGroup.createFromStrings(paths); }</code><technical_language>This a copy of setIncludedPaths, types. Change argument type of setIncludedPaths Set<? extends IResource> remove this</technical_language>

Target:
public void setIncludedResources(Set<IResource> includedResources) { this.includedResources = includedResources; Set<String> paths = new HashSet<String>(); RepositoryMapping rm = RepositoryMapping.findRepositoryMapping(repo); for (IResource resource : includedResources) { String repoRelativePath = rm.getRepoRelativePath(resource); if (repoRelativePath.length() > 0) paths.add(repoRelativePath); } if (!paths.isEmpty()) pathFilter = PathFilterGroup.createFromStrings(paths); }
Source:
<code><START> public void setEnvironment(Environment environment) { <END> this.environment = (ConfigurableEnvironment) environment; }</code><technical_language>this need instanceof check Assert.isInstanceOf</technical_language>

Target:
public void setEnvironment(Environment environment) { Assert.isInstanceOf(ConfigurableEnvironment.class, environment, "unsupported environment type. " + environment.getClass()); this.environment = (ConfigurableEnvironment) environment; }
Source:
<code>private ConsumerRecords<K, V> poll(final Timer timer, final boolean includeMetadataInTimeout) { acquireAndEnsureOpen(); try { if (this.subscriptions.hasNoSubscriptionOrUserAssignment()) { throw new IllegalStateException("Consumer is not subscribed to any topics or assigned any partitions"); } do { client.maybeTriggerWakeup(); if (includeMetadataInTimeout) { updateAssignmentMetadataIfNeeded(time.timer(0L)); } else { while (!updateAssignmentMetadataIfNeeded(time.timer(Long.MAX_VALUE))) { log.warn("Still waiting for metadata"); } } final Map<TopicPartition, List<ConsumerRecord<K, V>>> records = pollForFetches(timer); if (!records.isEmpty()) { if (fetcher.sendFetches() > 0 || client.hasPendingRequests()) { client.pollNoWakeup(); } final Set<TopicPartition> assignedPartitions = subscriptions.assignedPartitions(); <START> return this.interceptors.onConsume(new ConsumerRecords<>(records.entrySet() <END> .stream() .filter(entry -> assignedPartitions.contains(entry.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)))); } } while (timer.notExpired()); return ConsumerRecords.empty(); } finally { release(); } }</code><technical_language>Ah, I see. Edit: Actually, closer inspection, appears I order mixed up. accounted for. mistake</technical_language>

Target:
private ConsumerRecords<K, V> poll(final Timer timer, final boolean includeMetadataInTimeout) { acquireAndEnsureOpen(); try { this.kafkaConsumerMetrics.recordPollStart(timer.currentTimeMs()); if (this.subscriptions.hasNoSubscriptionOrUserAssignment()) { throw new IllegalStateException("Consumer is not subscribed to any topics or assigned any partitions"); } do { client.maybeTriggerWakeup(); if (includeMetadataInTimeout) { updateAssignmentMetadataIfNeeded(time.timer(0L)); } else { while (!updateAssignmentMetadataIfNeeded(time.timer(Long.MAX_VALUE))) { log.warn("Still waiting for metadata"); } } final Map<TopicPartition, List<ConsumerRecord<K, V>>> records = pollForFetches(timer); if (!records.isEmpty()) { if (fetcher.sendFetches() > 0 || client.hasPendingRequests()) { client.transmitSends(); } return this.interceptors.onConsume(new ConsumerRecords<>(records)); } } while (timer.notExpired()); return ConsumerRecords.empty(); } finally { release(); this.kafkaConsumerMetrics.recordPollEnd(timer.currentTimeMs()); } }
Source:
<code>public UserDTO addUser(UserDTO userResource) { validateUserFields(userResource); User user = userResource.createUserEntity(); user = User.getRepository().save(user); <START> UserDTO savedUser = UserDTO.createInstanceWithPrivateData(user); <END> return savedUser; }</code><technical_language>Inline this variable</technical_language>

Target:
public UserDTO addUser(UserDTO userResource) { validateUserFields(userResource); User userEntity = userResource.createUserEntity(); userEntity = User.getRepository().save(userEntity); return UserDTO.createInstanceWithPrivateData(userEntity); }
Source:
<code>public HttpConnectionInterceptorContext interceptResponse(HttpConnectionInterceptorContext context) { if (shouldAttemptCookieRequest.get()) { HttpURLConnection connection = context.connection.getConnection(); try { boolean renewCookie = false; int statusCode = connection.getResponseCode(); <START> if (statusCode == HttpURLConnection.HTTP_FORBIDDEN || statusCode == <END> HttpURLConnection.HTTP_UNAUTHORIZED) { InputStream errorStream = connection.getErrorStream(); String errorString = null; if (errorStream != null) { try { errorString = IOUtils.toString(errorStream, "UTF-8"); } finally { IOUtils.closeQuietly(errorStream); } } logger.log(Level.FINE, String.format(Locale.ENGLISH, "Intercepted " + "response %d %s", statusCode, errorString)); switch (statusCode) { case HttpURLConnection.HTTP_FORBIDDEN: if (errorString != null && errorString.matches("(?siu)" + ".*\\\"error\\\"\\s*:\\s*\\\"credentials_expired\\\".*")) { renewCookie = true; } else { HttpConnectionInterceptorException toThrow = new HttpConnectionInterceptorException(errorString); toThrow.deserialize = errorString != null; throw toThrow; } break; case HttpURLConnection.HTTP_UNAUTHORIZED: renewCookie = true; break; default: break; } if (renewCookie) { logger.finest("Cookie was invalid. Will attempt to get new cookie."); boolean success = requestCookie(context); if (success) { context.replayRequest = true; } else { context.replayRequest = false; shouldAttemptCookieRequest.set(false); } } } else { storeCookiesFromResponse(connection); } } catch (IOException e) { logger.log(Level.SEVERE, "Error reading response code or body from request", e); } } return context; }</code><technical_language>I worth factoring parts of this out. 403 credentials_expired checks specific Cloudant I is worth JSON extraction for 403 in IAM cases. is a decent amount of common functionality frustrating override entire checkResponse method break this out getRenewalStatusCodes (which default 401) performAdditionalChecks() default a no-op fits</technical_language>

Target:
public HttpConnectionInterceptorContext interceptResponse(HttpConnectionInterceptorContext context) { try { if (shouldAttemptCookieRequest.get()) { HttpURLConnection connection = context.connection.getConnection(); int statusCode = connection.getResponseCode(); if (statusCode == HttpURLConnection.HTTP_UNAUTHORIZED) { boolean success = requestCookie(context); if (success) { context.replayRequest = true; } else { context.replayRequest = false; shouldAttemptCookieRequest.set(false); } } else { storeCookiesFromResponse(connection); } } } catch (IOException e) { logger.log(Level.SEVERE, "Error reading response code or body from request", e); } return context; }
Source:
<code>public Response add(SampleResponse sampleResponse) { Sample sample = new Sample(); sample.setName(sampleResponse.getName()); Key<Sample> key = dao.add(sample); MensagemResponse msg = new MensagemResponse(); <START> msg.setMsg(ResponseMessageEnum.OK.descricao()); <END> return msg; }</code><technical_language>Please description() instead of descricao() method name</technical_language>

Target:
public Response add(SampleResponse sampleResponse) { Sample sample = new Sample(); sample.setName(sampleResponse.getName()); Key<Sample> key = dao.add(sample); MessageResponse msg = new MessageResponse(); msg.setMsg(ResponseMessageEnum.OK.description()); return msg; }
Source:
<code>public Set<SourceProcessingDetails> getProcessingDetails() { <START> if (sourceProcessingDetails == null) { <END> sourceProcessingDetails = new HashSet<>(); } return sourceProcessingDetails; }</code><technical_language>If sourceProcessingDetails is initialized new HashSet<>() instead of null check here</technical_language>

Target:
public Set<SourceProcessingDetails> getProcessingDetails() { return sourceProcessingDetails; }
Source:
<code><START> public ArrayList<RemoteXBeeDevice> getDevices(String id) { <END> if (id == null) throw new NullPointerException("Device identifier cannot be null."); if (id.length() == 0) throw new IllegalArgumentException("Device identifier cannot be an empty string."); ArrayList<RemoteXBeeDevice> devices = new ArrayList<RemoteXBeeDevice>(); for (RemoteXBeeDevice remote : remotesBy64BitAddr.values()) { if (remote.getNodeID().equals(id)) devices.add(remote); } for (RemoteXBeeDevice remote : remotesBy16BitAddr.values()) { if (remote.getNodeID().equals(id)) devices.add(remote); } return devices; }</code><technical_language>List instead of ArrayList java public List<RemoteXBeeDevice> getDevices() {</technical_language>

Target:
public List<RemoteXBeeDevice> getDevices(String id) { if (id == null) throw new NullPointerException("Device identifier cannot be null."); if (id.length() == 0) throw new IllegalArgumentException("Device identifier cannot be an empty string."); List<RemoteXBeeDevice> devices = new ArrayList<RemoteXBeeDevice>(); for (RemoteXBeeDevice remote : remotesBy64BitAddr.values()) { if (remote.getNodeID().equals(id)) devices.add(remote); } for (RemoteXBeeDevice remote : remotesBy16BitAddr.values()) { if (remote.getNodeID().equals(id)) devices.add(remote); } return devices; }
Source:
<code>void writeElement(ObjectDataOutput out, Entry<Data, Object> entry) throws IOException { <START> out.writeData((Data)entry.getKey()); <END> Object value = entry.getValue(); if (value instanceof Data) { out.writeData((Data)value); } else { out.writeObject(value); } }</code><technical_language>need cast here</technical_language>

Target:
void writeElement(ObjectDataOutput out, Entry<Data, Object> entry) throws IOException { out.writeData(entry.getKey()); IOUtil.writeObject(out, entry.getValue()); }
Source:
<code>private void configureCompilerLog(CompilerConfiguration compilerConfiguration) throws MojoExecutionException { if (log == null) { return; } if (compilerConfiguration.getCustomCompilerArgumentsAsMap().containsKey("-log")) { throw new <START> MojoExecutionException("Compiler <END> logging is configured by the 'log' compiler" + " plugin parameter and the custom compiler argument '-log'. Only either of them is allowed."); } logDirectory.mkdirs(); String logFileName = null; if (".".equals(outputJar.getName())) { logFileName = "@dot"; } else { logFileName = outputJar.getName().replaceAll("/", "_"); } String logPath = logDirectory.getAbsolutePath(); if (!logPath.endsWith(File.separator)) { logPath = logPath + File.separator; } String fileExtension = log; if ("plain".equals(log)) { fileExtension = "log"; } logPath = logPath + logFileName + "." + fileExtension; compilerConfiguration.addCompilerCustomArgument("-log", logPath); }</code><technical_language>a MojoFailureException this is a configuration error. MojoExecutionException for internal errors</technical_language>

Target:
private void configureCompilerLog(CompilerConfiguration compilerConfiguration) throws MojoFailureException { if (log == null) { return; } if (compilerConfiguration.getCustomCompilerArgumentsAsMap().containsKey("-log")) { throw new MojoFailureException("Compiler logging is configured by the 'log' compiler" + " plugin parameter and the custom compiler argument '-log'. Only either of them is allowed."); } logDirectory.mkdirs(); String logFileName = null; if (".".equals(outputJar.getName())) { logFileName = "@dot"; } else { logFileName = outputJar.getName().replaceAll("/", "_"); } String logPath = logDirectory.getAbsolutePath(); if (!logPath.endsWith(File.separator)) { logPath = logPath + File.separator; } String fileExtension = log; if ("plain".equals(log)) { fileExtension = "log"; } logPath = logPath + logFileName + "." + fileExtension; compilerConfiguration.addCompilerCustomArgument("-log", logPath); }
Source:
<code>public void paintContent(GC gc) { if (m_statusMessage == null) return; <START> gc.setForeground(IMulticoreVisualizerConstants.COLOR_CPU_FG); <END> gc.setBackground(IMulticoreVisualizerConstants.COLOR_CPU_BG); gc.setForeground(IMulticoreVisualizerConstants.COLOR_LOAD_TEXT); int tx = m_bounds.x; int ty = m_bounds.y + 15; GUIUtils.drawTextAligned(gc, m_statusMessage, tx, ty, true, false); }</code><technical_language>Do calls want away? (I.e. drawing box anymore?)</technical_language>

Target:
public void paintContent(GC gc) { if (m_statusMessage == null) return; gc.setForeground(IMulticoreVisualizerConstants.COLOR_STATUS_BAR_TEXT); int tx = m_bounds.x; int ty = m_bounds.y + 15; GUIUtils.drawTextAligned(gc, m_statusMessage, tx, ty, true, false); }
Source:
<code>public final int scan(final String table, final String startkey, final int recordcount, final Set<String> fields, final Vector<HashMap<String, ByteIterator>> result) { try { final MongoCollection collection = database.getCollection(table); final Find.Builder find = Find.builder().query(where("_id").greaterThanOrEqualTo(startkey)) .limit(recordcount).batchSize(recordcount).sort(Sort.asc("_id")) .readPreference(readPreference); if (fields != null) { final DocumentBuilder fieldsDoc = BuilderFactory.start(); for (final String field : fields) { fieldsDoc.add(field, INCLUDE); } find.projection(fieldsDoc); } result.ensureCapacity(recordcount); final MongoIterator<Document> cursor = collection.find(find); if (!cursor.hasNext()) { System.err.println("Nothing found in scan for key " + startkey); <START> return StatusCode.ERROR; <END> } while (cursor.hasNext()) { final Document doc = cursor.next(); final HashMap<String, ByteIterator> docAsMap = new HashMap<String, ByteIterator>(); fillMap(docAsMap, doc); result.add(docAsMap); } return StatusCode.OK; } catch (final Exception e) { System.err.println(e.toString()); return StatusCode.ERROR; } }</code><technical_language>NOT_FOUND again</technical_language>

Target:
public final Status scan(final String table, final String startkey, final int recordcount, final Set<String> fields, final Vector<HashMap<String, ByteIterator>> result) { try { final MongoCollection collection = database.getCollection(table); final Find.Builder find = Find.builder().query(where("_id").greaterThanOrEqualTo(startkey)) .limit(recordcount).batchSize(recordcount).sort(Sort.asc("_id")) .readPreference(readPreference); if (fields != null) { final DocumentBuilder fieldsDoc = BuilderFactory.start(); for (final String field : fields) { fieldsDoc.add(field, INCLUDE); } find.projection(fieldsDoc); } result.ensureCapacity(recordcount); final MongoIterator<Document> cursor = collection.find(find); if (!cursor.hasNext()) { System.err.println("Nothing found in scan for key " + startkey); return Status.NOT_FOUND; } while (cursor.hasNext()) { final Document doc = cursor.next(); final HashMap<String, ByteIterator> docAsMap = new HashMap<String, ByteIterator>(); fillMap(docAsMap, doc); result.add(docAsMap); } return Status.OK; } catch (final Exception e) { System.err.println(e.toString()); return Status.ERROR; } }
Source:
<code>private ZipFileData readCentralDirectory() { try { <START> long eocdLocation = findEndOfCentralDirectoryRecord(); <END> ZipFileData fileData = new ZipFileData(UTF_8); EndOfCentralDirectoryRecord.read(fileData, dataInputSource, eocdLocation); if (fileData.isMaybeZip64()) { try { Zip64EndOfCentralDirectoryLocator.read(fileData, dataInputSource, eocdLocation - Zip64EndOfCentralDirectoryLocator.FIXED_DATA_SIZE); Zip64EndOfCentralDirectory.read(fileData, dataInputSource, fileData.getZip64EndOfCentralDirectoryOffset()); } catch (ZipException e) { } } if (fileData.isZip64()) { readCentralDirectoryFileHeaders(fileData, dataInputSource, fileData.getCentralDirectoryOffset(), fileData.getCharset(), fileData.getExpectedEntries()); } else { long centralDirectoryOffset = eocdLocation - fileData.getCentralDirectorySize(); if ((int) centralDirectoryOffset == (int) fileData.getCentralDirectoryOffset()) { readCentralDirectoryFileHeaders(fileData, dataInputSource, centralDirectoryOffset, fileData.getCharset()); } else { readCentralDirectoryFileHeaders(fileData, dataInputSource, fileData.getCentralDirectoryOffset(), fileData.getCharset(), fileData.getExpectedEntries()); } } return fileData; } catch (IOException e) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, e); } }</code><technical_language>spell out eocd</technical_language>

Target:
private ZipFileData readCentralDirectory() { try { long centralDirectoryEndOffset = getCentralDirectoryEndOffset(); ZipFileData fileData = new ZipFileData(UTF_8); EndOfCentralDirectoryRecord.read(fileData, dataInputSource, centralDirectoryEndOffset); if (fileData.isMaybeZip64()) { try { Zip64EndOfCentralDirectoryLocator.read(fileData, dataInputSource, centralDirectoryEndOffset - Zip64EndOfCentralDirectoryLocator.FIXED_DATA_SIZE); Zip64EndOfCentralDirectory.read(fileData, dataInputSource, fileData.getZip64EndOfCentralDirectoryOffset()); } catch (ZipException e) { } } if (fileData.isZip64()) { readCentralDirectoryFileHeaders(fileData, dataInputSource, fileData.getCentralDirectoryOffset(), fileData.getCharset(), fileData.getExpectedEntries()); } else { long centralDirectoryOffset = centralDirectoryEndOffset - fileData.getCentralDirectorySize(); if ((int) centralDirectoryOffset == (int) fileData.getCentralDirectoryOffset()) { readCentralDirectoryFileHeaders(fileData, dataInputSource, centralDirectoryOffset, fileData.getCharset()); } else { readCentralDirectoryFileHeaders(fileData, dataInputSource, fileData.getCentralDirectoryOffset(), fileData.getCharset(), fileData.getExpectedEntries()); } } return fileData; } catch (IOException e) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, e); } }
Source:
<code>@Test public void defaultTimeOutTest() { assertThat(format(MESSAGE, DEFAULT_TIMEOUT, DEFAULT_TIMEUNIT), <START> abs(getExpectedMillis(DEFAULT_TIMEOUT, DEFAULT_TIMEUNIT) - getBenchmark(() -> stubElements.size())), <END> lessThanOrEqualTo(ACCEPTABLE_TIME_DIFF)); timeOutDuration.setTime(15500000, MICROSECONDS); assertThat(format(MESSAGE, 15500000, MICROSECONDS), abs(getExpectedMillis(15500000, MICROSECONDS) - getBenchmark(() -> stubElements.size())), lessThanOrEqualTo(ACCEPTABLE_TIME_DIFF)); timeOutDuration.setTime(3, SECONDS); assertThat(format(MESSAGE, 3, SECONDS), abs(getExpectedMillis(3, SECONDS) - getBenchmark(() -> stubElements.size())), lessThanOrEqualTo(ACCEPTABLE_TIME_DIFF)); }</code><technical_language>I assume formula extracted a separate method, for example: java private static long getPerformanceDiff(long expectedMs, Runnable m) { return abs(expectedMs - getBenchmark(m)); }</technical_language>

Target:
@Test public void defaultTimeOutTest() { assertThat(format(MESSAGE, DEFAULT_TIMEOUT, DEFAULT_TIMEUNIT), getPerformanceDiff(getExpectedMillis(DEFAULT_TIMEOUT, DEFAULT_TIMEUNIT), () -> stubElements.size()), lessThanOrEqualTo(ACCEPTABLE_TIME_DIFF_MS)); timeOutDuration.setTime(15500000, MICROSECONDS); assertThat(format(MESSAGE, 15500000, MICROSECONDS), getPerformanceDiff(getExpectedMillis(15500000, MICROSECONDS), () -> stubElements.size()), lessThanOrEqualTo(ACCEPTABLE_TIME_DIFF_MS)); timeOutDuration.setTime(3, SECONDS); assertThat(format(MESSAGE, 3, SECONDS), getPerformanceDiff(getExpectedMillis(3, SECONDS), () -> stubElements.size()), lessThanOrEqualTo(ACCEPTABLE_TIME_DIFF_MS)); }
Source:
<code>boolean isVariableHeight(StyleRange style) { if (isWordWrap()) { return style.isVariableHeight(); } <START> return style.font != null || style.rise != 0 <END> || (style.metrics != null && (style.metrics.ascent > 0 || style.metrics.descent > 0)); }</code><technical_language>this line in StyledText.isVariableHeight() instead of current impl</technical_language>

Target:
boolean isVariableHeight(StyleRange style) { return style.isVariableHeight(isWordWrap()); }