auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void initialize(URI uri, Configuration configuration) throws IOException { uri = ensureAuthority(uri, configuration); super.initialize(uri, configuration); setConf(configuration); LOG.debug("Initializing AzureBlobFileSystem for {}", uri); this.uri = URI.create(uri.getScheme() + "://" + uri.getAuthority()); this.abfsStore = new AzureBlobFileSystemStore(uri, this.isSecureScheme(), configuration); final AbfsConfiguration abfsConfiguration = abfsStore.getAbfsConfiguration(); this.setWorkingDirectory(this.getHomeDirectory()); if (abfsConfiguration.getCreateRemoteFileSystemDuringInitialization()) { if (this.tryGetFileStatus(new Path("/")) == null) { try { this.createFileSystem(); } catch (AzureBlobFileSystemException ex) { checkException(null, ex, AzureServiceErrorCode.FILE_SYSTEM_ALREADY_EXISTS); } } } if (UserGroupInformation.isSecurityEnabled()) { this.delegationTokenEnabled = abfsConfiguration.isDelegationTokenManagerEnabled(); if (this.delegationTokenEnabled) { LOG.debug("Initializing DelegationTokenManager for {}", uri); this.delegationTokenManager = abfsConfiguration.getDelegationTokenManager(); delegationTokenManager.bind(getUri(), configuration); LOG.debug("Created DelegationTokenManager {}", delegationTokenManager); } } AbfsClientThrottlingIntercept.initializeSingleton(abfsConfiguration.isAutoThrottlingEnabled()); this.authorizer = abfsConfiguration.getAbfsAuthorizer(); }

Target:
public void initialize(URI uri, Configuration configuration) throws IOException { uri = ensureAuthority(uri, configuration); super.initialize(uri, configuration); setConf(configuration); LOG.debug("Initializing AzureBlobFileSystem for {}", uri); this.uri = URI.create(uri.getScheme() + "://" + uri.getAuthority()); this.abfsStore = new AzureBlobFileSystemStore(uri, this.isSecureScheme(), configuration); final AbfsConfiguration abfsConfiguration = abfsStore.getAbfsConfiguration(); this.setWorkingDirectory(this.getHomeDirectory()); if (abfsConfiguration.getCreateRemoteFileSystemDuringInitialization()) { if (this.tryGetFileStatus(new Path(AbfsHttpConstants.ROOT_PATH)) == null) { try { this.createFileSystem(); } catch (AzureBlobFileSystemException ex) { checkException(null, ex, AzureServiceErrorCode.FILE_SYSTEM_ALREADY_EXISTS); } } } if (UserGroupInformation.isSecurityEnabled()) { this.delegationTokenEnabled = abfsConfiguration.isDelegationTokenManagerEnabled(); if (this.delegationTokenEnabled) { LOG.debug("Initializing DelegationTokenManager for {}", uri); this.delegationTokenManager = abfsConfiguration.getDelegationTokenManager(); delegationTokenManager.bind(getUri(), configuration); LOG.debug("Created DelegationTokenManager {}", delegationTokenManager); } } AbfsClientThrottlingIntercept.initializeSingleton(abfsConfiguration.isAutoThrottlingEnabled()); this.authorizer = abfsConfiguration.getAbfsAuthorizer(); }
Source:
public String readString(ByteBuffer in) throws IOException { final int length = in.getInt(); return new String(readBytes(in, length), UTF8); }

Target:
public String readString(ByteBuffer in) throws IOException { final int length = in.getInt(); return StringUtils.fromUtf8(readBytes(in, length)); }
Source:
protected void executeCommand() { if (getDiskImage() != null) { try { VDSReturnValue vdsReturnValue = performImageVdsmOperation(); getReturnValue().getInternalTaskIdList().add( createTask(vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); } catch (VdcBLLException e) { if (e.getErrorCode() != VdcBllErrors.ImageDoesNotExistInDomainError) { throw e; } log.debugFormat("The image group with id {0} wasn't actually deleted from the storage domain {1} because it didn't exist in it", getDiskImage().getId(), getStorageDomainId()); } if (getParameters().getParentCommand() != VdcActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveVmTemplateFromImportExport) { performImageDbOperations(); } } else { log.warn("DiskImage is null, nothing to remove"); } setSucceeded(true); }

Target:
protected void executeCommand() { if (getDiskImage() != null) { try { VDSReturnValue vdsReturnValue = performImageVdsmOperation(); getReturnValue().getInternalTaskIdList().add( createTask(vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); } catch (VdcBLLException e) { if (e.getErrorCode() != VdcBllErrors.ImageDoesNotExistInDomainError) { throw e; } log.warnFormat("The image group with id {0} wasn't actually deleted from the storage domain {1} because it didn't exist in it", getDiskImage().getId(), getStorageDomainId()); } if (getParameters().getParentCommand() != VdcActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveVmTemplateFromImportExport) { performImageDbOperations(); } } else { log.warn("DiskImage is null, nothing to remove"); } setSucceeded(true); }
Source:
public FileRepository(BaseRepositoryBuilder options) throws IOException { super(options); StoredConfig userConfig = null; try { userConfig = SystemReader.getInstance().getUserConfig(); } catch (ConfigInvalidException e) { LOG.error(e.getMessage(), e); throw new IOException(e.getMessage(), e); } repoConfig = new FileBasedConfig(userConfig, getFS().resolve( getDirectory(), Constants.CONFIG), getFS()); loadRepoConfig(); repoConfig.addChangeListener(this::fireEvent); final long repositoryFormatVersion = getConfig().getLong( ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_REPO_FORMAT_VERSION, 0); String reftype = repoConfig.getString("extensions", null, "refStorage"); if (repositoryFormatVersion >= 1 && reftype != null) { if (StringUtils.equalsIgnoreCase(reftype, "reftable")) { refs = new FileReftableDatabase(this); } else if (StringUtils.equalsIgnoreCase(reftype, "reftree")) { refs = new RefTreeDatabase(this, new RefDirectory(this)); } else { throw new IOException(JGitText.get().unknownRepositoryFormat); } } else { refs = new RefDirectory(this); } objectDatabase = new ObjectDirectory(repoConfig, options.getObjectDirectory(), options.getAlternateObjectDirectories(), getFS(), new File(getDirectory(), Constants.SHALLOW)); if (objectDatabase.exists()) { if (repositoryFormatVersion > 1) throw new IOException(MessageFormat.format( JGitText.get().unknownRepositoryFormat2, Long.valueOf(repositoryFormatVersion))); } if (!isBare()) { snapshot = FileSnapshot.save(getIndexFile()); } }

Target:
public FileRepository(BaseRepositoryBuilder options) throws IOException { super(options); StoredConfig userConfig = null; try { userConfig = SystemReader.getInstance().getUserConfig(); } catch (ConfigInvalidException e) { LOG.error(e.getMessage(), e); throw new IOException(e.getMessage(), e); } repoConfig = new FileBasedConfig(userConfig, getFS().resolve( getDirectory(), Constants.CONFIG), getFS()); loadRepoConfig(); repoConfig.addChangeListener(this::fireEvent); final long repositoryFormatVersion = getConfig().getLong( ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_REPO_FORMAT_VERSION, 0); String reftype = repoConfig.getString(ConfigConstants.CONFIG_EXTENSIONS_SECTION, null, ConfigConstants.CONFIG_KEY_REF_STORAGE); if (repositoryFormatVersion >= 1 && reftype != null) { if (StringUtils.equalsIgnoreCase(reftype, "reftable")) { refs = new FileReftableDatabase(this); } else if (StringUtils.equalsIgnoreCase(reftype, "reftree")) { refs = new RefTreeDatabase(this, new RefDirectory(this)); } else { throw new IOException(JGitText.get().unknownRepositoryFormat); } } else { refs = new RefDirectory(this); } objectDatabase = new ObjectDirectory(repoConfig, options.getObjectDirectory(), options.getAlternateObjectDirectories(), getFS(), new File(getDirectory(), Constants.SHALLOW)); if (objectDatabase.exists()) { if (repositoryFormatVersion > 1) throw new IOException(MessageFormat.format( JGitText.get().unknownRepositoryFormat2, Long.valueOf(repositoryFormatVersion))); } if (!isBare()) { snapshot = FileSnapshot.save(getIndexFile()); } }
Source:
public static ADALError fromCommon(final BaseException exception) { return exceptionMap.get(exception.getErrorCode()); }

Target:
public static AuthenticationException fromCommon(final BaseException exception) { final ADALError adalError = exceptionMap.get(exception.getErrorCode()); if (adalError == null) { return new AuthenticationException(ADALError.MAPPING_FAILURE, exception.getMessage(), exception); } return new AuthenticationException(adalError, exception.getMessage(), exception); }
Source:
public void onBootstrap() { ArrayList<LoadApi.LoadLibrary> libraries = new ArrayList<>(); libraries.add(LoadApi.LoadLibrary.ADSENSE); libraries.add(LoadApi.LoadLibrary.DRAWING); LoadApi.go(new Runnable() { @Override public void run() { GwtMapsLoadedEvent.fire(BootstrapperImpl.this); } }, libraries, true); placeManager.revealCurrentPlace(); }

Target:
public void onBootstrap() { ArrayList<LoadApi.LoadLibrary> libraries = new ArrayList<>(); LoadApi.go(new Runnable() { @Override public void run() { GwtMapsLoadedEvent.fire(BootstrapperImpl.this); } }, libraries, true); placeManager.revealCurrentPlace(); }
Source:
private ParameterizedTypeName(ParameterizedTypeName enclosingType, ClassName rawType, List<TypeName> typeArguments, List<AnnotationSpec> annotations) { super(annotations); this.rawType = Objects.requireNonNull(rawType, "rawType == null"); this.enclosingType = enclosingType; this.typeArguments = Util.immutableList(typeArguments); checkArgument(!this.typeArguments.isEmpty() || enclosingType != null, () -> "no type arguments: " + rawType); for (TypeName typeArgument : this.typeArguments) { checkArgument(!typeArgument.isPrimitive() && typeArgument != VOID, () -> "invalid type parameter: " + typeArgument); } }

Target:
private ParameterizedTypeName(ParameterizedTypeName enclosingType, ClassName rawType, List<TypeName> typeArguments, List<AnnotationSpec> annotations) { super(annotations); this.rawType = requireNonNull(rawType, "rawType == null"); this.enclosingType = enclosingType; this.typeArguments = Util.immutableList(typeArguments); checkArgument(!this.typeArguments.isEmpty() || enclosingType != null, () -> "no type arguments: " + rawType); for (TypeName typeArgument : this.typeArguments) { checkArgument(!typeArgument.isPrimitive() && typeArgument != VOID, () -> "invalid type parameter: " + typeArgument); } }
Source:
public void onMessageBuildSuccess(MimeMessage message, boolean isDraft) { if (isDraft) { draftNeedsSaving = false; currentMessageBuilder = null; if (mAction == Action.EDIT_DRAFT && mMessageReference != null) { message.setUid(mMessageReference.getUid()); } boolean saveRemotely = recipientPresenter.isAllowSavingDraftRemotely(); new SaveMessageTask(getApplicationContext(), mAccount, mContacts, mHandler, message, mDraftId, saveRemotely).execute(); if (mFinishAfterDraftSaved) { finish(); } else { setProgressBarIndeterminateVisibility(false); } } else { currentMessageBuilder = null; if (mAction == Action.REDIRECT) { LocalMessage referenceMessage = mMessageReference.restoreToLocalMessage(getApplicationContext()); message = referenceMessage.cloneAsSuper(true); message.setResentDate(new Date(), K9.hideTimeZone()); message.setRecipients(RecipientType.RESENT_TO, toArray(recipientPresenter.getToAddresses())); message.setRecipients(RecipientType.RESENT_CC, toArray(recipientPresenter.getCcAddresses())); message.setRecipients(RecipientType.RESENT_BCC, toArray(recipientPresenter.getBccAddresses())); message.setResentFrom(new Address(mIdentity.getEmail(), mIdentity.getName())); message.setBody(mRedirectBody); } new SendMessageTask(getApplicationContext(), mAccount, mContacts, message, mDraftId != INVALID_DRAFT_ID ? mDraftId : null, mMessageReference).execute(); finish(); } }

Target:
public void onMessageBuildSuccess(MimeMessage message, boolean isDraft) { if (isDraft) { draftNeedsSaving = false; currentMessageBuilder = null; if (mAction == Action.EDIT_DRAFT && mMessageReference != null) { message.setUid(mMessageReference.getUid()); } boolean saveRemotely = recipientPresenter.isAllowSavingDraftRemotely(); new SaveMessageTask(getApplicationContext(), mAccount, mContacts, mHandler, message, mDraftId, saveRemotely).execute(); if (mFinishAfterDraftSaved) { finish(); } else { setProgressBarIndeterminateVisibility(false); } } else { currentMessageBuilder = null; new SendMessageTask(getApplicationContext(), mAccount, mContacts, message, mDraftId != INVALID_DRAFT_ID ? mDraftId : null, mMessageReference).execute(); finish(); } }
Source:
private void initStreamLogDirectory() { if (logDir.toFile().exists()) { return; } try { Files.createDirectories(logDir); } catch (IOException e) { throw new UnrecoverableCorfuError("Can't create stream log directory", e); } }

Target:
private void initStreamLogDirectory() { if (logDir.toFile().exists()) { log.info("Log directory already exists: {}", logDir); return; } try { Files.createDirectories(logDir); } catch (IOException e) { throw new UnrecoverableCorfuError("Can't create stream log directory", e); } }
Source:
public void missingItemMappings(RegistryEvent.MissingMappings<Item> event) { for (RegistryEvent.MissingMappings.Mapping<Item> entry : event.getAllMappings()) { for (SlimeBlock.SlimeType slime : SlimeBlock.SlimeType.values()) { if (entry.key.getNamespace().equals(TConstruct.modID) && entry.key.getPath().equals("slime_sling_" + slime.getName())) { entry.remap(GadgetItems.slime_sling.get(slime)); } if (entry.key.getNamespace().equals(TConstruct.modID) && entry.key.getPath().equals("slime_boots_" + slime.getName())) { entry.remap(GadgetItems.slime_boots.get(slime)); } if (entry.key.getNamespace().equals(TConstruct.modID) && entry.key.getPath().equals(String.format("congealed_%s_slime", slime.getName()))) { entry.remap(WorldBlocks.congealed_slime.get(slime).asItem()); } } } }

Target:
public void missingItemMappings(RegistryEvent.MissingMappings<Item> event) { for (RegistryEvent.MissingMappings.Mapping<Item> entry : event.getAllMappings()) { if (entry.key.getNamespace().equals(TConstruct.modID)) { for (SlimeBlock.SlimeType slime : SlimeBlock.SlimeType.values()) { if (entry.key.getPath().equals("slime_sling_" + slime.getName())) { entry.remap(GadgetItems.slime_sling.get(slime)); } if (entry.key.getPath().equals("slime_boots_" + slime.getName())) { entry.remap(GadgetItems.slime_boots.get(slime)); } if (entry.key.getNamespace().equals(TConstruct.modID) && entry.key.getPath().equals(String.format("congealed_%s_slime", slime.getName()))) { entry.remap(WorldBlocks.congealed_slime.get(slime).asItem()); } } } } }
Source:
DefaultCompactionPolicy(StoreConfig storeConfig, Time time) { this.storeConfig = storeConfig; this.time = time; this.messageRetentionTimeInMs = (long) storeConfig.storeDeletedMessageRetentionDays * Time.SecsPerDay * Time.MsPerSec; }

Target:
DefaultCompactionPolicy(StoreConfig storeConfig, Time time) { this.storeConfig = storeConfig; this.time = time; this.messageRetentionTimeInMs = storeConfig.storeDeletedMessageRetentionDays * Time.SecsPerDay * Time.MsPerSec; }
Source:
public Response renew(String token) { Response resp; long expiration = 0; String error = ""; Response.Status errorStatus = Response.Status.BAD_REQUEST; if (tokenStateService == null) { error = "Token renewal support is not configured"; } else { String renewer = SubjectUtils.getCurrentEffectivePrincipalName(); if (allowedRenewers.contains(renewer)) { try { JWTToken jwt = new JWTToken(token); expiration = tokenStateService.renewToken(jwt, renewInterval.orElse(tokenStateService.getDefaultRenewInterval())); log.renewedToken(getTopologyName(), TokenUtils.getTokenDisplayText(token), TokenUtils.getTokenId(jwt)); } catch (ParseException e) { log.invalidToken(getTopologyName(), TokenUtils.getTokenDisplayText(token), e); error = e.getMessage(); } catch (Exception e) { error = e.getMessage(); } } else { errorStatus = Response.Status.FORBIDDEN; error = "Caller (" + renewer + ") not authorized to renew tokens."; } } if(error.isEmpty()) { resp = Response.status(Response.Status.OK) .entity("{\n \"renewed\": \"true\",\n \"expires\": \"" + expiration + "\"\n}\n") .build(); } else { log.badRenewalRequest(getTopologyName(), TokenUtils.getTokenDisplayText(token), error); resp = Response.status(errorStatus) .entity("{\n \"renewed\": \"false\",\n \"error\": \"" + error + "\"\n}\n") .build(); } return resp; }

Target:
public Response renew(String token) { Response resp; long expiration = 0; String error = ""; Response.Status errorStatus = Response.Status.BAD_REQUEST; if (tokenStateService == null) { error = "Token renewal support is not configured"; } else { String renewer = SubjectUtils.getCurrentEffectivePrincipalName(); if (allowedRenewers.contains(renewer)) { try { JWTToken jwt = new JWTToken(token); expiration = tokenStateService.renewToken(jwt, renewInterval.orElse(tokenStateService.getDefaultRenewInterval())); log.renewedToken(getTopologyName(), TokenUtils.getTokenDisplayText(token), TokenUtils.getTokenId(jwt)); } catch (ParseException e) { log.invalidToken(getTopologyName(), TokenUtils.getTokenDisplayText(token), e); error = safeGetMessage(e); } catch (Exception e) { error = safeGetMessage(e); } } else { errorStatus = Response.Status.FORBIDDEN; error = "Caller (" + renewer + ") not authorized to renew tokens."; } } if(error.isEmpty()) { resp = Response.status(Response.Status.OK) .entity("{\n \"renewed\": \"true\",\n \"expires\": \"" + expiration + "\"\n}\n") .build(); } else { log.badRenewalRequest(getTopologyName(), TokenUtils.getTokenDisplayText(token), error); resp = Response.status(errorStatus) .entity("{\n \"renewed\": \"false\",\n \"error\": \"" + error + "\"\n}\n") .build(); } return resp; }
Source:
public SyncResult getStatus(Stack stack, Set<InstanceMetaData> checkableInstances) { try { Set<InstanceMetaData> notTermiatedStackInstances = stack.getAllInstanceMetaDataList().stream() .filter(Predicate.not(InstanceMetaData::isTerminated)) .collect(Collectors.toSet()); Pair<List<DetailedStackStatus>, String> statusCheckPair = checkStatus(stack, checkableInstances); List<DetailedStackStatus> responses = statusCheckPair.getFirst(); DetailedStackStatus status; String postFix = ""; Boolean result = false; if (responses.isEmpty()) { status = DetailedStackStatus.UNREACHABLE; postFix = "Freeipa is unreachable, "; } else { DetailedStackStatus first = responses.get(0); if (responses.stream().allMatch(Predicate.isEqual(first)) && responses.size() == notTermiatedStackInstances.size()) { status = first; if (first.equals(DetailedStackStatus.AVAILABLE)) { result = true; } } else { status = DetailedStackStatus.UNHEALTHY; postFix = "Freeipa is unhealthy, "; } } return new SyncResult(postFix + statusCheckPair.getSecond(), status, result); } catch (Exception e) { LOGGER.info("Error occurred during status fetch: " + e.getMessage(), e); return new SyncResult("Freeipa is unreachable, because error occurred: " + e.getMessage(), DetailedStackStatus.UNREACHABLE, false); } }

Target:
public SyncResult getStatus(Stack stack, Set<InstanceMetaData> checkableInstances) { try { if (checkableInstances.isEmpty()) { throw new UnsupportedOperationException("There are no instances of FreeIPA to check the status of"); } Set<InstanceMetaData> notTermiatedStackInstances = stack.getAllInstanceMetaDataList().stream() .filter(Predicate.not(InstanceMetaData::isTerminated)) .collect(Collectors.toSet()); Pair<List<DetailedStackStatus>, String> statusCheckPair = checkStatus(stack, checkableInstances); List<DetailedStackStatus> responses = statusCheckPair.getFirst(); DetailedStackStatus status; if (areAllStatusTheSame(responses) && !hasMissingStatus(responses, notTermiatedStackInstances)) { status = responses.get(0); } else { status = DetailedStackStatus.UNHEALTHY; } return new SyncResult("FreeIpa is " + status + ", " + statusCheckPair.getSecond(), status); } catch (Exception e) { LOGGER.info("Error occurred during status fetch: " + e.getMessage(), e); return new SyncResult("FreeIpa is unreachable, because error occurred: " + e.getMessage(), DetailedStackStatus.UNREACHABLE); } }
Source:
public void testUpdatedDbGeneration() { int size = 3 * ITEMS_COUNT_PER_UPDATE + 10; List<Guid> vmGuids = generateGuidList(size); List<Guid> templatesGuids = generateGuidList(size); List<Guid> removedGuids = Collections.emptyList(); addVms(vmGuids, 2, VMStatus.Down, ImageStatus.OK); addTemplates(templatesGuids, 2, VmTemplateStatus.OK, ImageStatus.OK); initTestForPool(pool1.getId(), vmGuids, templatesGuids, removedGuids); doReturn(2L).when(vmStaticDAO).getDbGeneration(any(Guid.class)); updater.ovfUpdate_timer(); verify(updater, never()).performOvfUpdate(any(Guid.class), any(Map.class)); verify(updater, never()).executeRemoveVmInSpm(any(Guid.class), any(Guid.class), any(Guid.class)); List<Guid> idsThatNeededToBeUpdated = new LinkedList<Guid>(vmGuids); idsThatNeededToBeUpdated.addAll(templatesGuids); verifyCorrectOvfDataUpdaterRun(pool1.getId(), Collections.<Guid> emptyList(), removedGuids); }

Target:
public void testUpdatedDbGeneration() { int size = 3 * ITEMS_COUNT_PER_UPDATE + 10; List<Guid> vmGuids = generateGuidList(size); List<Guid> templatesGuids = generateGuidList(size); List<Guid> removedGuids = Collections.emptyList(); addVms(vmGuids, 2, VMStatus.Down, ImageStatus.OK); addTemplates(templatesGuids, 2, VmTemplateStatus.OK, ImageStatus.OK); initTestForPool(pool1.getId(), vmGuids, templatesGuids, removedGuids); doReturn(2L).when(vmStaticDAO).getDbGeneration(any(Guid.class)); updater.ovfUpdate_timer(); verify(updater, never()).performOvfUpdate(any(Guid.class), anyMap()); verify(updater, never()).executeRemoveVmInSpm(any(Guid.class), any(Guid.class), any(Guid.class)); List<Guid> idsThatNeededToBeUpdated = new LinkedList<Guid>(vmGuids); idsThatNeededToBeUpdated.addAll(templatesGuids); verifyCorrectOvfDataUpdaterRun(pool1.getId(), Collections.<Guid> emptyList(), removedGuids); }
Source:
ImapStore getStore() { return store; }

Target:
private ImapStore getStore() { return store; }
Source:
private Pair<Double, Double> totalCost(final int numWorker, final int numDataBlocks, final int numModelBlocks, final int availableEvaluators, final List<EvaluatorSummary> workers, final List<EvaluatorSummary> servers) { final double workerThroughputSum = workers.subList(0, numWorker).stream() .mapToDouble(worker -> worker.throughput) .sum(); final double compCost = numDataBlocks / workerThroughputSum; final int numServers = availableEvaluators - numWorker; final double serverThroughputSum = servers.subList(0, numServers).stream() .mapToDouble(server -> server.throughput) .sum(); final double commCost = numModelBlocks / serverThroughputSum * numWorker * numMiniBatchPerItr; final double totalCost = compCost + commCost; LOG.log(Level.INFO, "Estimated Cost: (server, worker) = ({0}, {1}), totalCost = {2}, " + "(compCost, commCost) = ({3}, {4})", new Object[] {numServers, numWorker, totalCost, compCost, commCost}); return new Pair<>(compCost, commCost); }

Target:
private Pair<Double, Double> totalCost(final int numWorker, final int numDataBlocks, final int numModelBlocks, final int availableEvaluators, final List<EvaluatorSummary> workers, final List<EvaluatorSummary> servers) { final double workerThroughputSum = workers.subList(0, numWorker).stream() .mapToDouble(worker -> worker.throughput) .sum(); final double compCost = numDataBlocks / workerThroughputSum; final int numServer = availableEvaluators - numWorker; final double serverThroughputSum = servers.subList(0, numServer).stream() .mapToDouble(server -> server.throughput) .sum(); final double commCost = numModelBlocks / serverThroughputSum * numWorker * numMiniBatchPerItr; final double totalCost = compCost + commCost; final String costInfo = String.format("{\"numServer\": %d, \"numWorker\": %d, \"totalCost\": %f, " + "\"compCost\": %f, \"commCost\": %f}", numServer, numWorker, totalCost, compCost, commCost); LOG.log(Level.INFO, "CostInfo {0} {1}", new Object[]{System.currentTimeMillis(), costInfo}); return new Pair<>(compCost, commCost); }
Source:
private boolean indexIsOutOfRange(List<Element> elements) { return elements.size() <= 0 || elementIndex >= elements.size(); }

Target:
private boolean indexIsOutOfRange(List<Element> elements) { return elements.isEmpty() || elementIndex >= elements.size(); }
Source:
private void assertRequest(final String testCaseNameRequest, final String testCaseXml, final String testSuiteXml) { final WsdlTestCase wsdlTestcase = (WsdlTestCase) this.testCase; final String xml = wsdlTestcase.getConfig().toString(); final boolean flag1 = xml.indexOf(testCaseNameRequest) > 0; final boolean flag2 = xml.indexOf(testCaseXml) > 0; final boolean flag3 = xml.indexOf(testSuiteXml) > 0; try {if (!flag1 || !flag2 || !flag3) { } } catch (NullPointerException npe) { System.out.println(npe.getMessage() + " thrown!"); } }

Target:
private void assertRequest(final String testCaseNameRequest, final String testCaseXml, final String testSuiteXml) { final WsdlTestCase wsdlTestcase = (WsdlTestCase) this.testCase; final String xml = wsdlTestcase.getConfig().toString(); final boolean flag1 = xml.indexOf(testCaseNameRequest) > 0; final boolean flag2 = xml.indexOf(testCaseXml) > 0; final boolean flag3 = xml.indexOf(testSuiteXml) > 0; if (!flag1 || !flag2 || !flag3) { } }
Source:
public void testMultipleProviderTypesFound() throws Exception { TestFrameworkProvider anotherProvider = new TestFrameworkProvider() { @Override public boolean isEnabled(List<ClasspathEntry> testBundleClassPath, Properties surefireProperties) { return true; } @Override public Version getVersion() { return new Version("1.0"); } @Override public String getType() { return "another_test_fwk"; } @Override public String getSurefireProviderClassName() { return "a.nother.test.framework.Provider"; } @Override public List<Dependency> getRequiredBundles() { return emptyList(); } @Override public Properties getProviderSpecifcProperties() { return null; } }; PlexusContainer container = getContainer(); container.addComponent(anotherProvider, TestFrameworkProvider.class, "another_test_fwk"); ProviderHelper providerSelector = container.lookup(ProviderHelper.class); try { providerSelector.selectProvider(classPath("org.junit:4.8.1"), new Properties(), null); fail(); } catch (MojoExecutionException e) { } finally { container.release(anotherProvider); } }

Target:
public void testMultipleProviderTypesFound() throws Exception { TestFrameworkProvider anotherProvider = new TestFrameworkProvider() { @Override public boolean isEnabled(List<ClasspathEntry> testBundleClassPath, Properties surefireProperties) { return true; } @Override public Version getVersion() { return new Version("1.0"); } @Override public String getType() { return "another_test_fwk"; } @Override public String getSurefireProviderClassName() { return "a.nother.test.framework.Provider"; } @Override public List<Dependency> getRequiredBundles() { return emptyList(); } @Override public Properties getProviderSpecificProperties() { return null; } }; PlexusContainer container = getContainer(); container.addComponent(anotherProvider, TestFrameworkProvider.class, "another_test_fwk"); ProviderHelper providerSelector = container.lookup(ProviderHelper.class); try { providerSelector.selectProvider(classPath("org.junit:4.8.1"), new Properties(), null); fail(); } catch (MojoExecutionException e) { } finally { container.release(anotherProvider); } }
Source:
private static Collection<PlayerTypes.Type> gatherPlayerTypes() { return Stream.concat( StreamSupport.stream(ServiceLoader.load(AiProvider.class).spliterator(), false) .map(PlayerTypes.AiType::new), PlayerTypes.getBuiltInPlayerTypes().stream()) .collect(Collectors.toList()); }

Target:
private static Collection<PlayerTypes.Type> gatherPlayerTypes() { return Stream.concat( PlayerTypes.getBuiltInPlayerTypes().stream(), StreamSupport.stream(ServiceLoader.load(AiProvider.class).spliterator(), false) .map(PlayerTypes.AiType::new)) .filter(HeadedGameRunner::filterBetaPlayerType) .collect(Collectors.toList()); }
Source:
public boolean onAddBlockEvent(WorldServer.ServerBlockEventList list, Object obj, BlockPos pos, Block blockIn, int eventId, int eventParam) { if (blockIn instanceof BlockPistonBase) { final IBlockState blockstate = this.getBlockState(pos); EnumFacing direction = (EnumFacing) blockstate.getValue(BlockDirectional.FACING); BlockPistonStructureHelper movedBlocks = new BlockPistonStructureHelper(this$, pos, direction, eventId == 0); List<BlockPos> blocks = new ArrayList<BlockPos>(); blocks.addAll(movedBlocks.getBlocksToDestroy()); blocks.addAll(movedBlocks.getBlocksToMove()); List<Location<org.spongepowered.api.world.World>> locations = new ArrayList<Location<org.spongepowered.api.world.World>>(); for (BlockPos block : blocks) { locations.add(new Location<>((org.spongepowered.api.world.World) this$, block.getX(), block.getY(), block.getZ())); } if (SpongeCommonEventFactory.handleChangeBlockEventPre(this, pos, locations)) { return false; } } else { if (SpongeCommonEventFactory.handleChangeBlockEventPre(this, pos)) { return false; } } if (CauseTracker.ENABLED) { final CauseTracker causeTracker = this.getCauseTracker(); final PhaseData currentPhase = causeTracker.getCurrentPhaseData(); final IPhaseState phaseState = currentPhase.state; if (phaseState.getPhase().ignoresBlockEvent(phaseState)) { return list.add((BlockEventData) obj); } final BlockEventData blockEventData = (BlockEventData) obj; final PhaseContext context = currentPhase.context; IMixinBlockEventData blockEvent = (IMixinBlockEventData) blockEventData; phaseState.getPhase().addNotifierToBlockEvent(phaseState, context, causeTracker, pos, blockEvent); } return list.add((BlockEventData) obj); }

Target:
public boolean onAddBlockEvent(WorldServer.ServerBlockEventList list, Object obj, BlockPos pos, Block blockIn, int eventId, int eventParam) { if ((blockIn instanceof BlockPistonBase && SpongeCommonEventFactory.handlePistonEvent(this, list, obj, pos, blockIn, eventId, eventParam)) || SpongeCommonEventFactory.callChangeBlockEventPre(this, pos, NamedCause.of(NamedCause.BLOCK_EVENT, this)).isCancelled()) { return false; } if (CauseTracker.ENABLED) { final CauseTracker causeTracker = this.getCauseTracker(); final PhaseData currentPhase = causeTracker.getCurrentPhaseData(); final IPhaseState phaseState = currentPhase.state; if (phaseState.getPhase().ignoresBlockEvent(phaseState)) { return list.add((BlockEventData) obj); } final BlockEventData blockEventData = (BlockEventData) obj; final PhaseContext context = currentPhase.context; IMixinBlockEventData blockEvent = (IMixinBlockEventData) blockEventData; phaseState.getPhase().addNotifierToBlockEvent(phaseState, context, causeTracker, pos, blockEvent); } return list.add((BlockEventData) obj); }
Source:
public String renderNavigationMenu(HttpServletRequest request, String menuDefinition, String rendererClass, int minDepth, int maxDepth) throws Exception { URL url = request.getServletContext().getResource(menuDefinition); return renderNavigationMenu(url, request, rendererClass, minDepth, maxDepth); }

Target:
public String renderNavigationMenu(HttpServletRequest request, String menuDefinition, String rendererClass, int minDepth, int maxDepth) throws Exception { URL url = request.getSession().getServletContext().getResource(menuDefinition); return renderNavigationMenu(url, request, rendererClass, minDepth, maxDepth); }
Source:
public Receive createReceive() { return new ReceiveBuilder() .matchEquals(TICK, msg -> tick()) .matchEquals(REQUEST_FINISHED, msg -> { _nAvailableRequests += 1; tick(); }) .match(Task.class, task -> { if (_queue.size() < _bufferSize) { _queue.add(task); getSender().tell(new Status.Success(task), getSelf()); recordCounter("buffer_size", _queue.size()); recordCounter("submit/success", 1); tick(); } else { getSender().tell(new Status.Failure(BufferFull.getInstance()), getSelf()); recordCounter("submit/success", 0); } }) .match(SampleCounts.class, this::sampleCountsReceived) .build(); }

Target:
public Receive createReceive() { return new ReceiveBuilder() .matchEquals(TICK, msg -> tick()) .matchEquals(REQUEST_FINISHED, msg -> { _nAvailableRequests += 1; tick(); }) .match(Task.class, task -> { if (_queue.size() < _bufferSize) { _queue.add(task); getSender().tell(new Status.Success(task), getSelf()); _maxRecentBufferSize.accumulateAndGet(_queue.size(), Math::max); recordCounter("submit/success", 1); tick(); } else { getSender().tell(new Status.Failure(BufferFull.getInstance()), getSelf()); recordCounter("submit/success", 0); } }) .match(SampleCounts.class, this::sampleCountsReceived) .build(); }
Source:
public void onDestroyActionMode(ActionMode mode) { mCallbacks.onActionModeDestroyed(); mActionMode = null; if (getActivity() != null) { NotesActivity notesActivity = (NotesActivity) getActivity(); setActivateOnItemClick(DisplayUtils.isLargeScreenLandscape(notesActivity)); if(mSelectedNoteId == null) notesActivity.showDetailPlaceholder(); } }

Target:
public void onDestroyActionMode(ActionMode mode) { mCallbacks.onActionModeDestroyed(); mActionMode = null; if (getActivity() != null) { NotesActivity notesActivity = (NotesActivity) getActivity(); setActivateOnItemClick(DisplayUtils.isLargeScreenLandscape(notesActivity)); if (mSelectedNoteId == null) { notesActivity.showDetailPlaceholder(); } } new Handler().postDelayed( new Runnable() { @Override public void run() { requireActivity().getWindow().setStatusBarColor(getResources().getColor(android.R.color.transparent, requireActivity().getTheme())); } }, requireContext().getResources().getInteger(android.R.integer.config_longAnimTime) ); }
Source:
private DataSource getDataSource(DBConfig dbConfig, DBPasswordExtractor dbPasswordExtractor) { HikariConfig config = new HikariConfig(); config.setJdbcUrl(dbConfig.getUrl()); config.setUsername(dbConfig.getUser()); config.setPassword(dbPasswordExtractor.getDBPassword(dbConfig)); config.setDriverClassName(dbConfig.getDriver()); dbConfig.getPropertyMap().forEach((k, v) -> config.addDataSourceProperty(k, v)); return new HikariDataSource(config); }

Target:
private static DataSource getDataSource(DBConfig dbConfig, DBPasswordExtractor dbPasswordExtractor) { HikariConfig config = new HikariConfig(); config.setJdbcUrl(dbConfig.getUrl()); config.setUsername(dbConfig.getUser()); config.setPassword(dbPasswordExtractor.getDBPassword(dbConfig)); config.setDriverClassName(dbConfig.getDriver()); dbConfig.getPropertyMap().forEach((k, v) -> config.addDataSourceProperty(k, v)); return new HikariDataSource(config); }
Source:
public void abortProcessInstances(List<Long> processInstanceIds) { processInstanceIds.stream().forEach(processInstanceId -> { try { abortProcessInstance(processInstanceId); } catch (ProcessInstanceNotFoundException processInstanceNotFoundException) { logger.warn(processInstanceNotFoundException.getMessage()); } }); }

Target:
public void abortProcessInstances(List<Long> processInstanceIds) { processInstanceIds.forEach(processInstanceId -> { try { abortProcessInstance(processInstanceId); } catch (ProcessInstanceNotFoundException ex) { logger.warn("Process instance with id " + processInstanceId + " was not found", ex); } }); }
Source:
public List<ClientModel> getClients(RealmModel realm, Integer firstResult, Integer maxResults) { TypedQuery<String> query = em.createNamedQuery("getClientIdsByRealm", String.class); if (firstResult != null && firstResult > 0) { query.setFirstResult(firstResult); } if (maxResults != null && maxResults > 0) { query.setMaxResults(maxResults); } query.setParameter("realm", realm.getId()); List<String> clients = query.getResultList(); if (clients.isEmpty()) return Collections.emptyList(); List<ClientModel> list = new LinkedList<>(); for (String id : clients) { ClientModel client = session.realms().getClientById(id, realm); if (client != null) list.add(client); } return Collections.unmodifiableList(list); }

Target:
public List<ClientModel> getClients(RealmModel realm, Integer firstResult, Integer maxResults) { TypedQuery<String> query = em.createNamedQuery("getClientIdsByRealm", String.class); if (firstResult != null && firstResult > 0) { query.setFirstResult(firstResult); } if (maxResults != null && maxResults > 0) { query.setMaxResults(maxResults); } query.setParameter("realm", realm.getId()); List<String> clients = query.getResultList(); if (clients.isEmpty()) return Collections.EMPTY_LIST; List<ClientModel> list = new LinkedList<>(); for (String id : clients) { ClientModel client = session.realms().getClientById(id, realm); if (client != null) list.add(client); } return Collections.unmodifiableList(list); }
Source:
public void testBatchWithoutOngoingTMSuspension() throws Exception { Cache<String, String> cache = createCache("testBatchWithoutOngoingTMSuspension"); TransactionManager tm = TestingUtil.getTransactionManager(cache); assertEquals(MyDummyTransactionManager.class, tm.getClass()); assertNull(tm.getTransaction(), "Should have no ongoing txs"); cache.startBatch(); cache.put("k", "v"); assertNull(tm.getTransaction(), "Should have no ongoing txs"); cache.put("k2", "v2"); assertNull(getOnDifferentThread(cache, "k")); assertNull(getOnDifferentThread(cache, "k2")); try { tm.commit(); } catch (Exception e) { } assertNull(tm.getTransaction(), "Should have no ongoing txs"); assertNull(getOnDifferentThread(cache, "k")); assertNull(getOnDifferentThread(cache, "k2")); cache.endBatch(true); assertEquals("v", getOnDifferentThread(cache, "k")); assertEquals("v2", getOnDifferentThread(cache, "k2")); }

Target:
public void testBatchWithoutOngoingTMSuspension() throws Exception { Cache<String, String> cache = createCache("testBatchWithoutOngoingTMSuspension"); TransactionManager tm = TestingUtil.getTransactionManager(cache); assertEquals(MyDummyTransactionManager.class, tm.getClass()); assertNull("Should have no ongoing txs", tm.getTransaction()); cache.startBatch(); cache.put("k", "v"); assertNull("Should have no ongoing txs", tm.getTransaction()); cache.put("k2", "v2"); assertNull(getOnDifferentThread(cache, "k")); assertNull(getOnDifferentThread(cache, "k2")); try { tm.commit(); } catch (Exception e) { } assertNull("Should have no ongoing txs", tm.getTransaction()); assertNull(getOnDifferentThread(cache, "k")); assertNull(getOnDifferentThread(cache, "k2")); cache.endBatch(true); assertEquals("v", getOnDifferentThread(cache, "k")); assertEquals("v2", getOnDifferentThread(cache, "k2")); }
Source:
public Builder(JLoadProfileUsers userGroup, JLoadProfileUsers... userGroups) { Objects.nonNull(userGroup); ArrayList<JLoadProfileUsers> groups = new ArrayList<>(); groups.add(userGroup); Collections.addAll(groups, userGroups); this.userGroups = groups; this.tickInterval = 1000; }

Target:
public Builder(JLoadProfileUsers userGroup, JLoadProfileUsers... userGroups) { Objects.nonNull(userGroup); ArrayList<JLoadProfileUsers> groups = new ArrayList<>(); groups.add(userGroup); Collections.addAll(groups, userGroups); this.userGroups = groups; this.tickInterval = DEFAULT_TICK_INTERVAL; }
Source:
private void initiatePersonasSearch(List<BlackboardAttribute> accountAttributesList) throws CentralRepoException { GridBagLayout gridBagLayout = new GridBagLayout(); GridBagConstraints constraints = new GridBagConstraints(); constraints.anchor = GridBagConstraints.FIRST_LINE_START; constraints.gridx = 0; constraints.gridy = 0; constraints.insets = new java.awt.Insets(TOP_INSET, 0, 0, 0); constraints.fill = GridBagConstraints.NONE; constraints.weightx = 0; javax.swing.Box.Filler filler1 = this.createFiller(5, 0); personasPanel.add(filler1, constraints); constraints.gridx++; javax.swing.JLabel primaryPersonaNameLabel = new javax.swing.JLabel(); primaryPersonaNameLabel.setText(Bundle.ContactArtifactViewer_persona_searching()); gridBagLayout.setConstraints(primaryPersonaNameLabel, constraints); personasPanel.add(primaryPersonaNameLabel); personasPanel.setLayout(gridBagLayout); personasPanel.revalidate(); ContactPersonaSearcherTask personaSearchTask = new ContactPersonaSearcherTask(accountAttributesList); personaSearchTask.execute(); }

Target:
private void initiatePersonasSearch(List<BlackboardAttribute> accountAttributesList) throws CentralRepoException { personasLabel.setVisible(true); GridBagLayout gridBagLayout = new GridBagLayout(); GridBagConstraints constraints = new GridBagConstraints(); constraints.anchor = GridBagConstraints.FIRST_LINE_START; constraints.gridx = 0; constraints.gridy = 0; constraints.insets = new java.awt.Insets(TOP_INSET, LEFT_INSET, 0, 0); constraints.fill = GridBagConstraints.NONE; constraints.weightx = 0; javax.swing.JLabel personaLabel = new javax.swing.JLabel(); personaLabel.setText(Bundle.ContactArtifactViewer_persona_label()); personaLabel.setFont(personaLabel.getFont().deriveFont(Font.BOLD, personaLabel.getFont().getSize())); gridBagLayout.setConstraints(personaLabel, constraints); personasPanel.add(personaLabel); constraints.gridy++; javax.swing.JLabel primaryPersonaNameLabel = new javax.swing.JLabel(); primaryPersonaNameLabel.setText(Bundle.ContactArtifactViewer_persona_searching()); gridBagLayout.setConstraints(primaryPersonaNameLabel, constraints); personasPanel.add(primaryPersonaNameLabel); personasPanel.setLayout(gridBagLayout); personasPanel.revalidate(); personasPanel.repaint(); ContactPersonaSearcherTask personaSearchTask = new ContactPersonaSearcherTask(accountAttributesList); personaSearchTask.execute(); }
Source:
public void updateRegionsInTransitionMetrics() { long currentTime = System.currentTimeMillis(); int totalRITs = 0; int totalRITsOverThreshold = 0; long oldestRITTime = 0; Set<String> oldestRITHashesAndStates = Sets.newHashSet(); int ritThreshold = this.server.getConfiguration(). getInt(HConstants.METRICS_RIT_STUCK_WARNING_THRESHOLD, 60000); int counter = 0; for (RegionState state: regionStates.getRegionsInTransitionOrderedByDuration()) { totalRITs++; long ritTime = currentTime - state.getStamp(); if (ritTime > ritThreshold) { totalRITsOverThreshold++; } if (oldestRITTime < ritTime) { oldestRITTime = ritTime; } if (counter < 500) { oldestRITHashesAndStates.add( state.getRegion().getRegionNameAsString() + ":" + state.getState().name() ); } counter += 1; } if (this.metricsAssignmentManager != null) { this.metricsAssignmentManager.updateRITOldestAge(oldestRITTime); this.metricsAssignmentManager.updateRITCount(totalRITs); this.metricsAssignmentManager.updateRITCountOverThreshold(totalRITsOverThreshold); LOG.debug("Oldest RIT hashes and states: " + oldestRITHashesAndStates.toString()); long time = EnvironmentEdgeManager.currentTime(); if ((time - ritThreshold / 2) >= this.lastRITHashMetricUpdate) { this.metricsAssignmentManager.updateRITHashesAndStates(oldestRITHashesAndStates); this.lastRITHashMetricUpdate = time; } } }

Target:
public void updateRegionsInTransitionMetrics() { long currentTime = System.currentTimeMillis(); int totalRITs = 0; int totalRITsOverThreshold = 0; long oldestRITTime = 0; Set<String> oldestRITHashesAndStates = Sets.newHashSet(); int ritThreshold = this.server.getConfiguration(). getInt(HConstants.METRICS_RIT_STUCK_WARNING_THRESHOLD, 60000); int counter = 0; for (RegionState state: regionStates.getRegionsInTransitionOrderedByTimestamp()) { totalRITs++; long ritTime = currentTime - state.getStamp(); if (ritTime > ritThreshold) { totalRITsOverThreshold++; } if (oldestRITTime < ritTime) { oldestRITTime = ritTime; } if ((counter < NUMBER_OF_RITS_TO_RECORD) && (ritTime > ritThreshold)) { oldestRITHashesAndStates.add( state.getRegion().getEncodedName() + ":" + state.getState().name() ); } counter += 1; } if (this.metricsAssignmentManager != null) { this.metricsAssignmentManager.updateRITOldestAge(oldestRITTime); this.metricsAssignmentManager.updateRITCount(totalRITs); this.metricsAssignmentManager.updateRITCountOverThreshold(totalRITsOverThreshold); this.metricsAssignmentManager.updateRITHashesAndStates(oldestRITHashesAndStates); this.lastRITHashMetricUpdate = currentTime; if (((currentTime - ritThreshold / 2) >= this.lastRITHashMetricUpdate) && oldestRITHashesAndStates.size() > 0) { LOG.debug("Oldest RIT hashes and states: " + oldestRITHashesAndStates.toString()); } } }
Source:
public void run() { boolean isDebug = java.lang.management.ManagementFactory.getRuntimeMXBean(). getInputArguments().toString().indexOf("-agentlib:jdwp") > 0; SoapUIUpdateProvider updateProvider = SoapUIAutoUpdaterUtils.getProvider(); if (!isDebug && SoapUI.getSettings().getBoolean(VersionUpdateSettings.AUTO_CHECK_VERSION_UPDATE)) { updateProvider.start(); } addStandardPreferencesShortcutOnMac(); boolean isFirstLaunch = !DefaultSoapUICore.settingsFileExists(); Properties props = new Properties(); try { props.load(SoapUI.class.getResourceAsStream(SOAPUI_TITLE)); String brandedTitleExt = props.getProperty("soapui.app.title"); if (!StringUtils.isNullOrEmpty(brandedTitleExt)) { brandedTitleExt = " - " + brandedTitleExt; } else { brandedTitleExt = ""; } startSoapUI(mainArgs, "SoapUI " + SOAPUI_VERSION + " " + brandedTitleExt, new StandaloneSoapUICore(true)); if (getSettings().getBoolean(UISettings.SHOW_STARTUP_PAGE) && !isBrowserDisabled()) { SwingUtilities.invokeLater(new Runnable() { public void run() { showStarterPage(); } }); } if (isFirstLaunch && SoapUI.usingGraphicalEnvironment()) { if (!SoapUI.getSettings().getBoolean(SHOW_ENDPOINT_EXPLORER_ON_START, true)) { SwingUtilities.invokeLater(SoapUI::showEndpointExplorer); } } if (isCommandLine()) { Analytics.trackAction(SoapUIActions.PRODUCT_STARTED_FROM_CMD); } } catch (Exception e) { e.printStackTrace(); System.exit(1); } }

Target:
public void run() { boolean isDebug = java.lang.management.ManagementFactory.getRuntimeMXBean(). getInputArguments().toString().indexOf("-agentlib:jdwp") > 0; SoapUIUpdateProvider updateProvider = SoapUIAutoUpdaterUtils.getProvider(); if (!isDebug && SoapUI.getSettings().getBoolean(VersionUpdateSettings.AUTO_CHECK_VERSION_UPDATE)) { updateProvider.start(); } addStandardPreferencesShortcutOnMac(); Properties props = new Properties(); try { props.load(SoapUI.class.getResourceAsStream(SOAPUI_TITLE)); String brandedTitleExt = props.getProperty("soapui.app.title"); if (!StringUtils.isNullOrEmpty(brandedTitleExt)) { brandedTitleExt = " - " + brandedTitleExt; } else { brandedTitleExt = ""; } startSoapUI(mainArgs, "SoapUI " + SOAPUI_VERSION + " " + brandedTitleExt, new StandaloneSoapUICore(true)); if (getSettings().getBoolean(UISettings.SHOW_STARTUP_PAGE) && !isBrowserDisabled()) { SwingUtilities.invokeLater(new Runnable() { public void run() { showStarterPage(); } }); } if (isCommandLine()) { Analytics.trackAction(SoapUIActions.PRODUCT_STARTED_FROM_CMD); } } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
Source:
public final Map<String, SiteStatus> globalStatus() { final Iterator<CacheXSiteAdminOperation> iterator = collectXSiteAdminOperation().iterator(); if (!iterator.hasNext()) { return Collections.emptyMap(); } Map<String, ContainerSiteStatusBuilder> siteStatusBuilderMap = new HashMap<>(); while (iterator.hasNext()) { CacheXSiteAdminOperation xsiteAdminOperation = iterator.next(); Map<String, SiteStatus> perCacheSiteStatus = xsiteAdminOperation.xSiteAdminOperations.clusterStatus(); for (Map.Entry<String, SiteStatus> siteStatus : perCacheSiteStatus.entrySet()) { String siteName = siteStatus.getKey(); SiteStatus status = siteStatus.getValue(); ContainerSiteStatusBuilder builder = siteStatusBuilderMap.get(siteName); if (builder == null) { builder = new ContainerSiteStatusBuilder(); siteStatusBuilderMap.put(siteName, builder); } builder.addCacheName(xsiteAdminOperation.cacheName, status); } } Map<String, SiteStatus> result = new HashMap<>(); for (Map.Entry<String, ContainerSiteStatusBuilder> builder : siteStatusBuilderMap.entrySet()) { result.put(builder.getKey(), builder.getValue().build()); } return result; }

Target:
public final Map<String, SiteStatus> globalStatus() { final Iterator<CacheXSiteAdminOperation> iterator = collectXSiteAdminOperation().iterator(); if (!iterator.hasNext()) { return Collections.emptyMap(); } Map<String, ContainerSiteStatusBuilder> siteStatusBuilderMap = new HashMap<>(); while (iterator.hasNext()) { CacheXSiteAdminOperation xsiteAdminOperation = iterator.next(); xsiteAdminOperation.xSiteAdminOperations.clusterStatus().forEach((site, status) -> { ContainerSiteStatusBuilder builder = siteStatusBuilderMap.get(site); if (builder == null) { builder = new ContainerSiteStatusBuilder(); siteStatusBuilderMap.put(site, builder); } builder.addCacheName(xsiteAdminOperation.cacheName, status); }); } Map<String, SiteStatus> result = new HashMap<>(); siteStatusBuilderMap.forEach((site, builder) -> result.put(site, builder.build())); return result; }