auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public int hashCode() { <END> int hash = 1; final int prime = 31; hash = hash * prime + (int) (delegate.hashCode()); return hash; }</code><technical_language>be: java public int hashCode() { return this.delegate.hashCode(); }</technical_language>

Target:
public int hashCode() { return this.delegate.hashCode(); }
Source:
<code>public void match(final AbstractInsnNode start, final IFilterOutput output) { if (Opcodes.IFNONNULL != start.getOpcode()) { return; } cursor = start; nextIsNew(KOTLIN_TYPE_CAST_EXCEPTION); nextIs(Opcodes.DUP); nextIs(Opcodes.LDC); if (cursor == null) { return; } final LdcInsnNode ldc = (LdcInsnNode) cursor; <START> if (ldc.cst.getClass() != String.class) { <END> return; } if (!((String) ldc.cst) .startsWith("null cannot be cast to non-null type")) { return; } nextIsInvokeSuper(KOTLIN_TYPE_CAST_EXCEPTION, "(Ljava/lang/String;)V"); nextIs(Opcodes.ATHROW); if (cursor == null) { return; } if (cursor.getNext() != ((JumpInsnNode) start).label) { return; } output.ignore(start, cursor); }</code><technical_language>simply instanceof here? if (!(ldc.cst instanceof String)) {</technical_language>

Target:
public void match(final AbstractInsnNode start, final IFilterOutput output) { if (Opcodes.IFNONNULL != start.getOpcode()) { return; } cursor = start; nextIsNew(KOTLIN_TYPE_CAST_EXCEPTION); nextIs(Opcodes.DUP); nextIs(Opcodes.LDC); if (cursor == null) { return; } final LdcInsnNode ldc = (LdcInsnNode) cursor; if (!(ldc.cst instanceof String && ((String) ldc.cst) .startsWith("null cannot be cast to non-null type"))) { return; } nextIsInvokeSuper(KOTLIN_TYPE_CAST_EXCEPTION, "(Ljava/lang/String;)V"); nextIs(Opcodes.ATHROW); if (cursor == null) { return; } if (cursor.getNext() != ((JumpInsnNode) start).label) { return; } output.ignore(start, cursor); }
Source:
<code>void setup(AlertDialog.Builder builder, TriggerType triggerType) { if (triggerType == TriggerType.DIALOG_POSITIVE) { if (isLabelResourceBased) { builder.setPositiveButton(buttonLabelResourceId, new DialogButtonActionPerformer(action)); } else { builder.setPositiveButton(buttonLabel, new DialogButtonActionPerformer(action)); } } else if (triggerType == TriggerType.DIALOG_NEGATIVE) { if (isLabelResourceBased) { builder.setNegativeButton(buttonLabelResourceId, new DialogButtonActionPerformer(action)); } else { builder.setNegativeButton(buttonLabel, new DialogButtonActionPerformer(action)); } <START> } else if (triggerType == TriggerType.DIALOG_NEUTRAL) { <END> if (isLabelResourceBased) { builder.setNegativeButton(buttonLabelResourceId, new DialogButtonActionPerformer(action)); } else { builder.setNegativeButton(buttonLabel, new DialogButtonActionPerformer(action)); } } }</code><technical_language>this neutral mean</technical_language>

Target:
void setup(AlertDialog.Builder builder, TriggerType triggerType) { if (triggerType == TriggerType.DIALOG_POSITIVE) { if (isLabelResourceBased) { builder.setPositiveButton(buttonLabelResourceId, new DialogButtonActionPerformer(action)); } else { builder.setPositiveButton(buttonLabel, new DialogButtonActionPerformer(action)); } } else if (triggerType == TriggerType.DIALOG_NEGATIVE) { if (isLabelResourceBased) { builder.setNegativeButton(buttonLabelResourceId, new DialogButtonActionPerformer(action)); } else { builder.setNegativeButton(buttonLabel, new DialogButtonActionPerformer(action)); } } else if (triggerType == TriggerType.DIALOG_NEUTRAL) { if (isLabelResourceBased) { builder.setNeutralButton(buttonLabelResourceId, new DialogButtonActionPerformer(action)); } else { builder.setNeutralButton(buttonLabel, new DialogButtonActionPerformer(action)); } } }
Source:
<code>public void addCompletedTransactionTask(CompleteTransactionTask task, Boolean missingTxn) { if (task.getTimestamp() == CompleteTransactionMessage.INITIAL_TIMESTAMP && (hasRestartCompletion(task) || missingTxn)) { return; } if (task.getTimestamp() != CompleteTransactionMessage.INITIAL_TIMESTAMP && m_fragTask != null && m_fragTask.getTxnId() == task.getMsgTxnId()) { m_fragTask = null; } Pair<CompleteTransactionTask, Boolean> pair = m_compTasks.get(task.getMsgTxnId()); if ( pair == null) { m_compTasks.put(task.getMsgTxnId(), Pair.of(task, missingTxn)); } else { if ( task.getTimestamp() > pair.getFirst().getTimestamp() && isComparable(pair.getFirst(), task)) { <START> m_compTasks.remove(task.getMsgTxnId()); <END> m_compTasks.put(task.getMsgTxnId(), Pair.of(task, missingTxn)); } } }</code><technical_language>Call put() is sufficient replace tree map</technical_language>

Target:
public void addCompletedTransactionTask(CompleteTransactionTask task, Boolean missingTxn) { if (task.getTimestamp() == CompleteTransactionMessage.INITIAL_TIMESTAMP && (hasRestartCompletion(task) || missingTxn)) { return; } if (task.getTimestamp() != CompleteTransactionMessage.INITIAL_TIMESTAMP && m_fragTask != null && m_fragTask.getTxnId() == task.getMsgTxnId()) { m_fragTask = null; } Pair<CompleteTransactionTask, Boolean> pair = m_compTasks.get(task.getMsgTxnId()); if ( pair == null) { m_compTasks.put(task.getMsgTxnId(), Pair.of(task, missingTxn)); } else { if ( task.getTimestamp() > pair.getFirst().getTimestamp() && isComparable(pair.getFirst(), task)) { m_compTasks.put(task.getMsgTxnId(), Pair.of(task, missingTxn)); } } }
Source:
<code>public void importSources(FolderEntry baseFolder, SourceStorage sourceStorage, LineConsumerFactory lineConsumerFactory) throws ForbiddenException, ConflictException, UnauthorizedException, IOException, ServerException { if (!baseFolder.isFolder()) { throw new IOException("Project cannot be imported into \"" + baseFolder.getName() + "\". " + "It is not a folder."); } this.subversionApi.setOutputLineConsumerFactory(lineConsumerFactory); subversionApi.checkout(newDto(CheckoutRequest.class) .withProjectPath(baseFolder.getVirtualFile().toIoFile().getAbsolutePath()) .withUrl(sourceStorage.getLocation()) <START> .withUserName(sourceStorage.getParameters().remove("userName")) <END> .withPassword(sourceStorage.getParameters().remove("password"))); }</code><technical_language>avoid usage of username password in sourceStorage all</technical_language>

Target:
public void importSources(FolderEntry baseFolder, SourceStorage sourceStorage, LineConsumerFactory lineConsumerFactory) throws ForbiddenException, ConflictException, UnauthorizedException, IOException, ServerException { if (!baseFolder.isFolder()) { throw new IOException("Project cannot be imported into \"" + baseFolder.getName() + "\". " + "It is not a folder."); } this.subversionApi.setOutputLineConsumerFactory(lineConsumerFactory); subversionApi.checkout(newDto(CheckoutRequest.class) .withProjectPath(baseFolder.getVirtualFile().toIoFile().getAbsolutePath()) .withUrl(sourceStorage.getLocation()) .withUsername(sourceStorage.getParameters().remove("username")) .withPassword(sourceStorage.getParameters().remove("password"))); }
Source:
<code>private boolean next(List<Cell> results, boolean raw) throws IOException { <START> boolean hasMore = raw ? delegate.nextRaw(results) : delegate.next(results); <END> if (pageFilter == null) { return hasMore; } if (!hasMore) { if (pageFilter.isStopped()) { delegate.close(); byte[] rowKey = pageFilter.getRowKeyAtStop(); scan.withStartRow(rowKey, true); delegate = region.getScanner(scan); if (results.isEmpty()) { getDummyResult(rowKey, results); } pageFilter.init(); return true; } return false; } else { pageFilter.resetStartTime(); } return true; }</code><technical_language>if throw exception line 47 line 56, do clean state properly</technical_language>

Target:
private boolean next(List<Cell> results, boolean raw) throws IOException { try { boolean hasMore = raw ? delegate.nextRaw(results) : delegate.next(results); if (pageFilter == null) { return hasMore; } if (!hasMore) { if (pageFilter.isStopped()) { delegate.close(); byte[] rowKey = pageFilter.getRowKeyAtStop(); scan.withStartRow(rowKey, true); delegate = region.getScanner(scan); if (results.isEmpty()) { getDummyResult(rowKey, results); } pageFilter.init(); return true; } return false; } else { pageFilter.resetStartTime(); return true; } } catch (Exception e) { pageFilter.init(); throw e; } }
Source:
<code>public OracleQuarterDiffFunction() { <START> super("(select sign(i1) * floor(abs(i1)) from (values (trunc(-months_between(?1, ?2))/3)) as temp(i1))"); <END> }</code><technical_language>a cast int enough</technical_language>

Target:
public OracleQuarterDiffFunction() { super("trunc(-months_between(?1, ?2)/3)"); }
Source:
<code>public List<DCInputSet> getInputsByCollectionHandle(String collectionHandle) throws DCInputsReaderException { SubmissionConfig config; try { config = new SubmissionConfigReader().getSubmissionConfigByCollection(collectionHandle); String formName = config.getSubmissionName(); if (formName == null) { throw new DCInputsReaderException("No form designated as default"); } List<DCInputSet> results = new ArrayList<DCInputSet>(); for (int idx = 0; idx < config.getNumberOfSteps(); idx++) { SubmissionStepConfig step = config.getStep(idx); if(SubmissionStepConfig.INPUT_FORM_STEP_NAME.equals(step.getType())) { results.add(getInputsByFormName(step.getId())); } } return results; <START> } catch (ServletException e) { <END> throw new DCInputsReaderException("No form designated as default"); } }</code><technical_language>is a ServletException in API module</technical_language>

Target:
public List<DCInputSet> getInputsByCollectionHandle(String collectionHandle) throws DCInputsReaderException { SubmissionConfig config; try { config = new SubmissionConfigReader().getSubmissionConfigByCollection(collectionHandle); String formName = config.getSubmissionName(); if (formName == null) { throw new DCInputsReaderException("No form designated as default"); } List<DCInputSet> results = new ArrayList<DCInputSet>(); for (int idx = 0; idx < config.getNumberOfSteps(); idx++) { SubmissionStepConfig step = config.getStep(idx); if(SubmissionStepConfig.INPUT_FORM_STEP_NAME.equals(step.getType())) { results.add(getInputsByFormName(step.getId())); } } return results; } catch (SubmissionConfigReaderException e) { throw new DCInputsReaderException("No form designated as default", e); } }
Source:
<code>public List<String> getInvalidityInfo() { FieldValidator validator = new FieldValidator(); List<String> errors = new ArrayList<String>(); String error; error = validator.getInvalidityInfo(FieldValidator.FieldType.GOOGLE_ID, googleId); if (!error.isEmpty()) { errors.add(error); } error = shortName.isEmpty() ? "" : validator.getInvalidityInfo( <START> FieldValidator.FieldType.PERSON_NAME, shortName); <END> if (!error.isEmpty()) { errors.add(error); } error = email.isEmpty() ? "" : validator.getInvalidityInfo( FieldValidator.FieldType.EMAIL, email); if (!error.isEmpty()) { errors.add(error); } error = institute.isEmpty() ? "" : validator.getInvalidityInfo( FieldValidator.FieldType.INSTITUTE_NAME, institute); if (!error.isEmpty()) { errors.add(error); } error = nationality.isEmpty() ? "" : validator.getInvalidityInfo( FieldValidator.FieldType.NATIONALITY, nationality); if (!error.isEmpty()) { errors.add(error); } error = validator.getInvalidityInfo(FieldValidator.FieldType.GENDER, gender); if (!error.isEmpty()) { errors.add(error); } Assumption.assertNotNull(this.pictureKey); return errors; }</code><technical_language>align ? : for readability? error = shortName.isEmpty() ? "" : validator.getInvalidityInfo(FieldValidator.FieldType.PERSON_NAME, shortName);</technical_language>

Target:
public List<String> getInvalidityInfo() { FieldValidator validator = new FieldValidator(); List<String> errors = new ArrayList<String>(); String error; error = validator.getInvalidityInfo(FieldValidator.FieldType.GOOGLE_ID, googleId); if (!error.isEmpty()) { errors.add(error); } if (!shortName.isEmpty()) { error = validator.getInvalidityInfo(FieldValidator.FieldType.PERSON_NAME, shortName); if (!error.isEmpty()) { errors.add(error); } } if (!email.isEmpty()) { error = validator.getInvalidityInfo(FieldValidator.FieldType.EMAIL, email); if (!error.isEmpty()) { errors.add(error); } } if (!institute.isEmpty()) { error = validator.getInvalidityInfo(FieldValidator.FieldType.INSTITUTE_NAME, institute); if (!error.isEmpty()) { errors.add(error); } } if (!nationality.isEmpty()) { error = validator.getInvalidityInfo(FieldValidator.FieldType.NATIONALITY, nationality); if (!error.isEmpty()) { errors.add(error); } } error = validator.getInvalidityInfo(FieldValidator.FieldType.GENDER, gender); if (!error.isEmpty()) { errors.add(error); } Assumption.assertNotNull(this.pictureKey); return errors; }
Source:
<code><START> public static void reLogin() throws UnknownHostException, ClassNotFoundException, SQLException{ <END> Login login = new Login(); login.setVisible(true); System.out.println("Got HEre"); }</code><technical_language>do this method chain throw exceptions stack bury in end? If intend do handling of exceptions, handle of reLogin() method calls cleaner</technical_language>

Target:
public static void reLogin(){ Login login = new Login(); login.setVisible(true); }
Source:
<code>private void fillDropDown(final String value, final String[] enumeratedValues, final boolean isMultipleSelect, final ListBox listBox) { listBox.clear(); final Set<String> currentValues = getCurrentValues(value, isMultipleSelect); int selectedIndexOffset = addItems(listBox); boolean selected = false; for (int i = 0; i < enumeratedValues.length; i++) { String enumeratedValue = enumeratedValues[i]; String val; if (enumeratedValue.indexOf('=') > 0) { final String[] splut = ConstraintValueHelper.splitValue(enumeratedValue); final String realValue = splut[0]; <START> final String display = splut[1]; <END> val = realValue; listBox.addItem(display, realValue); } else { listBox.addItem(enumeratedValue); val = enumeratedValue; } if (value != null && currentValues.contains(val)) { listBox.setItemSelected(i + selectedIndexOffset, true); selected = true; } } if (!selected) { selectItem(listBox); } }</code><technical_language>I google translator splut is english word, :)</technical_language>

Target:
private void fillDropDown(final String value, final String[] enumeratedValues, final boolean isMultipleSelect, final ListBox listBox) { listBox.clear(); final Set<String> currentValues = getCurrentValues(value, isMultipleSelect); int selectedIndexOffset = addItems(listBox); boolean selected = false; for (int i = 0; i < enumeratedValues.length; i++) { String enumeratedValue = enumeratedValues[i]; String val; if (enumeratedValue.indexOf('=') > 0) { final String[] split = ConstraintValueHelper.splitValue(enumeratedValue); final String realValue = split[0]; final String display = split[1]; val = realValue; listBox.addItem(display, realValue); } else { listBox.addItem(enumeratedValue); val = enumeratedValue; } if (value != null && currentValues.contains(val)) { listBox.setItemSelected(i + selectedIndexOffset, true); selected = true; } } if (!selected) { selectItem(listBox); } }
Source:
<code>public Triple(String[] line) { this.line = line; <START> processTriple(this.line); <END> }</code><technical_language>processTriple is part of logic of constructor. Move contents of processTriple constructor get rid of processTriple method</technical_language>

Target:
public Triple(String[] line) { Preconditions.checkArgument(line.length == 3); try { this.leftObjectProperty = line[0].split(":")[0]; this.leftObject = line[0].split(":")[1]; this.relationship = line[1]; this.rightObjectProperty = line[2].split(":")[0]; this.rightObject = line[2].split(":")[1]; } catch (IllegalArgumentException e) { e.printStackTrace(); } }
Source:
<code>synchronized void submitEncryptionTasks() { <START> if (m_hasOutstandingTask.compareAndSet(false, true)) { <END> Runnable task = new Runnable() { @Override public void run() { DBBPool.BBContainer fragCont = null; boolean queuedEncBuffers = false; SettableFuture<Void> sf = null; try { while ((fragCont = writeStream().getWriteBuffer()) != null) { sf = SettableFuture.create(); m_encryptionResults.add(sf); fragCont.b().flip(); int nBytesClear = fragCont.b().remaining(); final DBBPool.BBContainer encCont = m_sslBufferEncrypter.encryptBuffer(fragCont.b().slice()); fragCont.discard(); fragCont = null; m_encryptedBuffers.offer(new EncryptionResult(encCont, nBytesClear, sf)); sf = null; queuedEncBuffers = true; } if (! m_isShuttingDown.get() && queuedEncBuffers) { m_network.addToChangeList(m_port, true); } } catch (IOException ioe) { networkLog.error("Exception wrapping an SSL frame", ioe); return; } finally { if (fragCont != null) { fragCont.discard(); } if (sf != null) { sf.setException(new Throwable("Encryption of buffer failed.")); } m_hasOutstandingTask.set(false); } } }; try { m_sslEncryptionService.submitForEncryption(task); } catch (RejectedExecutionException e) { } } }</code><technical_language>here, double protection</technical_language>

Target:
synchronized void submitEncryptionTasks() { if (! m_hasOutstandingTask) { try { m_sslEncryptionService.submitForEncryption(m_encTask); m_hasOutstandingTask = true; } catch (RejectedExecutionException e) { } } }
Source:
<code>public void addToAppsStore(File file) { AndroidApp app = null; try { app = selendroidApkBuilder.resignApp(file); } catch (ShellCommandException e) { throw new SessionNotCreatedException("An error occurred while resigning the app '" + file.getName() + "'. ", e); } catch (AndroidSdkException e) { <START> e.printStackTrace(); <END> } String appId = null; try { appId = app.getAppId(); appsStore.put(appId, app); log.info("App " + appId + " has been added to selendroid standalone server."); } catch (AndroidSdkException e) { log.info("Ignoring app because an error occurred reading the app details: " + file.getAbsolutePath()); log.info(e.getMessage()); } }</code><technical_language>this need logged too</technical_language>

Target:
public void addToAppsStore(File file) throws AndroidSdkException { AndroidApp app = null; try { app = selendroidApkBuilder.resignApp(file); } catch (ShellCommandException e) { throw new SessionNotCreatedException( "An error occurred while resigning the app '" + file.getName() + "'. ", e); } String appId = null; try { appId = app.getAppId(); } catch (AndroidSdkException e) { log.info("Ignoring app because an error occurred reading the app details: " + file.getAbsolutePath()); log.info(e.getMessage()); } if (appId != null && !appsStore.containsKey(appId)) { appsStore.put(appId, app); log.info("App " + appId + " has been added to selendroid standalone server."); } }
Source:
<code>public void filter(ContainerRequestContext requestContext) { var chargeEntity = getChargeFromRequest(requestContext); var gatewayAccountEntity = chargeEntity.map(ChargeEntity::getGatewayAccount) .or(() -> getAccountFromRequest(requestContext)); chargeEntity.ifPresent(charge -> MDC.put(PAYMENT_EXTERNAL_ID, charge.getExternalId())); gatewayAccountEntity.ifPresent(gatewayAccount -> { MDC.put(GATEWAY_ACCOUNT_ID, gatewayAccount.getId().toString()); MDC.put(PROVIDER, gatewayAccount.getGatewayName()); MDC.put(GATEWAY_ACCOUNT_TYPE, gatewayAccount.getType()); }); getPathParameterFromRequest("refundId", requestContext) .ifPresent(refund -> MDC.put(REFUND_EXTERNAL_ID, refund)); getPathParameterFromRequest("chargeTokenId", requestContext) .ifPresent(token -> MDC.put(SECURE_TOKEN, token)); getPathParameterFromRequest("gatewayTransactionId", requestContext) <START> .ifPresent(gatewayTxId -> MDC.put("gateway_transaction_id", gatewayTxId)); <END> }</code><technical_language>PROVIDER_ID in pay-java-commons for this</technical_language>

Target:
public void filter(ContainerRequestContext requestContext) { var chargeEntity = getChargeFromRequest(requestContext); var gatewayAccountEntity = chargeEntity.map(ChargeEntity::getGatewayAccount) .or(() -> getAccountFromRequest(requestContext)); chargeEntity.ifPresent(charge -> MDC.put(PAYMENT_EXTERNAL_ID, charge.getExternalId())); gatewayAccountEntity.ifPresent(gatewayAccount -> { MDC.put(GATEWAY_ACCOUNT_ID, gatewayAccount.getId().toString()); MDC.put(PROVIDER, gatewayAccount.getGatewayName()); MDC.put(GATEWAY_ACCOUNT_TYPE, gatewayAccount.getType()); }); getPathParameterFromRequest("refundId", requestContext) .ifPresent(refund -> MDC.put(REFUND_EXTERNAL_ID, refund)); getPathParameterFromRequest("chargeTokenId", requestContext) .ifPresent(token -> MDC.put(SECURE_TOKEN, token)); getPathParameterFromRequest("gatewayTransactionId", requestContext) .ifPresent(gatewayTxId -> MDC.put(PROVIDER_PAYMENT_ID, gatewayTxId)); }
Source:
<code><START> List<GermplasmList> retrieveAndValidateIfHasGermplasmList(Integer studyId) throws MiddlewareQueryException, <END> CrossingTemplateExportException { List<GermplasmList> crossesList = this.fieldbookMiddlewareService.getGermplasmListsByProjectId(studyId, GermplasmListType.NURSERY); if (crossesList.isEmpty()) { throw new CrossingTemplateExportException("study.export.crosses.no.germplasm.list.available"); } return crossesList; }</code><technical_language>Remove MiddlewareQueryException</technical_language>

Target:
List<GermplasmList> retrieveAndValidateIfHasGermplasmList(Integer studyId) throws CrossingTemplateExportException { List<GermplasmList> crossesList = this.fieldbookMiddlewareService.getGermplasmListsByProjectId(studyId, GermplasmListType.NURSERY); if (crossesList.isEmpty()) { throw new CrossingTemplateExportException("study.export.crosses.no.germplasm.list.available"); } return crossesList; }
Source:
<code>public final void createsStatus() throws Exception { <START> final String sha = "0abcd89jcabitest"; <END> final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_CREATED, Json.createObjectBuilder().add("state", "failure") .add("target_url", "<LINK_0>") .add("description", "Build has completed successfully") .add("context", "continuous-integration/jenkins") .build().toString() ) ).start(); final Request req = new ApacheRequest(container.home()); final Statuses statuses = new RtStatuses( req, new RtCommit(req, repo(), sha) ); try { final Status status = statuses.create( new RtStatus( Status.State.failure, "<LINK_1>", "description", "ctx" ) ); MatcherAssert.assertThat( status, Matchers.instanceOf(Status.class) ); MatcherAssert.assertThat( container.take().method(), Matchers.equalTo(Request.POST) ); MatcherAssert.assertThat( status.state().name(), Matchers.equalTo(Status.State.failure.name()) ); } finally { container.stop(); } }</code><technical_language>this is a one-time variable, inline this</technical_language>

Target:
public final void createsStatus() throws Exception { final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_CREATED, Json.createObjectBuilder().add("state", "failure") .add("target_url", "<LINK_0>") .add("description", "Build has completed successfully") .add("context", "continuous-integration/jenkins") .build().toString() ) ).start(); final Request req = new ApacheRequest(container.home()); final Statuses statuses = new RtStatuses( req, new RtCommit(req, repo(), "0abcd89jcabitest") ); try { statuses.create( new RtStatus( Status.State.Failure, "<LINK_1>", "description", "ctx" ) ); MatcherAssert.assertThat( container.take().method(), Matchers.equalTo(Request.POST) ); Matchers.equalToIgnoringCase(Status.State.Failure.name()); } finally { container.stop(); } }
Source:
<code>public TmfEventsTableHeader(Composite parent, int style, IEventsTableHeaderListener listener) { super(parent, style); fListener = listener; fLayout = new RowLayout(); fLayout.marginTop = 0; fLayout.marginBottom = 0; fLayout.marginLeft = EXPANDED.getBounds().width; setLayout(fLayout); fLabelBackground = new Color(getDisplay(), <START> 255, 255, 192); <END> getParent().addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { getParent().layout(); } }); addPaintListener(e -> { if (fCollapsed) { e.gc.drawImage(COLLAPSED, 0, 0); } else { e.gc.drawImage(EXPANDED, 0, 0); } }); addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { toggle(); } }); }</code><technical_language>RGB constant</technical_language>

Target:
public TmfEventsTableHeader(Composite parent, int style, IEventsTableHeaderListener listener) { super(parent, style); fListener = listener; fLayout = new RowLayout(); fLayout.marginTop = 0; fLayout.marginBottom = 0; fLayout.marginLeft = EXPANDED.getBounds().width; setLayout(fLayout); fLabelBackground = new Color(getDisplay(), LABEL_BACKGROUND); getParent().addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { getParent().layout(); } }); addPaintListener(e -> { if (fCollapsed) { e.gc.drawImage(COLLAPSED, 0, 0); } else { e.gc.drawImage(EXPANDED, 0, 0); } }); addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { toggle(); } }); }
Source:
<code>private @CheckForNull CachedRepo cachedSource(Node node, EnvVars env, Launcher launcher, TaskListener listener, boolean useTimeout, StandardUsernameCredentials credentials) { if (!CACHE_LOCAL_REPOS && getSource(env).matches("(file:|[/\\\\]).+")) { return null; } MercurialInstallation inst = findInstallation(installation); if (inst == null || !inst.isUseCaches()) { return null; } try { FilePath cache = Cache.fromURL(getSource(env), credentials).repositoryCache(inst, node, launcher, listener, useTimeout); if (cache != null) { return new CachedRepo(cache.getRemote(), inst.isUseSharing()); } else { listener.error("Failed to use repository cache for " + getSource(env)); return null; } <START> } catch (Throwable x) { <END> x.printStackTrace(listener.error("Failed to use repository cache for " + getSource(env))); return null; } }</code><technical_language>this swallow out of memory errors</technical_language>

Target:
private @CheckForNull CachedRepo cachedSource(Node node, EnvVars env, Launcher launcher, TaskListener listener, boolean useTimeout, StandardUsernameCredentials credentials) throws InterruptedException { if (!CACHE_LOCAL_REPOS && getSource(env).matches("(file:|[/\\\\]).+")) { return null; } MercurialInstallation inst = findInstallation(installation); if (inst == null || !inst.isUseCaches()) { return null; } try { FilePath cache = Cache.fromURL(getSource(env), credentials).repositoryCache(inst, node, launcher, listener, useTimeout); if (cache != null) { return new CachedRepo(cache.getRemote(), inst.isUseSharing()); } else { listener.error("Failed to use repository cache for " + getSource(env)); return null; } } catch (InterruptedException x) { throw x; } catch (Exception x) { x.printStackTrace(listener.error("Failed to use repository cache for " + getSource(env))); return null; } }
Source:
<code>protected void contextDisposed(IPresentationContext context) { List<InputData> removed = new ArrayList<>(1); synchronized (fInputToData) { for (Iterator<Entry<DefaultBreakpointsViewInput, InputData>> itr = fInputToData.entrySet().iterator(); itr.hasNext();) { Map.Entry<DefaultBreakpointsViewInput, InputData> entry = itr.next(); IPresentationContext entryContext = entry.getKey().getContext(); if (context.equals(entryContext)) { removed.add(entry.getValue()); itr.remove(); } } } for (InputData <START> element : <END> removed) { element.dispose(); } }</code><technical_language>inputData</technical_language>

Target:
protected void contextDisposed(IPresentationContext context) { List<InputData> removed = new ArrayList<>(1); synchronized (fInputToData) { for (Iterator<Entry<DefaultBreakpointsViewInput, InputData>> itr = fInputToData.entrySet().iterator(); itr.hasNext();) { Map.Entry<DefaultBreakpointsViewInput, InputData> entry = itr.next(); IPresentationContext entryContext = entry.getKey().getContext(); if (context.equals(entryContext)) { removed.add(entry.getValue()); itr.remove(); } } } for (InputData inputData : removed) { inputData.dispose(); } }
Source:
<code>private void createServer(final String googleUserName, final String sshPublicKey, final String sshPrivateKey) throws RunNodesException, TimeoutException, IOException { System.out.format("Create Server%n"); Template template = computeService.templateBuilder() .locationId(ZONE) .hardwareId(getHardware().getId()) .imageId(getImage().getId()) <START> .build(); <END> template.getOptions().as(GoogleComputeEngineTemplateOptions.class) .overrideLoginCredentials((new LoginCredentials.Builder()) .user(googleUserName) .privateKey(sshPrivateKey) .build()) .authorizePublicKey(sshPublicKey); Set<? extends NodeMetadata> nodes = computeService.createNodesInGroup(NAME, 1, template); NodeMetadata nodeMetadata = nodes.iterator().next(); String publicAddress = nodeMetadata.getPublicAddresses().iterator().next(); System.out.format(" %s%n", nodeMetadata); System.out.format(" Instance %s started with IP %s%n", nodeMetadata.getName(), publicAddress); }</code><technical_language>[minor] Is this indent change intentional</technical_language>

Target:
private void createServer(final String googleUserName, final String sshPublicKey, final String sshPrivateKey) throws RunNodesException, TimeoutException, IOException { System.out.format("Create Server%n"); Template template = computeService.templateBuilder() .locationId(ZONE) .hardwareId(getHardware().getId()) .imageId(getImage().getId()) .build(); template.getOptions() .overrideLoginCredentials((new LoginCredentials.Builder()) .user(googleUserName) .privateKey(sshPrivateKey) .build()) .authorizePublicKey(sshPublicKey); Set<? extends NodeMetadata> nodes = computeService.createNodesInGroup(NAME, 1, template); NodeMetadata nodeMetadata = nodes.iterator().next(); String publicAddress = nodeMetadata.getPublicAddresses().iterator().next(); System.out.format(" %s%n", nodeMetadata); System.out.format(" Instance %s started with IP %s%n", nodeMetadata.getName(), publicAddress); }
Source:
<code>protected boolean isEnabled() { Eval eval = new Eval(interpreter, variableManager); <START> return eval.get(EefPackage.Literals.EEF_WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION, getWidgetDescription().getIsEnabledExpression(), Boolean.class); <END> }</code><technical_language>auto boxing this code crash in NPE. If is null, a default behavior (return true default behavior of widget ?)</technical_language>

Target:
protected boolean isEnabled() { Eval eval = new Eval(interpreter, variableManager); Boolean result = eval.get(EefPackage.Literals.EEF_WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION, getWidgetDescription().getIsEnabledExpression(), Boolean.class); if (result != null) { return result.booleanValue(); } return true; }
Source:
<code>public void testPushForMasterWithHashtags() throws GitAPIException, OrmException, IOException, RestApiException { String hashtag1 = "tag1"; List<String> expected = Arrays.asList(hashtag1); PushOneCommit.Result r = pushTo("refs/for/master%hashtag=" + hashtag1); r.assertOkStatus(); r.assertChange(Change.Status.NEW, null); String changeId = <START> r.getChangeId(); <END> RestResponse response = adminSession.get("/changes/" + changeId + "/hashtags/"); assertResult(response, expected); String hashtag2 = "tag2"; expected = Arrays.asList(hashtag1, hashtag2); r = pushTo("refs/for/master%hashtag=" + hashtag1 + ",hashtag=" + hashtag2); r.assertOkStatus(); r.assertChange(Change.Status.NEW, null); changeId = r.getChangeId(); response = adminSession.get("/changes/" + changeId + "/hashtags/"); assertResult(response, expected); }</code><technical_language>this be: r.getPatchSetId().getParentKey().toString();</technical_language>

Target:
public void testPushForMasterWithHashtags() throws GitAPIException, OrmException, IOException, RestApiException { String hashtag1 = "tag1"; List<String> expected = Arrays.asList(hashtag1); PushOneCommit.Result r = pushTo("refs/for/master%hashtag=" + hashtag1); r.assertOkStatus(); r.assertChange(Change.Status.NEW, null); String changeId = r.getChangeId(); RestResponse response = adminSession.get("/changes/" + changeId + "/hashtags/"); assertResultList(response, expected); String hashtag2 = "tag2"; expected = Arrays.asList(hashtag1, hashtag2); r = pushTo("refs/for/master%hashtag=" + hashtag1 + ",hashtag=" + hashtag2); r.assertOkStatus(); r.assertChange(Change.Status.NEW, null); changeId = r.getChangeId(); response = adminSession.get("/changes/" + changeId + "/hashtags/"); assertResultList(response, expected); }
Source:
<code>CompletionStage<ImmutableMap<ReportFormat, RenderedReport>> renderAll( final ImmutableSet<ReportFormat> formats, final Report report, final TimeRange timeRange ) { final Map<ReportFormat, RenderedReport> result = Maps.newConcurrentMap(); final CompletableFuture<?>[] resultSettingFutures = formats .stream() .map(format -> getRenderer(report.getSource(), format) .render( report.getSource(), format, timeRange, new DefaultRenderedReport.Builder() .setReport(report) .setFormat(format) .setGeneratedAt(_clock.instant()) .setTimeRange(timeRange), report.getTimeout() ) <START> .whenComplete((res, err) -> { <END> if (err != null) { LOGGER.warn() .setMessage("rendering failed") .addData("source", report.getSource()) .addData("format", format) .setThrowable(err) .log(); } }) .thenApply(builder -> result.put(format, builder.build())) .toCompletableFuture()) .toArray(CompletableFuture[]::new); return CompletableFuture.allOf(resultSettingFutures).thenApply(nothing -> ImmutableMap.copyOf(result)); }</code><technical_language>Is a handle error instead of success/failure</technical_language>

Target:
CompletionStage<ImmutableMap<ReportFormat, RenderedReport>> renderAll( final ImmutableSet<ReportFormat> formats, final Report report, final TimeRange timeRange ) { final Map<ReportFormat, RenderedReport> result = Maps.newConcurrentMap(); final CompletableFuture<?>[] resultSettingFutures = formats .stream() .map(format -> getRenderer(report.getSource(), format) .render( report.getSource(), format, timeRange, new DefaultRenderedReport.Builder() .setReport(report) .setFormat(format) .setGeneratedAt(_clock.instant()) .setTimeRange(timeRange), report.getTimeout() ) .thenApply(builder -> result.put(format, builder.build())) .toCompletableFuture()) .toArray(CompletableFuture[]::new); return CompletableFuture.allOf(resultSettingFutures).thenApply(nothing -> ImmutableMap.copyOf(result)); }
Source:
<code>public void testStompAutoCreateAddress() throws Exception { try { URI uri = new URI("ws+v12.stomp://localhost:61613"); StompClientConnection newConn = StompClientConnectionFactory.createClientConnection(uri); newConn.connect(defUser, defPass); subscribeQueue(newConn, "a-sub", "autoCreated"); unsubscribe(newConn, "a-sub"); newConn.disconnect(); verifier.validatePluginMethodsAtLeast(1, BEFORE_ADD_ADDRESS, AFTER_ADD_ADDRESS, BEFORE_REMOVE_ADDRESS, AFTER_REMOVE_ADDRESS); } catch (Throwable e) { <START> fail(e.getMessage()); <END> } }</code><technical_language>printStackTrace is useful fails :) I there</technical_language>

Target:
public void testStompAutoCreateAddress() throws Exception { URI uri = new URI("ws+v12.stomp://localhost:61613"); StompClientConnection newConn = StompClientConnectionFactory.createClientConnection(uri); newConn.connect(defUser, defPass); subscribeQueue(newConn, "a-sub", "autoCreated"); unsubscribe(newConn, "a-sub"); newConn.disconnect(); verifier.validatePluginMethodsAtLeast(1, BEFORE_ADD_ADDRESS, AFTER_ADD_ADDRESS, BEFORE_REMOVE_ADDRESS, AFTER_REMOVE_ADDRESS); }
Source:
<code>public void onSourceTaskCompleted(TaskAttemptIdentifier attempt) { <START> completedUpstreamTasks ++; <END> LOG.info("Source task attempt completion received at vertex {}", attempt, this.vertexName); }</code><technical_language>suggestion completedUpstreamTasks++;</technical_language>

Target:
public synchronized void onSourceTaskCompleted(TaskAttemptIdentifier attempt) { completedUpstreamTasks ++; LOG.info("Source task attempt completion received at vertex {}", attempt, this.vertexName); }
Source:
<code>private void checkIfUsernameCanBeChanged() { AccountModel account = mAccountStore.getAccount(); mUsernamePreference.setEnabled(account.getUsernameCanBeChanged()); mUsernamePreference.setOnPreferenceClickListener(preference -> { showUsernameChangerFragment(); <START> return false; <END> }); }</code><technical_language>wondering if return "true" here. Wdyt</technical_language>

Target:
private void checkIfUsernameCanBeChanged() { AccountModel account = mAccountStore.getAccount(); mUsernamePreference.setEnabled(account.getUsernameCanBeChanged()); mUsernamePreference.setOnPreferenceClickListener(preference -> { showUsernameChangerFragment(); return true; }); }
Source:
<code>public Response inviteExistingUsersToEnrollDevice(List<String> usernames) { if (log.isDebugEnabled()) { log.debug("Sending enrollment invitation mail to existing user."); } DeviceManagementProviderService dms = DeviceMgtAPIUtils.getDeviceManagementService(); try { for (String username : usernames) { String recipient = getClaimValue(username, Constants.USER_CLAIM_EMAIL_ADDRESS); Properties props = new Properties(); props.setProperty("first-name", getClaimValue(username, Constants.USER_CLAIM_FIRST_NAME)); props.setProperty("username", username); EmailMetaInfo metaInfo = new EmailMetaInfo(recipient, props); dms.sendEnrolmentInvitation(DeviceManagementConstants.EmailAttributes.USER_ENROLLMENT_TEMPLATE, metaInfo); } } catch (DeviceManagementException e) { String msg = "Error occurred while inviting user to enrol their device"; <START> if (e.getMessage() != null) { <END> msg = e.getMessage(); } log.error(msg, e); return Response.serverError().entity( new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } catch (UserStoreException e) { String msg = "Error occurred while getting claim values to invite user"; log.error(msg, e); return Response.serverError().entity( new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } return Response.status(Response.Status.OK).entity("Invitation mails have been sent.").build(); }</code><technical_language>check error message !isEmpty() this condition</technical_language>

Target:
public Response inviteExistingUsersToEnrollDevice(List<String> usernames) { if (log.isDebugEnabled()) { log.debug("Sending enrollment invitation mail to existing user."); } DeviceManagementProviderService dms = DeviceMgtAPIUtils.getDeviceManagementService(); try { for (String username : usernames) { String recipient = getClaimValue(username, Constants.USER_CLAIM_EMAIL_ADDRESS); Properties props = new Properties(); props.setProperty("first-name", getClaimValue(username, Constants.USER_CLAIM_FIRST_NAME)); props.setProperty("username", username); EmailMetaInfo metaInfo = new EmailMetaInfo(recipient, props); dms.sendEnrolmentInvitation(DeviceManagementConstants.EmailAttributes.USER_ENROLLMENT_TEMPLATE, metaInfo); } } catch (DeviceManagementException e) { String msg = "Error occurred while inviting user to enrol their device"; if (e.getMessage() != null && !e.getMessage().isEmpty()) { msg = e.getMessage(); } log.error(msg, e); return Response.serverError().entity( new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } catch (UserStoreException e) { String msg = "Error occurred while getting claim values to invite user"; log.error(msg, e); return Response.serverError().entity( new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } return Response.status(Response.Status.OK).entity("Invitation mails have been sent.").build(); }
Source:
<code>public ImportResult importSpreadsheet(Workbook workbook, EClass eClass) { final ErrorReports errorReports = ErrorFactory.eINSTANCE.createErrorReports(); final Collection<EObject> result = readData(workbook, eClass, errorReports); <START> return new ImportResultImpl(result, errorReports); <END> }</code><technical_language>replace ExcelImportClass Ecore</technical_language>

Target:
public SpreadsheetImportResult importSpreadsheet(Workbook workbook, EClass eClass) { return readData(workbook, eClass); }
Source:
<code>protected void finished(StepContext context) throws Exception { <START> KubernetesCloud cloud = resolveCloud(); <END> LOGGER.log(Level.FINE, () -> "Removing pod template " + podTemplate.getName() + " from cloud " + cloud.name); cloud.removeDynamicTemplate(podTemplate); }</code><technical_language>this fail build if cloud is found? Is desired affect? I guess alert user of issue</technical_language>

Target:
protected void finished(StepContext context) throws Exception { try { KubernetesCloud cloud = resolveCloud(); LOGGER.log(Level.FINE, () -> "Removing pod template " + podTemplate.getName() + " from cloud " + cloud.name); cloud.removeDynamicTemplate(podTemplate); } catch (AbortException e) { LOGGER.log(Level.WARNING, e, () -> "Unable to resolve cloud for " + podTemplate.getName() + ". Maybe the cloud was removed while running the build?"); } }
Source:
<code>public void testParsingJats10NestedInOAI() throws Exception { String filePath = "/eu/dnetlib/iis/workflows/ingest/pmc/metadata/data/document_jats10_nested_in_oai.xml"; InputStream inputStream = null; try { SAXParserFactory saxFactory = SAXParserFactory.newInstance(); saxFactory.setValidating(false); SAXParser saxParser = saxFactory.newSAXParser(); XMLReader reader = saxParser.getXMLReader(); reader.setFeature("<LINK_2>", false); reader.setFeature("<LINK_0>", false); reader.setFeature("<LINK_1>", false); ExtractedDocumentMetadata.Builder metaBuilder = ExtractedDocumentMetadata.newBuilder(); metaBuilder.setId("some-id"); metaBuilder.setText(""); <START> PmcXmlHandler pmcXmlHandler = new PmcXmlHandler(metaBuilder); <END> saxParser.parse(inputStream = PmcXmlHandler.class.getResourceAsStream(filePath), pmcXmlHandler); checkJats10Metadata(metaBuilder.build()); } finally { if (inputStream != null) { inputStream.close(); } } }</code><technical_language>I extract local pmcXmlHandler saxParser variables class property instantiate in @Before section. in test cases in this class</technical_language>

Target:
public void testParsingJats10NestedInOAI() throws Exception { saxParser.parse( inputStream = PmcXmlHandler.class .getResourceAsStream(xmlResourcesRootClassPath + "document_jats10_nested_in_oai.xml"), pmcXmlHandler); checkJats10Metadata(metaBuilder.build()); }
Source:
<code>public SseEmitter logFileStream() throws IOException { final SseEmitter sseEmitter = new SseEmitter(sseTimeoutMillis); Resource logFileResource = getLogFileResource(); if (logFileResource == null) { sseEmitter.completeWithError( new IllegalStateException("Missing 'logging.file' or 'logging.path' properties")); return sseEmitter; } ForkJoinPool forkJoinPool = ForkJoinPool.commonPool(); forkJoinPool.execute( Tailer.create(logFileResource.getFile(), applicationContext.getBean(SseEmitterAwareTailerListenerAdapter.class, sseEmitter), 1000, true)); <START> return sseEmitter; <END> }</code><technical_language>Tailer bean @Scope(proxyMode = ScopedProxyMode.INTERFACES, = ConfigurableBeanFactory.SCOPE_PROTOTYPE) instead of applicationContext.getBean(..) here</technical_language>

Target:
public SseEmitter logFileStream() throws IOException { final SseEmitter sseEmitter = new SseEmitter(sseTimeoutMillis); Resource logFileResource = getLogFileResource(); if (logFileResource == null) { sseEmitter.completeWithError( new IllegalStateException("Missing 'logging.file' or 'logging.path' properties")); return sseEmitter; } ForkJoinPool forkJoinPool = ForkJoinPool.commonPool(); forkJoinPool.execute( Tailer.create(logFileResource.getFile(), tailerListenerAdapterPrototypeFactory.apply(sseEmitter), 1000, true)); return sseEmitter; }
Source:
<code>public TmfModelResponse<List<SegmentStoreTableColumnDataModel>> fetchTree(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { List<SegmentStoreTableColumnDataModel> model = new ArrayList<>(); for <START> (ISegmentAspect baseAspect : BASE_ASPECT) { long id = fAspectMap.inverse().computeIfAbsent(baseAspect, a -> fAtomicLong.getAndIncrement()); fComparatorMap.put(id, (Comparator<ISegment>) baseAspect.getComparator()); model.add(new SegmentStoreTableColumnDataModel(id, -1, baseAspect.getName(), baseAspect.getHelpText())); } <END> for (ISegmentAspect segmentAspect : fSegmentStoreProvider.getSegmentAspects()) { long id = fAspectMap.inverse().computeIfAbsent(segmentAspect, a -> fAtomicLong.getAndIncrement()); fComparatorMap.put(id, (Comparator<ISegment>) segmentAspect.getComparator()); model.add(new SegmentStoreTableColumnDataModel(id, -1, segmentAspect.getName(), segmentAspect.getHelpText())); } return new TmfModelResponse<>(model, ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED); }</code><technical_language>nice, include in loop provider aspects Iterables.concat</technical_language>

Target:
public TmfModelResponse<List<SegmentStoreTableColumnDataModel>> fetchTree(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { List<SegmentStoreTableColumnDataModel> model = new ArrayList<>(); Iterable<ISegmentAspect> segmentAspects = Iterables.concat(BASE_ASPECT, fSegmentStoreProvider.getSegmentAspects()); for (ISegmentAspect segmentAspect : segmentAspects) { long id = fAspectMap.inverse().computeIfAbsent(segmentAspect, a -> fAtomicLong.getAndIncrement()); fComparatorMap.put(id, (Comparator<ISegment>) segmentAspect.getComparator()); model.add(new SegmentStoreTableColumnDataModel(id, -1, segmentAspect.getName(), segmentAspect.getHelpText())); } return new TmfModelResponse<>(model, ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED); }
Source:
<code>private void setDefaults() { fSwitchTimerText.setText(String.valueOf(IChannelInfo.DEFAULT_SWITCH_TIMER)); fReadTimerText.setText(String.valueOf(IChannelInfo.DEFAULT_READ_TIMER)); fOverwriteModeButton.setSelection(IChannelInfo.DEFAULT_OVERWRITE_MODE); if (fTargetNodeComponent.isTraceFileRotationSupported()) { fMaxSizeTraceText.setText(String.valueOf(IChannelInfo.DEFAULT_MAXIMUM_SIZE_TRACE_FILES)); fMaxNumberTraceText.setText(String.valueOf(IChannelInfo.DEFAULT_MAXIMUM_NUMBER_TRACE_FILES)); } if (fKernelButton.getSelection()) { fSubBufferSizeText.setText(String.valueOf(IChannelInfo.DEFAULT_SUB_BUFFER_SIZE_KERNEL)); fNumberOfSubBuffersText.setText(String.valueOf(IChannelInfo.DEFAULT_NUMBER_OF_SUB_BUFFERS_KERNEL)); } else { fSubBufferSizeText.setText(String.valueOf(IChannelInfo.DEFAULT_SUB_BUFFER_SIZE_UST)); fNumberOfSubBuffersText.setText(String.valueOf(IChannelInfo.DEFAULT_NUMBER_OF_SUB_BUFFERS_UST)); <START> } <END> }</code><technical_language>default values tracer side changed for LTTng 2.2. Now, default depends kernel ust-pid ust-uid metadata. I if change implementation of Dialog box command execution pass a for parameters if user enters a in text box. if text box is empty this parameter is passed enable-channel command. do think? talk in daily meeting</technical_language>

Target:
private void setDefaults() { fSwitchTimerText.setText(DEFAULT_TEXT); fReadTimerText.setText(DEFAULT_TEXT); fOverwriteModeButton.setSelection(IChannelInfo.DEFAULT_OVERWRITE_MODE); if (fTargetNodeComponent.isTraceFileRotationSupported()) { fMaxSizeTraceText.setText(DEFAULT_TEXT); fMaxNumberTraceText.setText(DEFAULT_TEXT); } fSubBufferSizeText.setText(DEFAULT_TEXT); fNumberOfSubBuffersText.setText(DEFAULT_TEXT); }
Source:
<code>private void showFragment(Class activeFragmentClass) { Class[] fragmentClasses = new Class[] { DashboardFragment.class, GoalFragment.class }; FragmentManager mgr = getSupportFragmentManager(); FragmentTransaction transaction = mgr.beginTransaction(); try { for (Class klass : fragmentClasses) { Fragment fragment = mgr.findFragmentByTag(klass.getName()); if (klass == activeFragmentClass) { if (fragment != null) { transaction.show(fragment); } else { transaction.add(R.id.frmMainContent, (Fragment) klass.newInstance(), klass.getName()); } } else { if (fragment != null) { transaction.hide(fragment); } } } } catch (Exception e) { <START> e.printStackTrace(); <END> } transaction.commit(); }</code><technical_language>Log.d(tag, message, exception)</technical_language>

Target:
private void showFragment(Class activeFragmentClass) { Class[] fragmentClasses = new Class[] { DashboardFragment.class, GoalDetailFragment.class }; FragmentManager mgr = getSupportFragmentManager(); FragmentTransaction transaction = mgr.beginTransaction(); try { for (Class klass : fragmentClasses) { Fragment fragment = mgr.findFragmentByTag(klass.getName()); if (klass == activeFragmentClass) { if (fragment != null) { transaction.show(fragment); } else { transaction.add(R.id.frmMainContent, (Fragment) klass.newInstance(), klass.getName()); } } else { if (fragment != null) { transaction.hide(fragment); } } } } catch (Exception e) { e.printStackTrace(); } transaction.commit(); }