auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean equals(Object o) { if (o instanceof RassXMLAwardPiCoPiEntry) { RassXMLAwardPiCoPiEntry other = (RassXMLAwardPiCoPiEntry) o; return StringUtils.equals(primaryString, other.getPrimaryString()) && <START> StringUtils.equals(primaryString, other.getPrimaryString()); <END> } else { return false; } }</code><technical_language>This condition is performing exact comparison twice. compare principal names instead? Also, if overriding equals() method, I suggest overriding hashCode() method well, equal objects return equal hashCodes Java's expectations for Object.hashCode() method</technical_language>

Target:
public boolean equals(Object o) { if (o instanceof RassXMLAwardPiCoPiEntry) { RassXMLAwardPiCoPiEntry other = (RassXMLAwardPiCoPiEntry) o; return Objects.equals(primary, other.getPrimary()) && StringUtils.equals(projectDirectorPrincipalName, other.getProjectDirectorPrincipalName()); } else { return false; } }
Source:
<code>private boolean shouldLoadFromBackstack(@NonNull Activity activity) { return activity.getIntent() != null && <START> (ACTION_SHOW_TAB_LIST.equals(getActivity().getIntent().getAction()) <END> || ACTION_RESUME_READING.equals(getActivity().getIntent().getAction())); }</code><technical_language>change getActivity() activity</technical_language>

Target:
private boolean shouldLoadFromBackstack(@NonNull Activity activity) { return activity.getIntent() != null && (ACTION_SHOW_TAB_LIST.equals(activity.getIntent().getAction()) || ACTION_RESUME_READING.equals(activity.getIntent().getAction())); }
Source:
<code>public abstract Connection getConnection() throws SQLException; public abstract void initDB() throws SQLException; public abstract void cleanDB() throws SQLException; public void runScript(String script) { try { ScriptRunner runner = new ScriptRunner(con, false, true); URL url = Thread.currentThread().getContextClassLoader().getResource(script); runner.runScript(new BufferedReader(new FileReader(url.getPath()))); } catch (Exception e) { <START> System.err.println(e); <END> fail(e.getMessage()); } }</code><technical_language>Prefer a logger System.err, in tests (such decide verbosity level)</technical_language>

Target:
public abstract Connection getConnection() throws SQLException; public abstract void initDB() throws SQLException; public abstract void cleanDB() throws SQLException; public void runScript(String script) { try { ScriptRunner runner = new ScriptRunner(con, false, true); URL url = Thread.currentThread().getContextClassLoader().getResource(script); runner.runScript(new BufferedReader(new FileReader(url.getPath()))); } catch (Exception e) { fail(e.getMessage()); } }
Source:
<code>private PluginMeta getMeta(PluginFQN pluginFQN) throws InfrastructureException { final String id = pluginFQN.getId(); final String version = pluginFQN.getVersion(); try { UriBuilder metaURIBuilder = pluginFQN.getRegistry() == null ? pluginRegistry.clone() : UriBuilder.fromUri(pluginFQN.getRegistry()); URI metaURI = metaURIBuilder.path(id).path(version).path("meta.yaml").build(); PluginMeta meta = getBody(metaURI, PluginMeta.class); validateMeta(meta, id, version); return meta; } catch (IllegalArgumentException | UriBuilderException | MalformedURLException e) { throw new InternalInfrastructureException( <START> format("Metadata of plugin %s:%s retrieval failed", id, version)); <END> } catch (IOException e) { throw new InfrastructureException( format( "Error occurred on retrieval of plugin %s. Error: %s", id + ':' + version, e.getMessage())); } }</code><technical_language>message clear enough. I is code, willing improve message adding some info error found</technical_language>

Target:
private PluginMeta getMeta(PluginFQN pluginFQN) throws InfrastructureException { final String id = pluginFQN.getId(); final String version = pluginFQN.getVersion(); try { UriBuilder metaURIBuilder = pluginFQN.getRegistry() == null ? pluginRegistry.clone() : UriBuilder.fromUri(pluginFQN.getRegistry()); URI metaURI = metaURIBuilder.path(id).path(version).path("meta.yaml").build(); PluginMeta meta = getBody(metaURI, PluginMeta.class); validateMeta(meta, id, version); return meta; } catch (IllegalArgumentException | UriBuilderException | MalformedURLException e) { throw new InternalInfrastructureException( format( "Metadata of plugin %s:%s retrieval failed. Error is %s", id, version, e.getMessage())); } catch (IOException e) { throw new InfrastructureException( format( "Error occurred on retrieval of plugin %s. Error: %s", id + ':' + version, e.getMessage())); } }
Source:
<code>public String errorMessage() { <START> return String.format("Expected result to match regular expression:%n%s%n%nbut found:%n%s%n", failedRegex, failedActual); <END> }</code><technical_language>This line is 128 chars long... this is compliant coding conventions</technical_language>

Target:
public String errorMessage() { return String.format("Expected result to match regular expression:" + "%n%s%n%nbut found:%n%s%n", failedRegex, failedActual); }
Source:
<code>public void testGetProjectScrumWorkersUsername(){ ProjectInfo projectInfo = new ProjectInfo(); projectInfo.name = "TEST_PROJECT_NAME"; projectInfo.displayName = "TEST_PROJECT_DISPLAYNAME"; projectInfo.common = "TEST_PROJECT_COMMON"; projectInfo.manager = "TEST_PROJECT_MANAGER"; projectInfo.attachFileSize = 2048L; <START> long projectId = mProjectMapper.createProject(projectInfo.name, projectInfo); <END> assertTrue(projectId > 0); assertEquals(0, mProjectMapper.getProjectScrumWorkersUsername(projectId).size()); String accountName = "TEST_ACCOUNT_NAME"; String nickName = "TEST_ACCOUNT_NICKNAME"; String email = "TEST_ACCOUNT_EMAIL"; String password = "TEST_ACCOUNT_PASSWORD"; AccountObject account = new AccountObject(accountName); account.setNickName(nickName); account.setEmail(email); account.setPassword(password); account.save(); boolean createResult = account.createProjectRole(projectId, RoleEnum.ProductOwner); assertTrue(createResult); ArrayList<String> userNameList = mProjectMapper.getProjectScrumWorkersUsername(projectId); assertEquals(1, userNameList.size()); assertEquals(accountName, userNameList.get(0)); }</code><technical_language>avoid other method</technical_language>

Target:
public void testGetProjectScrumWorkersUsername(){ assertEquals(0, mProjectMapper.getProjectScrumWorkersUsername(mProjectId).size()); String accountName = "TEST_ACCOUNT_NAME"; String nickName = "TEST_ACCOUNT_NICKNAME"; String email = "TEST_ACCOUNT_EMAIL"; String password = "TEST_ACCOUNT_PASSWORD"; AccountObject account = new AccountObject(accountName); account.setNickName(nickName); account.setEmail(email); account.setPassword(password); account.save(); boolean createAcountResult = account.createProjectRole(mProjectId, RoleEnum.ProductOwner); assertTrue(createAcountResult); ArrayList<String> userNameList = mProjectMapper.getProjectScrumWorkersUsername(mProjectId); assertEquals(1, userNameList.size()); assertEquals(accountName, userNameList.get(0)); }
Source:
<code>JsonResponseHistoryServerArchivist(JsonArchivist jsonArchivist, Path archivePath, Executor ioExecutor) { this.jsonArchivist = Preconditions.checkNotNull(jsonArchivist); this.archivePath = Preconditions.checkNotNull(archivePath); <START> this.ioExecutor = ioExecutor; <END> }</code><technical_language>in order symmetric: suggestion this.ioExecutor = Preconditions.checkNotNull(ioExecutor);</technical_language>

Target:
JsonResponseHistoryServerArchivist(JsonArchivist jsonArchivist, Path archivePath, Executor ioExecutor) { this.jsonArchivist = Preconditions.checkNotNull(jsonArchivist); this.archivePath = Preconditions.checkNotNull(archivePath); this.ioExecutor = Preconditions.checkNotNull(ioExecutor); }
Source:
<code><START> public RemotingOkHttpCall doClone() { <END> return new RemotingOkHttpCall(getDelegate().clone(), backoffStrategy, urls, client, schedulingExecutor, executionExecutor, timeout, maxNumRelocations); }</code><technical_language>@j-baker objected doClone methods before... ForwardingCall interface lots of default methods, missing clone getDelegate implementations. rid of a bit of inheritance :)</technical_language>

Target:
public RemotingOkHttpCall doClone() { return new RemotingOkHttpCall(getDelegate().clone(), backoffStrategy, urls, client, schedulingExecutor, executionExecutor, syncCallTimeout, maxNumRelocations); }
Source:
<code>public void completed(AbstractBuild r) { if (skipOnMatrixChildren(r)) { return; } String key = BuildKey.format(r); AbstractProject<?, ?> project = r.getProject(); AbstractBuild<?, ?> previousBuild = project.getLastBuild(); if (null != previousBuild) { do { previousBuild = previousBuild.getPreviousCompletedBuild(); <START> } while ((null != previousBuild && previousBuild.getResult() == Result.ABORTED) || previousBuild.getNumber() == r.getNumber()); <END> if (null != previousBuild) { log.info(key, "found #%d as previous completed, non-aborted build", previousBuild.getNumber()); } else { log.debug(key, "did not find previous completed, non-aborted build"); } NotificationConditions conditions = NotificationConditions.create(notifier, log); if (conditions.test(new Context(r, previousBuild))) { String message = getBuildStatusMessage(r, notifier.getIncludeTestSummary(), notifier.getIncludeFailedTests(), notifier.getIncludeCustomMessage()); if (notifier.getCommitInfoChoice().showAnything()) { message = message + "\n" + getCommitList(r); } slackFactory.apply(r).publish(message, getBuildColor(r)); } } }</code><technical_language>ok, tested out</technical_language>

Target:
public void completed(AbstractBuild r) { if (skipOnMatrixChildren(r)) { return; } String key = BuildKey.format(r); AbstractProject<?, ?> project = r.getProject(); AbstractBuild<?, ?> previousBuild = project.getLastBuild(); if (null != previousBuild) { do { previousBuild = previousBuild.getPreviousCompletedBuild(); } while ((null != previousBuild && previousBuild.getResult() == Result.ABORTED) || (null != previousBuild && previousBuild.getNumber() == r.getNumber())); if (null != previousBuild) { log.info(key, "found #%d as previous completed, non-aborted build", previousBuild.getNumber()); } else { log.debug(key, "did not find previous completed, non-aborted build"); } NotificationConditions conditions = NotificationConditions.create(notifier, log); if (conditions.test(new Context(r, previousBuild))) { String message = getBuildStatusMessage(r, notifier.getIncludeTestSummary(), notifier.getIncludeFailedTests(), notifier.getIncludeCustomMessage()); if (notifier.getCommitInfoChoice().showAnything()) { message = message + "\n" + getCommitList(r); } slackFactory.apply(r).publish(message, getBuildColor(r)); } } }
Source:
<code>public void testIterationStart(LoopIterationEvent event) { JMeterVariables jMeterVariables = JMeterContextService.getContext().getVariables(); if ((getControlledByThread() && !jMeterVariables.isSameUserOnNextIteration()) <START> || getClearEachIteration()) { <END> log.debug("Initialise cookies from pre-defined list"); setProperty(initialCookies.clone()); } }</code><technical_language>getClearEachIteration impacts result matter of getControlledByThread</technical_language>

Target:
public void testIterationStart(LoopIterationEvent event) { JMeterVariables jMeterVariables = JMeterContextService.getContext().getVariables(); if ((getControlledByThread() && !jMeterVariables.isSameUserOnNextIteration()) || (!getControlledByThread() && getClearEachIteration())) { log.debug("Initialise cookies from pre-defined list"); setProperty(initialCookies.clone()); } }
Source:
<code>private void endApplication(@Nullable Thread uncaughtExceptionThread, Throwable th) { final boolean letDefaultHandlerEndApplication = config.alsoReportToAndroidFramework(); final boolean handlingUncaughtException = uncaughtExceptionThread != null; if (!Debug.isDebuggerConnected() && handlingUncaughtException && letDefaultHandlerEndApplication && defaultExceptionHandler != null) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Handing Exception on to default ExceptionHandler"); defaultExceptionHandler.uncaughtException(uncaughtExceptionThread, th); } else { final Activity lastActivity = lastActivityManager.getLastActivity(); if (lastActivity != null) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Finishing the last Activity prior to killing the Process"); lastActivity.runOnUiThread(new Runnable() { @Override public void run() { lastActivity.finish(); if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Finished " + lastActivity.getClass()); } }); if (uncaughtExceptionThread != lastActivity.getMainLooper().getThread()) { lastActivityManager.waitForActivityStop(100); } lastActivityManager.clearLastActivity(); } <START> if (!Debug.isDebuggerConnected()) { <END> android.os.Process.killProcess(android.os.Process.myPid()); System.exit(10); } } }</code><technical_language>checking for !Debug.isDebuggerConnected() once, line#266 line#296, both. If Debugger is connected, do want kill process? do want call defaultExceptionHandler clear Activity</technical_language>

Target:
private void endApplication(@Nullable Thread uncaughtExceptionThread, Throwable th) { final boolean letDefaultHandlerEndApplication = config.alsoReportToAndroidFramework(); final boolean handlingUncaughtException = uncaughtExceptionThread != null; if (handlingUncaughtException && letDefaultHandlerEndApplication && defaultExceptionHandler != null) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Handing Exception on to default ExceptionHandler"); defaultExceptionHandler.uncaughtException(uncaughtExceptionThread, th); } else { finishLastActivity(uncaughtExceptionThread); android.os.Process.killProcess(android.os.Process.myPid()); System.exit(10); } }
Source:
<code><START> public java.util.Optional<ComponentDto> selectById(DbSession session, long id) { <END> return java.util.Optional.ofNullable(mapper(session).selectById(id)); }</code><technical_language>careful, this method is core plugins</technical_language>

Target:
public Optional<ComponentDto> selectById(DbSession session, long id) { return Optional.fromNullable(mapper(session).selectById(id)); }
Source:
<code>} catch (ClassFilterException ex) { <START> LOGGER.log(Level.SEVERE, "Default class filter cannot be initialized. Remoting will not start", ex); <END> throw new IllegalStateException("Default class filter cannot be initialized", ex); }</code><technical_language>Suffices throw ExceptionInInitializerError. (Why Java throw checked exceptions in a static block with, I do know.)</technical_language>

Target:
} catch (ClassFilterException ex) { LOGGER.log(Level.SEVERE, "Default class filter cannot be initialized. Remoting will not start", ex); throw new ExceptionInInitializerError(ex); }
Source:
<code>public void registerForConnectivityEvents(@NonNull Object object, @NonNull ConnectivityChangeListener listener) { <START> if (configuration == null) { <END> throw new IllegalStateException(NOT_INITIALIZED_ERROR); } registerForConnectivityEvents(object, configuration.isNotifyImmediately(), listener); }</code><technical_language>extract this a separate method check trough a couple places this class</technical_language>

Target:
public void registerForConnectivityEvents(@NonNull Object object, @NonNull ConnectivityChangeListener listener) { assertNotNull(configuration); registerForConnectivityEvents(object, configuration.isNotifyImmediately(), listener); }
Source:
<code>public Subscriber<? super Observable[]> call(final Subscriber<? super R> child) { final Zip<R> zipper = new Zip<R>(child, zipFunction); final ZipProducer<R> producer = new ZipProducer<R>(zipper); child.setProducer(producer); <START> return new ZipSubscriber(child, zipper, producer); <END> }</code><technical_language>This conflict a zip patch. undo this</technical_language>

Target:
public Subscriber<? super Observable[]> call(final Subscriber<? super R> child) { final Zip<R> zipper = new Zip<R>(child, zipFunction); final ZipProducer<R> producer = new ZipProducer<R>(zipper); child.setProducer(producer); final ZipSubscriber subscriber = new ZipSubscriber(child, zipper, producer); return subscriber; }
Source:
<code>public BatchItem(final JSONObject event) { this.response = new BatchItemResponse(); this.event = event; Optional. <START> of(event.optJSONObject("metadata")) <END> .map(e -> e.optString("eid")) .ifPresent(this.response::setEid); }</code><technical_language>throw NullPointerException if event.optJSONObject("metadata") is null. Optional.ofNullable</technical_language>

Target:
public BatchItem(final JSONObject event) { this.response = new BatchItemResponse(); this.event = event; Optional. ofNullable(event.optJSONObject("metadata")) .map(e -> e.optString("eid", null)) .ifPresent(this.response::setEid); }
Source:
<code>private static OrcProto.ColumnEncoding toColumnEncoding(ColumnEncoding columnEncodings) { <START> Preconditions.checkArgument( <END> !columnEncodings.getSequenceEncodings().isPresent(), "ORC writer doesn't support flat map encodings: " + columnEncodings); return OrcProto.ColumnEncoding.newBuilder() .setKind(toColumnEncoding(columnEncodings.getColumnEncodingKind())) .setDictionarySize(columnEncodings.getDictionarySize()) .build(); }</code><technical_language>nit: java checkArgument (columnEncodings.getColumnEncodingKind() != DWRF_MAP_FLAT, "Unsupported encoding: " + columnEncodings.getColumnEncodingKind());</technical_language>

Target:
private static OrcProto.ColumnEncoding toColumnEncoding(ColumnEncoding columnEncodings) { checkArgument( !columnEncodings.getAdditionalSequenceEncodings().isPresent(), "Writing columns with non-zero sequence IDs is not supported in ORC: " + columnEncodings); return OrcProto.ColumnEncoding.newBuilder() .setKind(toColumnEncoding(columnEncodings.getColumnEncodingKind())) .setDictionarySize(columnEncodings.getDictionarySize()) .build(); }
Source:
<code><START> public static Coder<?> of() { <END> return new HBaseMutationCoder(); }</code><technical_language>I this Coder<Mutation></technical_language>

Target:
public static Coder<Mutation> of() { return new HBaseMutationCoder(); }
Source:
<code>public void testAutomaticStartStop() throws Exception { final TestRunnable task = new TestRunnable(500); e.execute(task); Thread thread = e.thread; assertThat(thread, is(not(nullValue()))); assertThat(thread.isAlive(), is(true)); thread.join(); <START> assertThat(thread.isAlive(), is(false)); <END> assertThat(task.ran.get(), is(true)); task.ran.set(false); e.execute(task); assertThat(e.thread, not(sameInstance(thread))); thread = e.thread; thread.join(); assertThat(thread.isAlive(), is(false)); assertThat(task.ran.get(), is(true)); }</code><technical_language>remove this too</technical_language>

Target:
public void testAutomaticStartStop() throws Exception { final TestRunnable task = new TestRunnable(500); e.execute(task); Thread thread = e.thread; assertThat(thread, is(not(nullValue()))); assertThat(thread.isAlive(), is(true)); thread.join(); assertThat(task.ran.get(), is(true)); task.ran.set(false); e.execute(task); assertThat(e.thread, not(sameInstance(thread))); thread = e.thread; thread.join(); assertThat(task.ran.get(), is(true)); }
Source:
<code>protected String[] getExecutionOrder(String group) { if (GROUP_TOP_LEVEL.equals(group)) { return new String[] { "stepInitializeBaseSequence", "stepSetEnvironmentVariables", "stepSetExecutable", "stepSetArguments", "stepRemoteConnection", "stepSpecifyCoreFile", "stepStartTrackingBreakpoints", <START> "stepInitializeMemory", END> "stepStartExecution", "stepCleanupBaseSequence", }; } return null; }</code><technical_language>For attach cases do InitializeMemoryFirst trackBreakpoints after. do reverse. a big deal, I wondered if is a reason</technical_language>

Target:
protected String[] getExecutionOrder(String group) { if (GROUP_TOP_LEVEL.equals(group)) { return new String[] { "stepInitializeBaseSequence", "stepSetEnvironmentVariables", "stepSetExecutable", "stepSetArguments", "stepRemoteConnection", "stepSpecifyCoreFile", "stepInitializeMemory", "stepStartTrackingBreakpoints", "stepStartExecution", "stepCleanupBaseSequence", }; } return null; }
Source:
<code>public void onReceive(Context context, Intent intent) { mContext = context; if (MESSAGE_STATUS_RECEIVED_ACTION.equals(intent.getAction())) { Uri messageUri = intent.getData(); byte[] pdu = (byte[]) intent.getExtra("pdu"); SmsMessage message = updateMessageStatus(context, messageUri, pdu); if (message.getStatus() < Sms.STATUS_PENDING) MessagingNotification.nonBlockingUpdateNewMessageIndicator(context, <START> true, message.isStatusReportMessage); <END> } }</code><technical_language>message.isStatusReportMessage -> message.isStatusReportMessage(). Right</technical_language>

Target:
public void onReceive(Context context, Intent intent) { mContext = context; if (MESSAGE_STATUS_RECEIVED_ACTION.equals(intent.getAction())) { Uri messageUri = intent.getData(); byte[] pdu = (byte[]) intent.getExtra("pdu"); SmsMessage message = updateMessageStatus(context, messageUri, pdu); if (message.getStatus() < Sms.STATUS_PENDING) MessagingNotification.nonBlockingUpdateNewMessageIndicator(context, true, message.isStatusReportMessage()); } }
Source:
<code>public Channel retrieve(VeluxBridge bridge) { logger.trace("retrieve() called."); GetWLANConfig bcp = bridge.bridgeAPI().getWLANConfig(); <START> if ((bridge.bridgeCommunicate(bcp)) && (bcp.isCommunicationSuccessful())) { <END> logger.trace("retrieve() found successfully configuration {}.", bcp.getWLANConfig()); channel.wlanSSID = new StringType(bcp.getWLANConfig().getSSID()); channel.wlanPassword = new StringType(bcp.getWLANConfig().getPassword()); channel.isRetrieved = true; return channel; } else { logger.trace("retrieve() finished with failure."); return null; } }</code><technical_language>redundant parentheses</technical_language>

Target:
public Channel retrieve(VeluxBridge bridge) { logger.trace("retrieve() called."); GetWLANConfig bcp = bridge.bridgeAPI().getWLANConfig(); if (bridge.bridgeCommunicate(bcp) && bcp.isCommunicationSuccessful()) { logger.trace("retrieve() found successfully configuration {}.", bcp.getWLANConfig()); channel.openHABwlanSSID = new StringType(bcp.getWLANConfig().getSSID()); channel.openHABwlanPassword = new StringType(bcp.getWLANConfig().getPassword()); channel.isRetrieved = true; return channel; } else { logger.trace("retrieve() finished with failure."); return null; } }
Source:
<code>private void changeLegendLabelHandling() { chartWidget.getOptions().getLegend() .getLabels().setLabelsCallback(new LegendLabelsCallback() { @Override public LegendLabelItem[] generateLegendLabels(IsChart chart) { List<LegendLabelItem> legendItems = new ArrayList<LegendLabelItem>(); List<String> dataLabels = new ArrayList<String>(); for (int i = 0; i < dataModels.size(); ++i) { MockPieChartDataModel model = dataModels.get(i); <START> PieDataset dataset = model.dataSeries; END> List<String> labels = model.getLabels(); dataLabels.addAll(labels); for (int j = 0; j < labels.size(); ++j) { LegendLabelItem legendItem = new LegendLabelItem(); legendItem.setDatasetIndex(i); legendItem.setIndex(j); legendItem.setText(labels.get(j)); legendItem.setFillStyle(dataset.getBackgroundColor().get(j)); legendItems.add(legendItem); } } chartWidget.getData().setLabels(dataLabels.toArray(new String[0])); return legendItems.toArray(new LegendLabelItem[0]); } }); }</code><technical_language>address this TODO</technical_language>

Target:
private void changeLegendLabelHandling() { chartWidget.getOptions().getLegend() .getLabels().setLabelsCallback(new LegendLabelsCallback() { @Override public LegendLabelItem[] generateLegendLabels(IsChart chart) { List<LegendLabelItem> legendItems = new ArrayList<LegendLabelItem>(); List<String> dataLabels = new ArrayList<String>(); for (int i = 0; i < dataModels.size(); ++i) { MockPieChartDataModel model = dataModels.get(i); PieDataset dataset = model.getDataSeries(); List<String> labels = model.getLabels(); dataLabels.addAll(labels); for (int j = 0; j < labels.size(); ++j) { LegendLabelItem legendItem = new LegendLabelItem(); legendItem.setDatasetIndex(i); legendItem.setIndex(j); legendItem.setText(labels.get(j)); legendItem.setFillStyle(dataset.getBackgroundColor().get(j)); legendItems.add(legendItem); } } chartWidget.getData().setLabels(dataLabels.toArray(new String[0])); return legendItems.toArray(new LegendLabelItem[0]); } }); }
Source:
<code>public void setUp() throws Exception { <START> final Indices indices = new Indices( new IndexMappingFactory(new Node(jestClient())), mock(NodeId.class), new NullAuditEventSender(), new EventBus("index-field-type-poller-it"), createIndicesAdapter() ); <END> poller = new IndexFieldTypePoller(jestClient(), indices, new MetricRegistry()); indexSet = new TestIndexSet(indexSetConfig); importFixture("org/graylog2/indexer/fieldtypes/IndexFieldTypePollerIT.json"); }</code><technical_language>a mocked EventBus suppress related Unstable warning. I this before, still... :)</technical_language>

Target:
public void setUp() throws Exception { @SuppressWarnings("UnstableApiUsage") final Indices indices = new Indices( new IndexMappingFactory(new Node(jestClient())), mock(NodeId.class), new NullAuditEventSender(), mock(EventBus.class), createIndicesAdapter() ); poller = new IndexFieldTypePoller(jestClient(), indices, new MetricRegistry()); indexSet = new TestIndexSet(indexSetConfig); importFixture("org/graylog2/indexer/fieldtypes/IndexFieldTypePollerIT.json"); }
Source:
<code>protected void tearDown() throws Exception { super.tearDown(); <START> for (File file : toDelete) delete(file); <END> toDelete.clear(); }</code><technical_language>add block</technical_language>

Target:
protected void tearDown() throws Exception { super.tearDown(); for (File file : toDelete) { delete(file); } toDelete.clear(); }
Source:
<code>protected boolean reconstructMaster() { <START> newMasterStorageDomainId = getNewMaster().getId(); <END> proceedStorageDomainTreatmentByDomainType(getNewMaster(), false); if (getParameters().isInactive() && !getStorageDomain().getId().equals(getNewMasterId())) { executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { setStorageDomainStatus(StorageDomainStatus.Inactive, getCompensationContext()); calcStoragePoolStatusByDomainsStatus(); getCompensationContext().stateChanged(); return null; } }); } if (_isLastMaster) { return stopSpm(); } boolean commandSucceeded = stopSpm(); final List<String> disconnectPoolFormats = Config.<List<String>> getValue( ConfigValues.DisconnectPoolOnReconstruct); if (commandSucceeded && disconnectPoolFormats.contains(getNewMaster().getStorageFormat().getValue())) { commandSucceeded = runVdsCommand( VDSCommandType.DisconnectStoragePool, new DisconnectStoragePoolVDSCommandParameters(getVds().getId(), getStoragePool().getId(), getVds().getVdsSpmId()) ).getSucceeded(); } if (!commandSucceeded) { return false; } List<StoragePoolIsoMap> domains = getStoragePoolIsoMapDAO() .getAllForStoragePool(getStoragePool().getId()); setActionReturnValue(true); return runVdsCommand(VDSCommandType.ReconstructMaster, new ReconstructMasterVDSCommandParameters(getVds().getId(), getVds().getVdsSpmId(), getStoragePool().getId(), getStoragePool().getName(), getNewMasterId(), domains, getStoragePool().getmaster_domain_version())).getSucceeded(); }</code><technical_language>npe occur, getNewMasterId()</technical_language>

Target:
protected boolean reconstructMaster() { newMasterStorageDomainId = getNewMasterId(); proceedStorageDomainTreatmentByDomainType(getNewMaster(), false); if (getParameters().isInactive() && !getStorageDomain().getId().equals(getNewMasterId())) { executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { setStorageDomainStatus(StorageDomainStatus.Inactive, getCompensationContext()); calcStoragePoolStatusByDomainsStatus(); getCompensationContext().stateChanged(); return null; } }); } if (_isLastMaster) { return stopSpm(); } boolean commandSucceeded = stopSpm(); final List<String> disconnectPoolFormats = Config.<List<String>> getValue( ConfigValues.DisconnectPoolOnReconstruct); if (commandSucceeded && disconnectPoolFormats.contains(getNewMaster().getStorageFormat().getValue())) { commandSucceeded = runVdsCommand( VDSCommandType.DisconnectStoragePool, new DisconnectStoragePoolVDSCommandParameters(getVds().getId(), getStoragePool().getId(), getVds().getVdsSpmId()) ).getSucceeded(); } if (!commandSucceeded) { return false; } List<StoragePoolIsoMap> domains = getStoragePoolIsoMapDAO() .getAllForStoragePool(getStoragePool().getId()); setActionReturnValue(true); return runVdsCommand(VDSCommandType.ReconstructMaster, new ReconstructMasterVDSCommandParameters(getVds().getId(), getVds().getVdsSpmId(), getStoragePool().getId(), getStoragePool().getName(), getNewMasterId(), domains, getStoragePool().getMasterDomainVersion())).getSucceeded(); }
Source:
<code>Optional<BufferAndAvailability> getNextBuffer() throws IOException, InterruptedException { checkError(); ResultSubpartitionView subpartitionView = this.subpartitionView; if (subpartitionView == null) { if (isReleased) { return Optional.empty(); } subpartitionView = checkAndWaitForSubpartitionView(); } BufferAndBacklog next = subpartitionView.getNextBuffer(); if (next == null) { if (subpartitionView.isReleased()) { throw new CancelTaskException("Consumed partition " + subpartitionView + " has been released."); } else { return Optional.empty(); } } Buffer buffer = next.buffer(); CheckpointBarrier notifyReceivedBarrier = parseCheckpointBarrierOrNull(buffer); if (notifyReceivedBarrier != null) { receivedCheckpointId = notifyReceivedBarrier.getId(); <START> } else if (receivedCheckpointId < lastRequestedCheckpointId) { <END> inputGate.getBufferReceivedListener().notifyBufferReceived(buffer.retainBuffer(), channelInfo); } numBytesIn.inc(buffer.getSize()); numBuffersIn.inc(); return Optional.of(new BufferAndAvailability(buffer, next.isDataAvailable(), next.buffersInBacklog())); }</code><technical_language>&& buffer.isBuffer()</technical_language>

Target:
Optional<BufferAndAvailability> getNextBuffer() throws IOException, InterruptedException { checkError(); ResultSubpartitionView subpartitionView = this.subpartitionView; if (subpartitionView == null) { if (isReleased) { return Optional.empty(); } subpartitionView = checkAndWaitForSubpartitionView(); } BufferAndBacklog next = subpartitionView.getNextBuffer(); if (next == null) { if (subpartitionView.isReleased()) { throw new CancelTaskException("Consumed partition " + subpartitionView + " has been released."); } else { return Optional.empty(); } } Buffer buffer = next.buffer(); CheckpointBarrier notifyReceivedBarrier = parseCheckpointBarrierOrNull(buffer); if (notifyReceivedBarrier != null) { receivedCheckpointId = notifyReceivedBarrier.getId(); } else if (receivedCheckpointId < lastRequestedCheckpointId && buffer.isBuffer()) { inputGate.getBufferReceivedListener().notifyBufferReceived(buffer.retainBuffer(), channelInfo); } numBytesIn.inc(buffer.getSize()); numBuffersIn.inc(); return Optional.of(new BufferAndAvailability(buffer, next.isDataAvailable(), next.buffersInBacklog())); }
Source:
<code>public boolean runFlakyTest(boolean testIsFlaky, String description) { if (debug()) { System.out.println("DEBUG: run.flaky.tests.debug: "+debug()); System.out.println("DEBUG: run.flaky.tests: "+runFlakyTests()); System.out.println("DEBUG: testIsFlaky : "+testIsFlaky); System.out.println("DEBUG: description : "+description); } if ("FALSE".equalsIgnoreCase(runFlakyTests())) { if (debug()) { <START> System.out.println("DEBUG: test will run: "+!testIsFlaky); <END> } return !testIsFlaky; } else if ("NONE".equalsIgnoreCase(runFlakyTests())) { if (debug()) { System.out.println("DEBUG: test will NOT be run!"); } return false; } else { if (debug()) { System.out.println("DEBUG: test WILL be run!"); } return true; } }</code><technical_language>more clear if print "test run" "test run"</technical_language>

Target:
public boolean runFlakyTest(boolean testIsFlaky, String description) { if (DEBUG) { System.out.println("DEBUG: run.flaky.tests.debug: "+debug()); System.out.println("DEBUG: run.flaky.tests: "+RUN_FLAKY_TESTS); System.out.println("DEBUG: testIsFlaky : "+testIsFlaky); System.out.println("DEBUG: description : "+description); } if ("FALSE".equalsIgnoreCase(RUN_FLAKY_TESTS)) { if (DEBUG) { System.out.println("DEBUG: test will run: "+!testIsFlaky); } return !testIsFlaky; } else if ("NONE".equalsIgnoreCase(RUN_FLAKY_TESTS)) { if (DEBUG) { System.out.println("DEBUG: test will NOT be run!"); } return false; } else { if (DEBUG) { System.out.println("DEBUG: test WILL be run!"); } return true; } }
Source:
<code><START> public AdvancedNetworkConfig setEndpointConfigs(Map<EndpointQualifier, EndpointConfig> endpointConfigs) { <END> this.endpointConfigs.clear(); this.endpointConfigs.putAll(endpointConfigs); return this; }</code><technical_language>EndpointQualifier is internal class</technical_language>

Target:
public AdvancedNetworkConfig setEndpointConfigs(Map<EndpointQualifier, EndpointConfig> endpointConfigs) { for (Map.Entry<EndpointQualifier, EndpointConfig> entry : endpointConfigs.entrySet()) { entry.getValue().setProtocolType(entry.getKey().getType()); } for (ProtocolType protocolType : ProtocolType.values()) { int count = countEndpointConfigs(endpointConfigs, protocolType); if (count > protocolType.getServerSocketCardinality()) { throw new InvalidConfigurationException("Protocol type " + protocolType + " does not allow more than " + protocolType.getServerSocketCardinality() + " server sockets but " + count + " were defined"); } } this.endpointConfigs.clear(); this.endpointConfigs.putAll(endpointConfigs); return this; }
Source:
<code>private static Oid getOid() { Oid oid = null; try { <START> oid = new Oid("1.3.6.1.5.5.2"); <END> } catch (GSSException gsse) { log.error("Unable to create OID 1.3.6.1.5.5.2 !"+ gsse.toString()); } return oid; }</code><technical_language>constants</technical_language>

Target:
private static Oid getOid() { Oid oid = null; try { oid = new Oid(IWAConstants.OID); } catch (GSSException gsse) { log.error("Unable to create OID " + IWAConstants.OID + " !" + gsse.toString()); } return oid; }
Source:
<code>private boolean tryLockVmForUpdate(Pair<VM, VmInternalData> pair) { Guid vmId = getVmId(pair); if (vmId != null) { VmManager vmManager = getResourceManager().getVmManager(vmId); <START> if (vmManager.isLatestData(pair.getSecond(), vdsManager.getVdsId()) && vmManager.trylock()) { <END> if (fetchTime - vmManager.getVmDataChangedTime() <= 0) { log.warn("skipping VM '{}' from this monitoring cycle" + " - the VM data has changed since fetching the data", vmId); vmManager.unlock(); } else { vmManagers.put(vmId, vmManager); return true; } } else { log.debug("skipping VM '{}' from this monitoring cycle" + " - the VM is locked by its VmManager ", getVmId(pair)); } } return false; }</code><technical_language>safer lock check-and-update time stamp</technical_language>

Target:
private boolean tryLockVmForUpdate(Pair<VM, VmInternalData> pair) { Guid vmId = getVmId(pair); if (vmId != null) { VmManager vmManager = getResourceManager().getVmManager(vmId); if (vmManager.trylock()) { if (!vmManager.isLatestData(pair.getSecond(), vdsManager.getVdsId())) { log.warn("skipping VM '{}' from this monitoring cycle" + " - newer VM data was already processed", vmId); vmManager.unlock(); } else if (fetchTime - vmManager.getVmDataChangedTime() <= 0) { log.warn("skipping VM '{}' from this monitoring cycle" + " - the VM data has changed since fetching the data", vmId); vmManager.unlock(); } else { vmManagers.put(vmId, vmManager); return true; } } else { log.debug("skipping VM '{}' from this monitoring cycle" + " - the VM is locked by its VmManager ", getVmId(pair)); } } return false; }
Source:
<code>private Object[] consumedArguments(Object[] arguments, Method templateMethod) { <END> return arguments; }</code><technical_language>This in place of parameters is ArgumentsAccessor annotated @AggregateWith, i.e. isAggregate(parameter) is true for method parameter</technical_language>

Target:
private Object[] consumedArguments(Object[] arguments, Method templateMethod) { boolean hasAggregate = Arrays.stream(templateMethod.getParameters()) .anyMatch(ParameterizedTestParameterResolver::isAggregate); int parametersCount = templateMethod.getParameterCount(); return hasAggregate ? arguments : (arguments.length > parametersCount ? Arrays.copyOf(arguments, parametersCount) : arguments); }
Source:
<code><START> private void mapBuildsToDeploymentConfigs(Collection<IBuild> builds) { <END> for (IBuild build : builds) { mapBuildToDeploymentConfig(build); } }</code><technical_language>builds.forEach(b -> mapBuildToDeploymentConfig(b)), if hate brackets</technical_language>

Target:
private void mapBuildsToDeploymentConfigs(Collection<IBuild> builds) { builds.forEach(build->mapBuildToDeploymentConfig(build)); }
Source:
<code>public void setupSourceLayers(StatisticalDatasource source) { final DatasourceHelper helper = DatasourceHelper.getInstance(); final DataSource dataSource = helper.getDataSource(helper.getOskariDataSourceName()); final SqlSessionFactory factory = initializeIBatis(dataSource); try (final SqlSession session = factory.openSession()) { final List<DatasourceLayer> layerRows = session.getMapper(DatasourceLayerMapper.class).getLayersForDatasource(source.getId()); <START> Map<Long, List<Permissions>> permissions = ServiceFactory.getPermissionsService() <END> .getPermissionsForLayers(layerRows.stream() .map(DatasourceLayer::getMaplayerId) .collect(Collectors.toList()), Permissions.PERMISSION_TYPE_VIEW_LAYER); layerRows.forEach( layer -> layer.addRoles(getRoleIdsForLayer( permissions.get(layer.getMaplayerId())))); source.setLayers(layerRows); } }</code><technical_language>This is difficult read due current indenting line breaks. if maplayerIds collected a separate line</technical_language>

Target:
public void setupSourceLayers(StatisticalDatasource source) { final DatasourceHelper helper = DatasourceHelper.getInstance(); final DataSource dataSource = helper.getDataSource(helper.getOskariDataSourceName()); final SqlSessionFactory factory = initializeIBatis(dataSource); try (final SqlSession session = factory.openSession()) { final List<DatasourceLayer> layerRows = session.getMapper(DatasourceLayerMapper.class).getLayersForDatasource(source.getId()); List<Long> layerIdList = layerRows.stream() .map(DatasourceLayer::getMaplayerId) .collect(Collectors.toList()); Map<Long, List<Permissions>> permissions = ServiceFactory.getPermissionsService() .getPermissionsForLayers(layerIdList, Permissions.PERMISSION_TYPE_VIEW_LAYER); layerRows.forEach(layer -> attachRoles(layer, permissions)); source.setLayers(layerRows); } }
Source:
<code>public List<EncounterTransaction.DrugOrder> mapDrugOrders(Encounter encounter) { List<EncounterTransaction.DrugOrder> orders = new ArrayList<EncounterTransaction.DrugOrder>(); for (Order order : encounter.getOrders()) { <START> if (DrugOrder.class.equals(order.getOrderType().getJavaClass())) { <END> if (order instanceof HibernateProxy) { Hibernate.initialize(order); order = (DrugOrder) ((HibernateProxy) order).getHibernateLazyInitializer().getImplementation(); } orders.add(mapDrugOrder((DrugOrder) order)); } } return orders; }</code><technical_language>I checking type of object is safe java class property</technical_language>

Target:
public List<EncounterTransaction.DrugOrder> mapDrugOrders(Encounter encounter) { List<EncounterTransaction.DrugOrder> orders = new ArrayList<EncounterTransaction.DrugOrder>(); for (Order order : encounter.getOrders()) { order = HibernateUtil.getRealObjectFromProxy(order); if (DrugOrder.class.equals(order.getClass())) { orders.add(mapDrugOrder((DrugOrder) order)); } } return orders; }
Source:
<code>public Boolean exists(Collection<Object> collection, LambdaValue lambda) { Boolean result = Boolean.FALSE; if (collection != null && lambda == null) { result = Boolean.FALSE; } else { <START> for (Object input : collection) { <END> try { if (Boolean.TRUE.equals(lambda.eval(new Object[] {input }))) { result = Boolean.TRUE; break; } } catch (Exception e) { } } } return result; }</code><technical_language>Do want potential NPE in there? if checks if collection != null, "can" a null collection. is caught catch below. argue "if lambda == null" result is FALSE in cases, collection is null not</technical_language>

Target:
public Boolean exists(Collection<Object> collection, LambdaValue lambda) { Boolean result = Boolean.FALSE; if (collection != null && lambda != null) { for (Object input : collection) { try { if (Boolean.TRUE.equals(lambda.eval(new Object[] {input }))) { result = Boolean.TRUE; break; } } catch (Exception e) { } } } return result; }
Source:
<code>public int estimatedInMemorySize() { return SIZE_OF_KHYPERLOGLOG + SIZE_OF_RBTREEMAP + minhash.size() * SIZE_OF_LONG + <START> minhash.values().stream().mapToInt(HyperLogLog::estimatedInMemorySize).sum(); <END> }</code><technical_language>discussed, want try compute this in this method</technical_language>

Target:
public int estimatedInMemorySize() { return SIZE_OF_KHYPERLOGLOG + SIZE_OF_RBTREEMAP + minhash.size() * SIZE_OF_LONG + hllsTotalEstimatedInMemorySize * SIZE_OF_BYTE; }
Source:
<code>public List<RecordedEvent> deserializeRecordedEvents(String filePath) { List<RecordedEvent> events = new ArrayList<>(); try (Reader reader = new FileReader(filePath)) { Gson gson = new GsonBuilder().create(); <START> PersistedData record = gson.fromJson(reader, GsonPersistedData.class); <END> Optional<List<RecordedEvent>> recordedEvents = recordedEventListTypeHandler.deserialize(record); recordedEvents.ifPresent(events::addAll); } catch (IOException e) { logger.error("Error while serializing recorded events", e); } return events; }</code><technical_language>Similar above, read JSON a PersistedData, read a JsonElement create a new GsonPersistedData JSON element. Reference: <LINK_0></technical_language>

Target:
public List<RecordedEvent> deserializeRecordedEvents(String filePath) { List<RecordedEvent> events = new ArrayList<>(); try (Reader reader = new FileReader(filePath)) { Gson gson = new GsonBuilder().create(); JsonElement jsonElement = gson.fromJson(reader, JsonElement.class); PersistedData persistedData = new GsonPersistedData(jsonElement); Optional<List<RecordedEvent>> recordedEvents = recordedEventListTypeHandler.deserialize(persistedData); recordedEvents.ifPresent(events::addAll); if (!recordedEvents.isPresent()) { logger.error("Some problem occurred during deserialization, no recorded events was found"); } } catch (IOException e) { logger.error("Error while serializing recorded events", e); } return events; }
Source:
<code>private static void validateFilterKeys(Set<String> metricsKeys) { String invalidKeys = metricsKeys.stream() <START> .filter(k -> !METRIC_KEYS.contains(k)) <END> .map(k -> '\''+k+'\'') .collect(Collectors.joining(", ")); checkArgument(invalidKeys.isEmpty(), "Following metrics are not supported: %s", invalidKeys); }</code><technical_language>'k' is hard understand => please rename 'metric' 'metricKey'</technical_language>

Target:
private static void validateFilterKeys(Set<String> metricsKeys) { String invalidKeys = metricsKeys.stream() .filter(metric -> !METRIC_KEYS.contains(metric)) .map(metric -> '\''+metric+'\'') .collect(Collectors.joining(", ")); checkArgument(invalidKeys.isEmpty(), "Following metrics are not supported: %s", invalidKeys); }
Source:
<code>public synchronized void close() { if (mSaslClient != null) { try { mSaslClient.dispose(); <START> mSaslClient = null; <END> } catch (SaslException exc) { LOG.debug("Failed to close SaslClient.", exc); } } }</code><technical_language>do want this non-null if is issue dispose? Basically, set null in finally here</technical_language>

Target:
public synchronized void close() { if (mSaslClient != null) { try { mSaslClient.dispose(); } catch (SaslException exc) { LOG.debug("Failed to close SaslClient.", exc); } finally { mSaslClient = null; } } }
Source:
<code>protected void makeInnerQualifyingSet() { if (presentStream == null) { numInnerRows = inputQualifyingSet.getPositionCount(); hasNulls = false; return; } hasNulls = true; boolean nonDeterministic = filter != null && !deterministicFilter; if (innerQualifyingSet == null) { innerQualifyingSet = new QualifyingSet(); } int[] inputRows = inputQualifyingSet.getPositions(); int numActive = inputQualifyingSet.getPositionCount(); innerQualifyingSet.reset(numActive); int prevRow = 0; int prevInner = innerPosInRowGroup; numNullsToAdd = 0; <START> boolean keepNulls = filter == null || (!nonDeterministic && filter.testNull()); <END> for (int activeIdx = 0; activeIdx < numActive; activeIdx++) { int row = inputRows[activeIdx] - posInRowGroup; if (!present[row]) { if (keepNulls) { addNullToKeep(inputRows[activeIdx], activeIdx); } } else { prevInner += countPresent(prevRow, row); prevRow = row; innerQualifyingSet.append(prevInner, activeIdx); } } numInnerRows = innerQualifyingSet.getPositionCount(); int skip = countPresent(prevRow, inputQualifyingSet.getEnd() - posInRowGroup); innerQualifyingSet.setEnd(skip + prevInner); }</code><technical_language>nonDeterministic variable is once; inlining simplifies code to: boolean keepNulls = filter == null || (deterministicFilter && filter.testNull()); However, logic handle nulls for non-deterministic filters I is. give a pointer</technical_language>

Target:
protected void makeInnerQualifyingSet() { if (presentStream == null) { numInnerRows = inputQualifyingSet.getPositionCount(); hasNulls = false; return; } hasNulls = true; if (innerQualifyingSet == null) { innerQualifyingSet = new QualifyingSet(); } int[] inputRows = inputQualifyingSet.getPositions(); int numActive = inputQualifyingSet.getPositionCount(); innerQualifyingSet.reset(numActive); int prevRow = 0; int prevInner = innerPosInRowGroup; numNullsToAdd = 0; boolean keepNulls = filter == null || (deterministicFilter && filter.testNull()); for (int activeIdx = 0; activeIdx < numActive; activeIdx++) { int row = inputRows[activeIdx] - posInRowGroup; if (!present[row]) { if (keepNulls) { addNullToKeep(inputRows[activeIdx], activeIdx); } } else { prevInner += countPresent(prevRow, row); prevRow = row; innerQualifyingSet.append(prevInner, activeIdx); } } numInnerRows = innerQualifyingSet.getPositionCount(); int skip = countPresent(prevRow, inputQualifyingSet.getEnd() - posInRowGroup); innerQualifyingSet.setEnd(skip + prevInner); }
Source:
<code>private void setupEditors() { BooleanFieldEditor invertColors = new BooleanFieldEditor(IGdbDebugPreferenceConstants.PREF_CONSOLE_INVERTED_COLORS, MessagesForPreferences.GdbConsolePreferencePage_INVERT_COLORS, getFieldEditorParent()); IntegerFieldEditor editorBufferSize = new IntegerFieldEditor(IGdbDebugPreferenceConstants.PREF_CONSOLE_BUFFERLINES, MessagesForPreferences.GdbConsolePreferencePage_BUFFERLINES, getFieldEditorParent()); <START> editorBufferSize.setValidRange(MIN_BUFFER_LINES, Integer.MAX_VALUE); <END> addField(invertColors); addField(editorBufferSize); }</code><technical_language>Done in patchset 11</technical_language>

Target:
private void setupEditors() { BooleanFieldEditor invertColors = new BooleanFieldEditor(IGdbDebugPreferenceConstants.PREF_CONSOLE_INVERTED_COLORS, MessagesForPreferences.GdbConsolePreferencePage_InvertColors, getFieldEditorParent()); IntegerFieldEditor editorBufferSize = new IntegerFieldEditor(IGdbDebugPreferenceConstants.PREF_CONSOLE_BUFFERLINES, MessagesForPreferences.GdbConsolePreferencePage_BufferLines, getFieldEditorParent()); editorBufferSize.setValidRange(MIN_BUFFER_LINES, 2000000000); addField(invertColors); addField(editorBufferSize); }
Source:
<code>private JsonObject toJson(Timer timer, TimeUnit rateUnit, TimeUnit durationUnit) { Snapshot snapshot = timer.getSnapshot(); JsonObject json = new JsonObject(); populateMetered(json, timer, rateUnit); double factor = 1.0 / durationUnit.toNanos(1); populateSnapshot(json, snapshot, factor); <START> String duration = durationUnit.toString().toLowerCase(Locale.US); <END> json.putString("durationRate", duration); return json; }</code><technical_language>US</technical_language>

Target:
private JsonObject toJson(Timer timer, TimeUnit rateUnit, TimeUnit durationUnit) { Snapshot snapshot = timer.getSnapshot(); JsonObject json = new JsonObject(); populateMetered(json, timer, rateUnit); double factor = 1.0 / durationUnit.toNanos(1); populateSnapshot(json, snapshot, factor); String duration = durationUnit.toString().toLowerCase(); json.putString("durationRate", duration); return json; }