auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean deleteMetaDataFile() { try { Files.delete(Paths.get(metaFile.getCanonicalPath())); <START> LOGGER.log(Level.DEBUG, "Metadata file deleted!"); <END> return true; } catch (IOException e) { LOGGER.log(Level.ERROR, "Metadata file could not be deleted!"); return false; } }</code><technical_language>Add a condition log</technical_language>

Target:
public boolean deleteMetaDataFile() { try { Files.delete(Paths.get(metaFile.getCanonicalPath())); if (LOGGER.isDebugEnabled()){ LOGGER.log(Level.DEBUG, "Metadata file deleted!"); } return true; } catch (IOException e) { if (LOGGER.isTraceEnabled()){ LOGGER.log(Level.ERROR, "Metadata file could not be deleted!"); } return false; } }
Source:
<code>private String getFixedCommitMsgWithChangeId(String errMsg, RevCommit c) { final String changeId = "Change-Id:"; StringBuilder sb = new StringBuilder(); sb.append("ERROR: ").append(errMsg); sb.append("\n"); sb.append("Suggestion for commit message:\n"); if (c.getFullMessage().indexOf(changeId)==-1) { sb.append(c.getFullMessage()); sb.append("\n"); sb.append(changeId).append(" I").append(c.name()); } else { String lines[] = c.getFullMessage().trim().split("\n"); String lastLine = lines.length > 0 ? lines[lines.length - 1] : ""; if (lastLine.indexOf(changeId)==0) { for (int i = 0; i < lines.length - 1; i++) { sb.append(lines[i]); sb.append("\n"); } sb.append("\n"); sb.append(lastLine); } else { sb.append(c.getFullMessage()); sb.append("\n"); sb.append(changeId).append(" I").append(c.name()); sb.append("\nHint: A potential Change-Id was found, but it was not in the footer of the commit message."); } } String host; if (canonicalWebUrl != null) { try { host = new URL(canonicalWebUrl).getHost(); } catch (MalformedURLException e) { host = SystemReader.getInstance().getHostname(); } } else { host = SystemReader.getInstance().getHostname(); } sb.append("\n"); sb.append("Hint: To automatically add a Change-Id to commit messages, install the commit-msg hook:\n"); <START> sb.append(" $ scp -p -P 29418 " + currentUser.getUserName() + "@" + host + ":hooks/commit-msg .git/hooks/"); <END> return sb.toString(); }</code><technical_language>grab SshInfo object if hosts, is SSH HTTP shoudl used. SshInfo object format port number correctly. port 29418</technical_language>

Target:
private String getFixedCommitMsgWithChangeId(String errMsg, RevCommit c) { final String changeId = "Change-Id:"; StringBuilder sb = new StringBuilder(); sb.append("ERROR: ").append(errMsg); sb.append("\n"); sb.append("Suggestion for commit message:\n"); if (c.getFullMessage().indexOf(changeId)==-1) { sb.append(c.getFullMessage()); sb.append("\n"); sb.append(changeId).append(" I").append(c.name()); } else { String lines[] = c.getFullMessage().trim().split("\n"); String lastLine = lines.length > 0 ? lines[lines.length - 1] : ""; if (lastLine.indexOf(changeId)==0) { for (int i = 0; i < lines.length - 1; i++) { sb.append(lines[i]); sb.append("\n"); } sb.append("\n"); sb.append(lastLine); } else { sb.append(c.getFullMessage()); sb.append("\n"); sb.append(changeId).append(" I").append(c.name()); sb.append("\nHint: A potential Change-Id was found, but it was not in the footer of the commit message."); } } sb.append("\n"); sb.append("Hint: To automatically add a Change-Id to commit messages, install the commit-msg hook:\n"); sb.append(getCommitMessageHookInstallationHint()); return sb.toString(); }
Source:
<code>public List<Payment> getAccountPayments(final UUID accountId, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext tenantContext) throws PaymentApiException { <START> return paymentProcessor.getAccountPayments(accountId, withPluginInfo, tenantContext, internalCallContextFactory.createInternalTenantContext(accountId, tenantContext)); <END> }</code><technical_language>new flag withAttempts is passed (used) paymentProcessor#getAccountPayments</technical_language>

Target:
public List<Payment> getAccountPayments(final UUID accountId, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext tenantContext) throws PaymentApiException { return paymentProcessor.getAccountPayments(accountId, withPluginInfo, withAttempts, tenantContext, internalCallContextFactory.createInternalTenantContext(accountId, tenantContext)); }
Source:
<code>public void switchLanguage(String langCodeCombined) throws IOException { String[] languageCode = langCodeCombined.split("_"); Locale locale; if (languageCode.length == 2) { locale = new Locale(languageCode[0], languageCode[1]); } else { locale = new Locale(languageCode[0]); } try { User user = serviceManager.getUserService().getById(serviceManager.getUserService().getAuthenticatedUser().getId()); <START> user.setLanguage(locale.toString()); <END> serviceManager.getUserService().save(user); } catch (DataException e) { logger.error("Error in saving user : " + e.getMessage()); } catch (DAOException e) { logger.error("Error in retrieving user" + e.getMessage()); } FacesContext context = FacesContext.getCurrentInstance(); context.getViewRoot().setLocale(locale); context.getExternalContext().getSessionMap().put(SESSION_LOCALE_FIELD_ID, locale); context.getExternalContext() .redirect(((HttpServletRequest) context.getExternalContext().getRequest()).getRequestURI()); }</code><technical_language>I this line is long. apply formatting rules</technical_language>

Target:
public void switchLanguage(String langCodeCombined) throws IOException { String[] languageCode = langCodeCombined.split("_"); Locale locale; if (languageCode.length == 2) { locale = new Locale(languageCode[0], languageCode[1]); } else { locale = new Locale(languageCode[0]); } try { User user = serviceManager.getUserService().getById(serviceManager.getUserService().getAuthenticatedUser().getId()); user.setLanguage(locale.toString()); serviceManager.getUserService().save(user); } catch (DataException e) { Helper.setErrorMessage("Error in saving user", logger, e); } catch (DAOException e) { Helper.setErrorMessage("Error in retrieving user", logger, e); } FacesContext context = FacesContext.getCurrentInstance(); context.getViewRoot().setLocale(locale); context.getExternalContext().getSessionMap().put(SESSION_LOCALE_FIELD_ID, locale); context.getExternalContext() .redirect(((HttpServletRequest) context.getExternalContext().getRequest()).getRequestURI()); }
Source:
<code>@Test public void multipartPartOptional() throws Exception { try { <START> new Helper() END> .setMethod("POST") .setHasBody() .setUrl("<LINK_0>") .setPath("/foo/bar/") .setMultipart() .addPart("ping", null) .build(); } catch (IllegalArgumentException e) { assertThat(e.getMessage()).isEqualTo("Multipart part must not be null: ping."); } }</code><technical_language>forget fail</technical_language>

Target:
@Test public void multipartPartOptional() throws Exception { try { new Helper() .setMethod("POST") .setHasBody() .setUrl("<LINK_0>") .setPath("/foo/bar/") .setMultipart() .addPart("ping", null) .build(); fail("Null multipart part is not allowed."); } catch (IllegalArgumentException e) { assertThat(e.getMessage()).isEqualTo("Multipart part must not be null: ping."); } }
Source:
<code>public boolean hasResponseInCache() { <START> return mResponses.size() > 0; <END> }</code><technical_language>!mResponses .isEmpty()</technical_language>

Target:
public boolean hasResponseInCache() { return !mResponses.isEmpty(); }
Source:
<code>public void testCompressedEncodingDecodingFields() { this.batch.setProtocol(Protocol.VERSION_1); <START> EmbeddedChannel channel = new EmbeddedChannel(new CompressedBatchEncoder(), new BeatsParser()); <END> channel.writeOutbound(this.batch); Object o = channel.readOutbound(); channel.writeInbound(o); Batch decodedBatch = (Batch) channel.readInbound(); assertMessages(this.batch, decodedBatch); }</code><technical_language>lines repeat in tests, refactor method</technical_language>

Target:
public void testCompressedEncodingDecodingFields() { this.batch.setProtocol(Protocol.VERSION_1); Batch decodedBatch = decodeCompressedBatch(); assertMessages(this.batch, decodedBatch); }
Source:
<code>protected void initCampaigns() { campaigns = new ArrayList<SwrveBaseCampaign>(); campaignsState = new HashMap<Integer, SwrveCampaignState>(); try { String campaignsFromCache = cachedLocalStorage.getSecureCacheEntryForUser(userId, CAMPAIGN_CATEGORY, getUniqueKey()); if (!SwrveHelper.isNullOrEmpty(campaignsFromCache)) { JSONObject campaignsJson = new JSONObject(campaignsFromCache); String campaignsStateFromCache = cachedLocalStorage.getCacheEntryForUser(userId, CAMPAIGNS_STATE_CATEGORY); if (!SwrveHelper.isNullOrEmpty(campaignsStateFromCache)) { JSONObject campaignsStateJson = new JSONObject(campaignsStateFromCache); Iterator<String> campaignIdIterator = campaignsStateJson.keys(); while(campaignIdIterator.hasNext()) { String campaignIdStr = campaignIdIterator.next(); try { int campaignId = Integer.parseInt(campaignIdStr); SwrveCampaignState campaignState = new SwrveCampaignState(campaignsStateJson.getJSONObject(campaignIdStr)); campaignsState.put(campaignId, campaignState); } catch(Exception exp) { SwrveLogger.e(LOG_TAG, "Could not load state for campaign " + campaignIdStr, exp); } <START> } <END> } updateCampaigns(campaignsJson, campaignsState); SwrveLogger.i(LOG_TAG, "Loaded campaigns from cache."); } else { invalidateETag(); } } catch (JSONException e) { invalidateETag(); SwrveLogger.e(LOG_TAG, "Invalid json in cache, cannot load campaigns", e); } catch (SecurityException e) { invalidateETag(); SwrveLogger.e(LOG_TAG, "Signature validation failed when trying to load campaigns from cache.", e); Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("name", "Swrve.signature_invalid"); queueEvent("event", parameters, null, false); } }</code><technical_language>separate block a smaller method? easier unit test. potentially call this TestApp display there.</technical_language>

Target:
protected void initCampaigns() { campaigns = new ArrayList<SwrveBaseCampaign>(); campaignsState = new HashMap<Integer, SwrveCampaignState>(); try { String campaignsFromCache = cachedLocalStorage.getSecureCacheEntryForUser(userId, CAMPAIGN_CATEGORY, getUniqueKey()); if (!SwrveHelper.isNullOrEmpty(campaignsFromCache)) { JSONObject campaignsJson = new JSONObject(campaignsFromCache); loadCampaignsStateFromCache(); updateCampaigns(campaignsJson, campaignsState); SwrveLogger.i(LOG_TAG, "Loaded campaigns from cache."); } else { invalidateETag(); } } catch (JSONException e) { invalidateETag(); SwrveLogger.e(LOG_TAG, "Invalid json in cache, cannot load campaigns", e); } catch (SecurityException e) { invalidateETag(); SwrveLogger.e(LOG_TAG, "Signature validation failed when trying to load campaigns from cache.", e); Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("name", "Swrve.signature_invalid"); queueEvent("event", parameters, null, false); } }
Source:
<code><START> private void generatePreparedStatements() <END> { Map<Long, String> stringsWithoutPKAndExistsClauses = generatePreparedStatementsQueryStrings(); String ifExistsClause = " IF EXISTS"; Map<Long, String> finalSetOfQueryStrings = new HashMap<>(); for (Long currentIndexPos : stringsWithoutPKAndExistsClauses.keySet()) { StringBuilder aQueryStub = new StringBuilder(stringsWithoutPKAndExistsClauses.get(currentIndexPos)); buildWhereClauseForPrimaryKeys(aQueryStub); finalSetOfQueryStrings.put(currentIndexPos + getSlotIndexForMutationContextPreparedStatement(EnumSet.of(OperationContext.IF_EXISTS_CHECK_ABSENT)), aQueryStub.toString()); if (counterColumns.size() == 0) { finalSetOfQueryStrings.put(currentIndexPos + getSlotIndexForMutationContextPreparedStatement(EnumSet.of( OperationContext.IF_EXISTS_CHECK_PRESENT)), aQueryStub.toString() + ifExistsClause); } } for (Long currentIndexPos : finalSetOfQueryStrings.keySet()) { String currentQueryStr = finalSetOfQueryStrings.get(currentIndexPos); LOG.info("Registering query support for " + currentQueryStr); PreparedStatement preparedStatementForThisQuery = session.prepare(currentQueryStr); preparedStatementTypes.put(currentIndexPos, preparedStatementForThisQuery); } }</code><technical_language>of some query DSL for simplicity of constructing prepared statements</technical_language>

Target:
private void generatePreparedStatements() { cassandraPreparedStatementGenerationUtil = new CassandraPreparedStatementGenerator( pkColumnNames, counterColumns, listColumns, mapColumns, setColumns, columnDefinitions); cassandraPreparedStatementGenerationUtil.generatePreparedStatements(session, preparedStatementTypes, connectionStateManager.getKeyspaceName(), connectionStateManager.getTableName()); }
Source:
<code>public static void register(AggregationImplModule mod) { for (var supportedType : DataTypes.PRIMITIVE_TYPES) { mod.register( Signature.aggregate( NAME, supportedType.getTypeSignature(), supportedType.getTypeSignature()), args -> { var arg = args.get(0); var info = new FunctionInfo( new FunctionIdent(NAME, args), arg, FunctionInfo.Type.AGGREGATE ); if (arg instanceof FixedWidthType) { return new FixedMinimumAggregation(info); } else { <START> return new VariableMinimumAggregation(info); <END> } } ); } }</code><technical_language>here: decided of factory</technical_language>

Target:
public static void register(AggregationImplModule mod) { for (var supportedType : DataTypes.PRIMITIVE_TYPES) { var fixedWidthType = supportedType instanceof FixedWidthType; mod.register( Signature.aggregate( NAME, supportedType.getTypeSignature(), supportedType.getTypeSignature()), args -> { var arg = args.get(0); var info = new FunctionInfo( new FunctionIdent(NAME, args), arg, FunctionInfo.Type.AGGREGATE ); return fixedWidthType ? new FixedMinimumAggregation(info) : new VariableMinimumAggregation(info); } ); } }
Source:
<code><START> public EnrolmentPeriodInClasses getClassesEnrollmentPeriod(ExecutionSemester executionSemester) { <END> for (final EnrolmentPeriod enrolmentPeriod : this.getEnrolmentPeriodsSet()) { if (enrolmentPeriod.isForClasses() && enrolmentPeriod.getExecutionPeriod() == executionSemester) { return (EnrolmentPeriodInClasses) enrolmentPeriod; } } return null; }</code><technical_language>This a great candidate for Optional</technical_language>

Target:
public Optional<EnrolmentPeriod> getClassesEnrollmentPeriod(ExecutionSemester executionSemester) { return getEnrolmentPeriodsSet().stream().filter(ep -> ep.isForClasses() && ep.getExecutionPeriod() == executionSemester) .findAny(); }
Source:
<code>public Account build() throws JSONException { checkAccountIdInContainers(); checkRequiredFields(version); switch (version) { case ACCOUNT_METADATA_VERSION_1: <START> if (id == null) { <END> throw new IllegalStateException("Cannot build account, id is not set"); } if (name == null) { throw new IllegalStateException("Cannot build account, name is not set"); } if (status == null) { throw new IllegalStateException("Cannot build account, status is not set"); } JSONObject jsonMetadata = new JSONObject(); jsonMetadata.put(ACCOUNT_METADATA_VERSION_KEY, version); jsonMetadata.put(ACCOUNT_ID_KEY, id); jsonMetadata.put(ACCOUNT_NAME_KEY, name); jsonMetadata.put(ACCOUNT_STATUS_KEY, status); JSONArray containerArray = new JSONArray(); for (Container container : idToContainerMetadataMap.values()) { containerArray.put(container.toJson()); } jsonMetadata.put(CONTAINERS_KEY, containerArray); return new Account(jsonMetadata); default: throw new IllegalStateException("Unsupported account metadata version=" + version); } }</code><technical_language>this is repetition of code in checkRequiredFields()</technical_language>

Target:
public Account build() throws JSONException { return new Account(id, name, status, idToContainerMetadataMap.values()); }
Source:
<code>public void onStart() throws Exception { try { startDispatcherServices(); } catch (Exception e) { final DispatcherException exception = new DispatcherException(String.format("Could not start the Dispatcher %s", getAddress()), e); onFatalError(exception); throw exception; } <START> this.dispatcherBootstrap = this.dispatcherBootstrapFactory.apply(shutDownFuture::completeExceptionally); <END> this.dispatcherBootstrap.initialize(this, this.getRpcService().getScheduledExecutor()); }</code><technical_language>passing in fatalErrorHandler Dispatcher::onFatalError</technical_language>

Target:
public void onStart() throws Exception { try { startDispatcherServices(); } catch (Throwable t) { final DispatcherException exception = new DispatcherException(String.format("Could not start the Dispatcher %s", getAddress()), t); onFatalError(exception); throw exception; } startRecoveredJobs(); this.dispatcherBootstrap = this.dispatcherBootstrapFactory.create( getSelfGateway(DispatcherGateway.class), this.getRpcService().getScheduledExecutor() , this::onFatalError); }
Source:
<code>private View.OnClickListener validateAndSubmit() { return new View.OnClickListener() { @Override public void onClick(View view) { boolean hasErrors = false; if (mTitleField.getText().toString().length() == 0) { setEmpty("Title", mTitleField); hasErrors = true; } if (mDescriptionField.getText().toString().length() == 0) { setEmpty("Description", mDescriptionField); hasErrors = true; } if (mMiniSite == null) { setEmpty("Minisite", mDescriptionField); hasErrors = true; } if (mDate == null) { setEmpty("Deadline", mDescriptionField); hasErrors = true; } <START> if (mUser == null) { END> setEmpty("User", mDescriptionField); hasErrors = true; } if (hasErrors) return; submitListener(); } }; }</code><technical_language>remove this now</technical_language>

Target:
private void validateAndSubmit() { boolean hasErrors = false; if (mTitleField.getText().toString().length() == 0) { setEmpty("Title", mTitleField); hasErrors = true; } if (mDescriptionField.getText().toString().length() == 0) { setEmpty("Description", mDescriptionField); hasErrors = true; } if (mMiniSite == null) { setEmpty("Minisite", mDescriptionField); hasErrors = true; } if (mDate == null) { setEmpty("Deadline", mDescriptionField); hasErrors = true; } if (hasErrors) return; submitListener(); }
Source:
<code>private List<HdfsProducer.SplitStrategy> getSplitStrategies(Map<String, Object> hdfsSettings) { List<HdfsProducer.SplitStrategy> strategies = new ArrayList<>(); splitStrategy = getString(hdfsSettings, "splitStrategy", kerberosNamedNodes); <START> if (nonNull(splitStrategy)) { <END> String[] strstrategies = splitStrategy.split(","); for (String strstrategy : strstrategies) { String[] tokens = strstrategy.split(":"); if (tokens.length != 2) { throw new IllegalArgumentException("Wrong Split Strategy [splitStrategy" + "=" + splitStrategy + "]"); } HdfsProducer.SplitStrategyType sst = HdfsProducer.SplitStrategyType.valueOf(tokens[0]); long ssv = Long.parseLong(tokens[1]); strategies.add(new HdfsProducer.SplitStrategy(sst, ssv)); } } return strategies; }</code><technical_language>ObjectHelper class camel</technical_language>

Target:
private List<HdfsProducer.SplitStrategy> getSplitStrategies(Map<String, Object> hdfsSettings) { List<HdfsProducer.SplitStrategy> strategies = new ArrayList<>(); splitStrategy = getString(hdfsSettings, "splitStrategy", kerberosNamedNodes); if (isNotEmpty(splitStrategy)) { String[] strstrategies = splitStrategy.split(","); for (String strstrategy : strstrategies) { String[] tokens = strstrategy.split(":"); if (tokens.length != 2) { throw new IllegalArgumentException("Wrong Split Strategy [splitStrategy" + "=" + splitStrategy + "]"); } HdfsProducer.SplitStrategyType sst = HdfsProducer.SplitStrategyType.valueOf(tokens[0]); long ssv = Long.parseLong(tokens[1]); strategies.add(new HdfsProducer.SplitStrategy(sst, ssv)); } } return strategies; }
Source:
<code><START> private ScrollPane getCitationsPane() { <END> Text titleText = new Text(Localization.lang("Citations found")); titleText.getStyleClass().add("latex-citations-title-text"); VBox citationsBox = new VBox(20.0, titleText); citationsBox.getChildren().addAll(graphicCitationList); ScrollPane citationsPane = new ScrollPane(); citationsPane.setContent(citationsBox); return citationsPane; }</code><technical_language>I guess this method citationToGraphic (almost) in dialog. Thus, reduce code duplication, I propose introduce a new ui control displays a list of citations</technical_language>

Target:
private ScrollPane getCitationsPane() { Text titleText = new Text(Localization.lang("Citations found")); titleText.getStyleClass().add("recommendation-heading"); VBox citationsBox = new VBox(20, titleText); Path basePath = viewModel.directoryProperty().get(); citationsBox.getChildren().addAll(viewModel.getCitationList().stream().map( citation -> citation.getDisplayGraphic(basePath, Optional.empty())).collect(Collectors.toList())); ScrollPane citationsPane = new ScrollPane(); citationsPane.setContent(citationsBox); return citationsPane; }
Source:
<code>private void addOrUpdateClusterConfig(Guid clusterId, String paramName, String paramValue) { GlusterVolumeSnapshotConfig param = new GlusterVolumeSnapshotConfig(); param.setClusterId(clusterId); param.setVolumeId(null); param.setParamName(paramName); param.setParamValue(paramValue); GlusterVolumeSnapshotConfig existingParamDetail = getGlusterVolumeSnapshotConfigDao().getConfigByClusterIdAndName(clusterId, paramName); if (existingParamDetail == null) { getGlusterVolumeSnapshotConfigDao().save(param); } else { getGlusterVolumeSnapshotConfigDao().updateConfigByClusterIdAndName(clusterId, paramName, <START> paramValue); <END> } }</code><technical_language>update if changed</technical_language>

Target:
private void addOrUpdateClusterConfig(Guid clusterId, String paramName, String paramValue) { GlusterVolumeSnapshotConfig param = new GlusterVolumeSnapshotConfig(); param.setClusterId(clusterId); param.setVolumeId(null); param.setParamName(paramName); param.setParamValue(paramValue); GlusterVolumeSnapshotConfig existingParamDetail = getGlusterVolumeSnapshotConfigDao().getConfigByClusterIdAndName(clusterId, paramName); if (existingParamDetail == null) { getGlusterVolumeSnapshotConfigDao().save(param); } else if (!(existingParamDetail.getParamValue().equals(paramValue))) { getGlusterVolumeSnapshotConfigDao().updateConfigByClusterIdAndName(clusterId, paramName, paramValue); } }
Source:
<code>protected boolean loadValues(IMemento memento) { editorName = memento.getString(IWorkbenchConstants.TAG_LABEL); imageFilename = memento.getString(IWorkbenchConstants.TAG_IMAGE); className = memento.getString(IWorkbenchConstants.TAG_CLASS); launcherName = memento.getString(IWorkbenchConstants.TAG_LAUNCHER); fileName = memento.getString(IWorkbenchConstants.TAG_FILE); id = Util.safeString(memento.getString(IWorkbenchConstants.TAG_ID)); pluginIdentifier = memento.getString(IWorkbenchConstants.TAG_PLUGIN); Integer openModeInt = memento .getInteger(IWorkbenchConstants.TAG_OPEN_MODE); if (openModeInt != null) { openMode = openModeInt.intValue(); } else { boolean internal = Boolean.valueOf(memento .getString(IWorkbenchConstants.TAG_INTERNAL)) .booleanValue(); boolean openInPlace = Boolean.valueOf(memento .getString(IWorkbenchConstants.TAG_OPEN_IN_PLACE)) <START> .booleanValue(); <END> if (internal) { openMode = OPEN_INTERNAL; } else { if (openInPlace) { openMode = OPEN_INPLACE; } else { openMode = OPEN_EXTERNAL; } } } if (openMode != OPEN_EXTERNAL && openMode != OPEN_INTERNAL && openMode != OPEN_INPLACE) { WorkbenchPlugin .log("Ignoring editor descriptor with invalid openMode: " + this); return false; } String programName = memento .getString(IWorkbenchConstants.TAG_PROGRAM_NAME); if (programName != null) { this.program = findProgram(programName); } return true; }</code><technical_language>Hmm, is a reason Memento#getBoolean() instead</technical_language>

Target:
protected boolean loadValues(IMemento memento) { editorName = memento.getString(IWorkbenchConstants.TAG_LABEL); imageFilename = memento.getString(IWorkbenchConstants.TAG_IMAGE); className = memento.getString(IWorkbenchConstants.TAG_CLASS); launcherName = memento.getString(IWorkbenchConstants.TAG_LAUNCHER); fileName = memento.getString(IWorkbenchConstants.TAG_FILE); id = Util.safeString(memento.getString(IWorkbenchConstants.TAG_ID)); pluginIdentifier = memento.getString(IWorkbenchConstants.TAG_PLUGIN); Integer openModeInt = memento .getInteger(IWorkbenchConstants.TAG_OPEN_MODE); if (openModeInt != null) { openMode = openModeInt.intValue(); } else { boolean internal = Boolean.parseBoolean(memento .getString(IWorkbenchConstants.TAG_INTERNAL)); boolean openInPlace = Boolean.parseBoolean(memento .getString(IWorkbenchConstants.TAG_OPEN_IN_PLACE)); if (internal) { openMode = OPEN_INTERNAL; } else { if (openInPlace) { openMode = OPEN_INPLACE; } else { openMode = OPEN_EXTERNAL; } } } if (openMode != OPEN_EXTERNAL && openMode != OPEN_INTERNAL && openMode != OPEN_INPLACE) { WorkbenchPlugin .log("Ignoring editor descriptor with invalid openMode: " + this); return false; } String programName = memento .getString(IWorkbenchConstants.TAG_PROGRAM_NAME); if (programName != null) { this.program = findProgram(programName); } return true; }
Source:
<code>public void themeDesigner001_selectThemeFromFirstPage(){ WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); SpecialThemeDesignerPageObject designer = new SpecialThemeDesignerPageObject(driver); designer.openSpecialDesignerPage(wikiURL); <START> designer.selectTab(PageContent.themeTab); <END> themeName = designer.selectTheme(3); designer.verifyThemeSelected(themeName); }</code><technical_language>this handled nicer enum</technical_language>

Target:
public void themeDesigner001_selectThemeFromFirstPage(){ WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); SpecialThemeDesignerPageObject designer = new SpecialThemeDesignerPageObject(driver); designer.openSpecialDesignerPage(wikiURL); designer.selectTab(Tab.Theme); themeName = designer.selectTheme(3); designer.verifyThemeSelected(themeName); }
Source:
<code>public static String getStringValue(Object object) { String rtn = null; if (null == object) { } else if (object instanceof Clob) { try { int size = (int) ((Clob) object).length(); rtn = ((Clob) object).getSubString(1, size); } catch (SQLException e) { LOG.info(e.getLocalizedMessage()); } <START> } else if (object instanceof Timestamp){ <END> try { DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); rtn = df.format(object); } catch (Exception e) { LOG.info(e.getLocalizedMessage()); } } else { rtn = object.toString(); } return rtn; }</code><technical_language>sql to_char function in database query. field custom formatted, forcing a format (or convoluted logic handle multiple formats)</technical_language>

Target:
public static String getStringValue(Object object) { String rtn = null; if (null == object) { } else if (object instanceof Clob) { try { int size = (int) ((Clob) object).length(); rtn = ((Clob) object).getSubString(1, size); } catch (SQLException e) { LOG.info(e.getLocalizedMessage()); } } else { rtn = object.toString(); } return rtn; }
Source:
<code>private static String serialize(Object obj) throws IOException { <START> ObjectMapper mapper = new ObjectMapper() <END> .enableDefaultTyping(ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE); mapper.getSerializationConfig().addMixInAnnotations(ExtMap.class, JsonExtMapMixIn.class); return mapper.writeValueAsString(obj); }</code><technical_language>ObjectMapper instance static final reuse instead of new instance for execution</technical_language>

Target:
private static String serialize(Object obj) throws IOException { return mapper.writeValueAsString(obj); }
Source:
<code>public static @Nullable String getDimensionName(Unit<?> unit) { for (Class<? extends SystemOfUnits> system : ALL_SYSTEM_OF_UNITS) { for (Field field : system.getDeclaredFields()) { if (field.getType().isAssignableFrom(Unit.class) && Modifier.isStatic(field.getModifiers())) { try { String dimension = ((Class<?>) ((ParameterizedType) field.getGenericType()) .getActualTypeArguments()[0]).getSimpleName(); Unit<?> systemUnit = (Unit<?>) field.get(null); if (systemUnit.isCompatible(unit)) { return dimension; } <START> } catch (Exception e) { <END> LOGGER.error("Failed to get Dimension string for unit: {}", field, e); } } } } return null; }</code><technical_language>able catch more specific Exception</technical_language>

Target:
public static @Nullable String getDimensionName(Unit<?> unit) { for (Class<? extends SystemOfUnits> system : ALL_SYSTEM_OF_UNITS) { for (Field field : system.getDeclaredFields()) { if (field.getType().isAssignableFrom(Unit.class) && Modifier.isStatic(field.getModifiers())) { Type genericType = field.getGenericType(); if (genericType instanceof ParameterizedType) { String dimension = ((Class<?>) ((ParameterizedType) genericType).getActualTypeArguments()[0]) .getSimpleName(); Unit<?> systemUnit; try { systemUnit = (Unit<?>) field.get(null); if (systemUnit == null) { LOGGER.warn("Unit field points to a null value: {}", field); } else if (systemUnit.isCompatible(unit)) { return dimension; } } catch (IllegalArgumentException | IllegalAccessException e) { LOGGER.error("The unit field '{}' seems to be not accessible", field, e); } } else { LOGGER.warn("There is a unit field defined which has no generic type parametrization: {}", field); } } } } return null; }
Source:
<code>private Module kerberosInternalCommunicationModule() { return binder -> { KerberosInternalCommunicationConfig internalKerberosConfig = buildConfigObject(KerberosInternalCommunicationConfig.class); com.facebook.presto.server.security.KerberosConfig serverKerberosConfig = buildConfigObject(com.facebook.presto.server.security.KerberosConfig.class); <START> checkState(serverKerberosConfig.getKeytab() != null && serverKerberosConfig.getKeytab().getAbsolutePath().equals(internalKerberosConfig.getKerberosKeytab().getAbsolutePath()), "kerberos keytab values must match"); <END> checkState(serverKerberosConfig.getServiceName() != null && serverKerberosConfig.getServiceName().equals(internalKerberosConfig.getKerberosServiceName()), "kerberos servicename values must match"); checkState(serverKerberosConfig.getKerberosConfig() != null && serverKerberosConfig.getKerberosConfig().getAbsolutePath().equals(internalKerberosConfig.getKerberosConfig().getAbsolutePath()), "kerberos keytab values must match"); configBinder(binder).bindConfigGlobalDefaults(KerberosConfig.class, kerberosConfig -> { kerberosConfig.setConfig(internalKerberosConfig.getKerberosConfig()); kerberosConfig.setKeytab(internalKerberosConfig.getKerberosKeytab()); kerberosConfig.setUseCanonicalHostname(internalKerberosConfig.isKerberosUseCanonicalHostname()); kerberosConfig.setCredentialCache(internalKerberosConfig.getKerberosCredentialCache()); }); configBinder(binder).bindConfigGlobalDefaults(HttpClientConfig.class, httpClientConfig -> { httpClientConfig.setAuthenticationEnabled(true); httpClientConfig.setKerberosPrincipal(internalKerberosConfig.getKerberosPrincipal()); httpClientConfig.setKerberosRemoteServiceName(internalKerberosConfig.getKerberosServiceName()); }); }; }</code><technical_language>checks, do need 2 type of properties (for client for server). properties server config</technical_language>

Target:
private Module kerberosInternalCommunicationModule() { return binder -> { InternalCommunicationConfig clientKerberosConfig = buildConfigObject(InternalCommunicationConfig.class); com.facebook.presto.server.security.KerberosConfig serverKerberosConfig = buildConfigObject(com.facebook.presto.server.security.KerberosConfig.class); verify(serverKerberosConfig.getKeytab() != null, "%s must be set when %s is true", HTTP_SERVER_AUTHENTICATION_KRB5_KEYTAB, INTERNAL_COMMUNICATION_KERBEROS_ENABLED); configBinder(binder).bindConfigGlobalDefaults(KerberosConfig.class, kerberosConfig -> { kerberosConfig.setConfig(serverKerberosConfig.getKerberosConfig()); kerberosConfig.setKeytab(serverKerberosConfig.getKeytab()); kerberosConfig.setUseCanonicalHostname(clientKerberosConfig.isKerberosUseCanonicalHostname()); }); String kerberosPrincipal = serverKerberosConfig.getServiceName() + "/" + getLocalCanonicalHostName(); configBinder(binder).bindConfigGlobalDefaults(HttpClientConfig.class, httpClientConfig -> { httpClientConfig.setAuthenticationEnabled(true); httpClientConfig.setKerberosPrincipal(kerberosPrincipal); httpClientConfig.setKerberosRemoteServiceName(serverKerberosConfig.getServiceName()); }); }; }
Source:
<code>private boolean validateDestStorage(StorageDomain destDomain) { StorageDomainValidator validator = new StorageDomainValidator(destDomain); <START> return validate(validator.isDomainExistAndActive()) && validate(validator.domainIsValidDestination()); <END> }</code><technical_language>Add validation of isBackupDomain added in storageDomainValidator</technical_language>

Target:
private boolean validateDestStorage(StorageDomain destDomain) { StorageDomainValidator validator = new StorageDomainValidator(destDomain); return validate(validator.isDomainExistAndActive()) && validate(validator.domainIsValidDestination()) && validate(validator.isNotBackupDomain()); }
Source:
<code>public String getPresignedObjectUrl(GetPresignedObjectUrlArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { if (args == null) { throw new IllegalArgumentException("null arguments"); } if (args.expires() < 1 || args.expires() > DEFAULT_EXPIRY_TIME) { throw new InvalidExpiresRangeException( <START> args.expires(), "expires must be in range of 1 to " + DEFAULT_EXPIRY_TIME); <END> } byte[] body = null; if (args.method() == Method.PUT || args.method() == Method.POST) { body = new byte[0]; } Multimap<String, String> queryParamMap = null; if (args.params() != null) { queryParamMap = HashMultimap.create(); for (Map.Entry<String, String> m : args.params().entrySet()) { queryParamMap.put(m.getKey(), m.getValue()); } } String region = getRegion(args.bucket()); HttpUrl url = buildUrl(args.method(), args.bucket(), args.object(), region, queryParamMap); Request request = createRequest(url, args.method(), null, body, 0); url = Signer.presignV4(request, region, accessKey, secretKey, args.expires()); return url.toString(); }</code><technical_language>This validation (on expires) done builder</technical_language>

Target:
public String getPresignedObjectUrl(GetPresignedObjectUrlArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException, ServerException { checkArgs(args); byte[] body = null; if (args.method() == Method.PUT || args.method() == Method.POST) { body = EMPTY_BODY; } String region = getRegion(args.bucket()); HttpUrl url = buildUrl(args.method(), args.bucket(), args.object(), region, args.extraQueryParams()); Request request = createRequest(url, args.method(), null, body, 0); url = Signer.presignV4(request, region, accessKey, secretKey, args.expiry()); return url.toString(); }
Source:
<code>public ClouderaManagerParcelDeletedListenerTask(ClouderaManagerApiPojoFactory clouderaManagerApiPojoFactory, CloudbreakEventService cloudbreakEventService, Map<String, String> parcelVersions) { super(clouderaManagerApiPojoFactory, cloudbreakEventService); <START> this.parcelVersion = parcelVersions; <END> }</code><technical_language>this omitted field parameter name</technical_language>

Target:
public ClouderaManagerParcelDeletedListenerTask(ClouderaManagerApiPojoFactory clouderaManagerApiPojoFactory, CloudbreakEventService cloudbreakEventService, Map<String, String> parcelVersions) { super(clouderaManagerApiPojoFactory, cloudbreakEventService); this.parcelVersions = parcelVersions; }
Source:
<code>public void close() throws IOException { synchronized (outstandingRequests) { try { while (!outstandingRequests.isEmpty()) { outstandingRequests.wait(); } <START> } catch (InterruptedException e) { <END> Thread.interrupted(); } delegate.close(); } }</code><technical_language>if interrupted, check if outstandingRequests.isEmpty()</technical_language>

Target:
public void close() throws IOException { closed = true; synchronized (outstandingRequests) { try { while (!canClose()) { outstandingRequests.wait(); } } catch (InterruptedException e) { Thread.interrupted(); } delegateChannel.close(); } }
Source:
<code>private < A extends ArrayDataAccess< A > > CellImg< T, A > create( final long[] dimensions, final T type, final NativeTypeFactory< T, A > typeFactory ) { <START> Dimensions.InvalidDimensions.checkAllPositiveOrElseThrow( dimensions ); <END> verifyDimensions( dimensions ); final int n = dimensions.length; final Fraction entitiesPerPixel = type.getEntitiesPerPixel(); final int[] cellDimensions = getCellDimensions( defaultCellDimensions, n, entitiesPerPixel ); final CellGrid grid = new CellGrid( dimensions, cellDimensions ); final long[] gridDimensions = new long[ grid.numDimensions() ]; grid.gridDimensions( gridDimensions ); final Cell< A > cellType = new Cell<>( new int[] { 1 }, new long[] { 1 }, null ); final ListImg< Cell< A > > cells = new ListImg<>( gridDimensions, cellType ); final long[] cellGridPosition = new long[ n ]; final long[] cellMin = new long[ n ]; final int[] cellDims = new int[ n ]; final ListLocalizingCursor< Cell< A > > cellCursor = cells.localizingCursor(); while ( cellCursor.hasNext() ) { cellCursor.fwd(); cellCursor.localize( cellGridPosition ); grid.getCellDimensions( cellGridPosition, cellMin, cellDims ); final A data = ArrayDataAccessFactory.get( typeFactory ).createArray( ( int ) entitiesPerPixel.mulCeil( Intervals.numElements( cellDims ) ) ); cellCursor.set( new Cell<>( cellDims, cellMin, data ) ); } final CellImg< T, A > img = new CellImg<>( this, grid, cells, entitiesPerPixel ); img.setLinkedType( typeFactory.createLinkedType( img ) ); return img; }</code><technical_language>subsequent verifyDimensions check is checking for positive dimensions, throwing IllegalArgumentException if not</technical_language>

Target:
private < A extends ArrayDataAccess< A > > CellImg< T, A > create( final long[] dimensions, final T type, final NativeTypeFactory< T, A > typeFactory ) { Dimensions.verify( dimensions ); final int n = dimensions.length; final Fraction entitiesPerPixel = type.getEntitiesPerPixel(); final int[] cellDimensions = getCellDimensions( defaultCellDimensions, n, entitiesPerPixel ); final CellGrid grid = new CellGrid( dimensions, cellDimensions ); final long[] gridDimensions = new long[ grid.numDimensions() ]; grid.gridDimensions( gridDimensions ); final Cell< A > cellType = new Cell<>( new int[] { 1 }, new long[] { 1 }, null ); final ListImg< Cell< A > > cells = new ListImg<>( gridDimensions, cellType ); final long[] cellGridPosition = new long[ n ]; final long[] cellMin = new long[ n ]; final int[] cellDims = new int[ n ]; final ListLocalizingCursor< Cell< A > > cellCursor = cells.localizingCursor(); while ( cellCursor.hasNext() ) { cellCursor.fwd(); cellCursor.localize( cellGridPosition ); grid.getCellDimensions( cellGridPosition, cellMin, cellDims ); final A data = ArrayDataAccessFactory.get( typeFactory ).createArray( ( int ) entitiesPerPixel.mulCeil( Intervals.numElements( cellDims ) ) ); cellCursor.set( new Cell<>( cellDims, cellMin, data ) ); } final CellImg< T, A > img = new CellImg<>( this, grid, cells, entitiesPerPixel ); img.setLinkedType( typeFactory.createLinkedType( img ) ); return img; }
Source:
<code>public Object apply(ChangeResource rsrc, Input input) <START> throws NoSuchChangeException, OrmException, IOException { <END> ChangeUtil.deleteDraftChange(rsrc.getChange().getId(), gitManager, gitRefUpdated, dbProvider.get()); return Response.none(); }</code><technical_language>NoSuchChangeException converted ResourceNotFoundException caller 404 instead of 500 Internal Server Error. If change is a draft response 409 Conflict</technical_language>

Target:
public Object apply(ChangeResource rsrc, Input input) throws ResourceConflictException, AuthException, ResourceNotFoundException, OrmException, IOException { if (rsrc.getChange().getStatus() != Status.DRAFT) { throw new ResourceConflictException("Change is not a draft"); } if (!rsrc.getControl().canDeleteDraft(dbProvider.get())) { throw new AuthException("Not permitted to delete this draft change"); } try { ChangeUtil.deleteDraftChange(rsrc.getChange().getId(), gitManager, gitRefUpdated, dbProvider.get()); } catch (NoSuchChangeException e) { throw new ResourceNotFoundException(e.getMessage()); } return Response.none(); }
Source:
<code>protected void setLaunchAttributes() { super.setLaunchAttributes(); setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, TEST_PROGRAM_NAME); setLaunchAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, remote); setLaunchAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE_ID, TEST_JTAG_DEVICE_ID); setLaunchAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, false); setLaunchAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, remote); setLaunchAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, true); setLaunchAttribute(IGDBJtagConstants.ATTR_STOP_AT, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT); setLaunchAttribute(IGDBJtagConstants.ATTR_SET_RESUME, remote); if (remote) { setLaunchAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, true); if (0 > LaunchUtils.compareVersions(getGdbVersion(), GdbDebugServicesFactory.GDB_7_10_VERSION)) { setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT, X86_64_INIT); } } else { setLaunchAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, "# Commented line\nfile " + TEST_PROGRAM_NAME); setLaunchAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, "# Commented <START> line\nrun"); <END> } }</code><technical_language>newline chars test empty line</technical_language>

Target:
protected void setLaunchAttributes() { super.setLaunchAttributes(); setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, TEST_PROGRAM_NAME); setLaunchAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, remote); setLaunchAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE_ID, TEST_JTAG_DEVICE_ID); setLaunchAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, false); setLaunchAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, remote); setLaunchAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, true); setLaunchAttribute(IGDBJtagConstants.ATTR_STOP_AT, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT); setLaunchAttribute(IGDBJtagConstants.ATTR_SET_RESUME, remote); if (remote) { setLaunchAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, true); if (0 > LaunchUtils.compareVersions(getGdbVersion(), GdbDebugServicesFactory.GDB_7_10_VERSION)) { setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT, X86_64_INIT); } } else { String comments = "# Commented line\n\n \n # Commented indented line\n"; setLaunchAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, comments + "file " + TEST_PROGRAM_NAME); setLaunchAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, comments + "run"); } }
Source:
<code>@Override protected void readChunk(ReadableByteChannel ch) throws IOException { assert fileIo != null; long batchSize = Math.min(chunkSize, meta.count() - transferred); <START> long readed = fileIo.transferFrom(ch, meta.offset() + transferred, batchSize); <END> if (readed == 0) throw new IOException("Channel is reached the end of stream. Probably, channel is closed on the remote node"); if (readed > 0) transferred += readed; }</code><technical_language>readed -> read</technical_language>

Target:
@Override protected void readChunk(ReadableByteChannel ch) throws IOException { assert fileIo != null; long batchSize = Math.min(chunkSize, meta.count() - transferred); long read = fileIo.transferFrom(ch, meta.offset() + transferred, batchSize); if (read == 0) throw new IOException("Channel is reached the end of stream. Probably, channel is closed on the remote node"); if (read > 0) transferred += read; }
Source:
<code>public int hashCode() { <START> return Arrays.hashCode(copy().getBuf()); <END> }</code><technical_language>copying hashCode</technical_language>

Target:
public int hashCode() { if (buf == null) return 0; int result = 1; for (int i = 0; i < length; i++) { result = 31 * result + buf[offset + i]; } return result; }
Source:
<code>public void _run() throws IOException, InstallationStatus { if (wasInstalled()) { LOGGER.info("Skipping duplicate install of: " + plugin.getDisplayName() + "@" + plugin.version); <START> throw new Skipped(); <END> } try { super._run(); PluginWrapper pw = plugin.getInstalled(); if (pw!=null && pw.isBundled()) { SecurityContext oldContext = ACL.impersonate(ACL.SYSTEM); try { pw.doPin(); } finally { SecurityContextHolder.setContext(oldContext); } } if (dynamicLoad) { try { pm.dynamicLoad(getDestination()); } catch (RestartRequiredException e) { throw new SuccessButRequiresRestart(e.message); } catch (Exception e) { throw new IOException("Failed to dynamically deploy this plugin",e); } } else { throw new SuccessButRequiresRestart(Messages._UpdateCenter_DownloadButNotActivated()); } } finally { synchronized(this) { LOGGER.fine("Install complete for: " + plugin.getDisplayName() + "@" + plugin.version); status = new Skipped(); notifyAll(); } } }</code><technical_language>I check other builds -- heard this if released -- guess is same. simple fixing some math in wizard. said, I useful show this. Skipped duplicate installs artifact of dependency resolution works I admins get this (i.e. knowing more selected for install plugin depend some other plugin installed -- AFAIU)</technical_language>

Target:
public void _run() throws IOException, InstallationStatus { if (wasInstalled()) { LOGGER.info("Skipping duplicate install of: " + plugin.getDisplayName() + "@" + plugin.version); return; } try { super._run(); PluginWrapper pw = plugin.getInstalled(); if (pw!=null && pw.isBundled()) { SecurityContext oldContext = ACL.impersonate(ACL.SYSTEM); try { pw.doPin(); } finally { SecurityContextHolder.setContext(oldContext); } } if (dynamicLoad) { try { pm.dynamicLoad(getDestination()); } catch (RestartRequiredException e) { throw new SuccessButRequiresRestart(e.message); } catch (Exception e) { throw new IOException("Failed to dynamically deploy this plugin",e); } } else { throw new SuccessButRequiresRestart(Messages._UpdateCenter_DownloadButNotActivated()); } } finally { synchronized(this) { LOGGER.fine("Install complete for: " + plugin.getDisplayName() + "@" + plugin.version); status = new Skipped(); notifyAll(); } } }
Source:
<code>private void mayBeAddAdminUsers() { LOG.info("Checking user entries for admin users"); adminUsers.stream() .filter(name -> { User user = catalogService.getUser(name); if (user != null) { <START> LOG.info("User entry for '{}' already exists", name); <END> return false; } else { return true; } }) .forEach(name -> { User user = new User(); user.setName(name); user.setEmail(name + "@auto-generated"); User addedUser = catalogService.addUser(user); LOG.info("Added admin user entry: {}", addedUser); }); }</code><technical_language>NIT: Entry for user exists</technical_language>

Target:
private void mayBeAddAdminUsers() { LOG.info("Checking user entries for admin users"); adminUsers.stream() .filter(name -> { User user = catalogService.getUser(name); if (user != null) { LOG.info("Entry for user '{}' already exists", name); return false; } else { return true; } }) .forEach(name -> { User user = new User(); user.setName(name); user.setEmail(name + "@auto-generated"); User addedUser = catalogService.addUser(user); LOG.info("Added admin user entry: {}", addedUser); }); }