auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Iterable<GroupInformationType> createGroupInformationElementsFor(Content content) { if (!permit.isPermitted(content)) { return ImmutableSet.of(); } if (content instanceof Film) { return ImmutableSet.of(groupInfoGenerator.generate((Film) content)); } if (content instanceof Brand) { return ImmutableSet.of(groupInfoGenerator.generate((Brand) content, hierarchy.lastItemFrom((Brand) content))); } if (content instanceof Series) { ImmutableSet.Builder<GroupInformationType> groupInfoElems = ImmutableSet.builder(); Series series = (Series) content; Optional<Brand> brand = hierarchy.brandFor(series); groupInfoElems.add(groupInfoGenerator.generate(series, brand, hierarchy.lastItemFrom(series))); if (brand.isPresent() && permit.isPermitted(brand.get())) { groupInfoElems.add(groupInfoGenerator.generate(brand.get(), hierarchy.lastItemFrom(brand.get()))); } return groupInfoElems.build(); } if (content instanceof Item) { ImmutableSet.Builder<GroupInformationType> groupInfoElems = ImmutableSet.builder(); Item item = (Item) content; Optional<Series> series = hierarchy.seriesFor(item); Optional<Brand> brand = hierarchy.brandFor(item); groupInfoElems.add(groupInfoGenerator.generate(item, series, brand)); if (series.isPresent() && permit.isPermitted(series.get())) { groupInfoElems.add(groupInfoGenerator.generate(series.get(), brand, hierarchy.lastItemFrom(series.get()))); } if (brand.isPresent() && permit.isPermitted(brand.get())) { groupInfoElems.add(groupInfoGenerator.generate(brand.get(), hierarchy.lastItemFrom(brand.get()))); } return groupInfoElems.build(); } throw new UnexpectedContentTypeException(content); }

Target:
public Iterable<GroupInformationType> createGroupInformationElementsFor(Content content) { if (!permit.isPermitted(content)) { return ImmutableSet.of(); } if (content instanceof Film) { return groupInfoElemsForFilm(content); } if (content instanceof Brand) { return groupInfoElemsForBrand(content); } if (content instanceof Series) { return groupInfoElemsForSeries(content); } if (content instanceof Item) { return groupInfoElemsForItem(content); } throw new UnexpectedContentTypeException(content); }
Source:
private static List<Path> findOpenOfficeDirectories(List<Path> programDirectories) { BiPredicate<Path, BasicFileAttributes> filePredicate = (path, attr) -> attr.isDirectory() && (path.toString().toLowerCase(Locale.ROOT).contains("openoffice") || path.toString().toLowerCase(Locale.ROOT).contains("libreoffice")); return programDirectories.stream().flatMap(dirs -> { try { return Files.find(dirs, 1, filePredicate); } catch (IOException e) { return Stream.empty(); } }).collect(Collectors.toList()); }

Target:
private static List<Path> findOpenOfficeDirectories(List<Path> programDirectories) { BiPredicate<Path, BasicFileAttributes> filePredicate = (path, attr) -> attr.isDirectory() && (path.toString().toLowerCase(Locale.ROOT).contains("openoffice") || path.toString().toLowerCase(Locale.ROOT).contains("libreoffice")); return programDirectories.stream().flatMap(dirs -> { try { return Files.find(dirs, 1, filePredicate); } catch (IOException e) { LOGGER.error("Problem searching for openoffice/libreoffice install directory", e); return Stream.empty(); } }).collect(Collectors.toList()); }
Source:
public void setCurrentTabId(String category, String tabId, String... subTabIds) { if (category != null && category.equals(MAIN_TABS_CATEGORY) && tabId != null && currentTabActions.getCurrentTabIds() != null && !currentTabActions.getCurrentTabIds().startsWith(category + ":" + tabId)) { Events.instance().raiseEvent(EventNames.MAIN_TABS_CHANGED); } currentTabActions.setCurrentTabId(actionManager, createActionContext(), category, tabId, subTabIds); if (WebActions.DEFAULT_TABS_CATEGORY.equals(category)) { resetSubTabs(); } }

Target:
public void setCurrentTabId(String category, String tabId, String... subTabIds) { if (category != null && category.equals(MAIN_TABS_CATEGORY) && tabId != null && currentTabActions.getCurrentTabIds() != null && !tabId.equals(getCurrentTabId(MAIN_TABS_CATEGORY))) { Events.instance().raiseEvent(EventNames.MAIN_TABS_CHANGED); } currentTabActions.setCurrentTabId(actionManager, createActionContext(), category, tabId, subTabIds); if (WebActions.DEFAULT_TABS_CATEGORY.equals(category)) { resetSubTabs(); } }
Source:
public void onResume() { super.onResume(); boolean usersExist = true; UserAccount selectedAccount = null; final List<UserAccount> accounts = getAccounts(); if (accounts == null) { usersExist = false; } final String userHint = spConfig.getUserHint(); if (!TextUtils.isEmpty(userHint)) { final String[] userParts = userHint.split(COLON); if (userParts.length == 2) { final String orgId = userParts[0]; final String userId = userParts[1]; selectedAccount = SalesforceSDKManager.getInstance(). getUserAccountManager().getUserFromOrgAndUserId(orgId, userId); if (selectedAccount != null) { usersExist = true; } } } if (!usersExist) { accountSelected(null); } else { if (selectedAccount != null) { accountSelected(selectedAccount); } } }

Target:
public void onResume() { super.onResume(); UserAccount selectedAccount = null; final String userHint = spConfig.getUserHint(); if (!TextUtils.isEmpty(userHint)) { final String[] userParts = userHint.split(COLON); if (userParts.length == 2) { final String orgId = userParts[0]; final String userId = userParts[1]; selectedAccount = SalesforceSDKManager.getInstance(). getUserAccountManager().getUserFromOrgAndUserId(orgId, userId); } } if (selectedAccount != null || getAccounts() == null) { accountSelected(selectedAccount); } }
Source:
static URL getDockerImageUrl(String os, String version) throws MalformedURLException { if (parseVersion(version).isNewerThan(parseVersion("17.05.0-ce"))) return new URL("<LINK_0>" + os + "/docker-" + version); String osName=""; if (os.startsWith("linux")) osName = "Linux"; if (os.startsWith("win")) osName = "Windows"; if (os.startsWith("mac")) osName = "Darwin"; return new URL("<LINK_1>" + osName + os.substring(os.lastIndexOf("/")) + "/docker-" + version); }

Target:
static URL getDockerImageUrl(String os, String version) throws MalformedURLException { final int i = os.indexOf("/"); if (parseVersion(version).isNewerThan(parseVersion("17.05.0-ce"))) { return new URL("<LINK_0>" + os.substring(0, i) + "/static/edge/"+ os.substring(i + 1) + "/docker-" + version); } return new URL("<LINK_1>" + FindArch.asGetDockerArchName(os) + os.substring(i +1) + "/docker-" + version); }
Source:
public DDF transformScaleMinMax(List<String> columns, Boolean inPlace) throws DDFException { Summary[] summaryArr = this.getDDF().getSummary(); StringBuilder sqlCmdBuffer = new StringBuilder("SELECT "); for (int colIndex = 0; colIndex < this.getDDF().getSchema().getNumColumns(); colIndex++) { Column col = this.getDDF().getSchema().getColumn(colIndex); if (!col.isNumeric() || col.getColumnClass() == ColumnClass.FACTOR || ((columns != null) && (!columns.isEmpty()) && (!columns.contains(col.getName()))) ) { sqlCmdBuffer.append(col.getName()).append(","); } else { if (summaryArr[colIndex] == null) { LOG.warn("Missing column summary. transformScaleMinMax ignored for column: " + col.getName()); sqlCmdBuffer.append(col.getName()).append(" "); } else if (Double.compare(summaryArr[colIndex].max(), summaryArr[colIndex].min()) == 0) { LOG.warn("max equals min. transformScaleMinMax ignored for column: " + col.getName()); sqlCmdBuffer.append(col.getName()).append(" "); } else { sqlCmdBuffer.append(String.format("((%s - %s) / %s) as %s ", col.getName(), summaryArr[colIndex].min(), (summaryArr[colIndex].max() - summaryArr[colIndex].min()), col.getName())); } sqlCmdBuffer.append(","); } } sqlCmdBuffer.setLength(sqlCmdBuffer.length() - 1); sqlCmdBuffer.append(" FROM ").append(this.getDDF().getTableName()); DDF newddf = this.getManager().sql2ddf(sqlCmdBuffer.toString(), this.getEngine()); newddf.getMetaDataHandler().copyFactor(this.getDDF()); return inPlace ? this.getDDF().updateInplace(newddf) : newddf; }

Target:
public DDF transformScaleMinMax(List<String> columns, Boolean inPlace) throws DDFException { Summary[] summaryArr = this.getDDF().getSummary(); Schema schema = this.getDDF().getSchema(); StringBuilder sqlCmdBuffer = new StringBuilder("SELECT "); for (int colIndex = 0; colIndex < schema.getNumColumns(); colIndex++) { Column col = schema.getColumn(colIndex); String escapedColName = StringEscapeUtils.escapeJava(col.getName()); if (!isColumnEligibleToScale(col, columns)) { sqlCmdBuffer.append(escapedColName).append(","); } else { if (summaryArr[colIndex] == null) { LOG.warn("Missing column summary. transformScaleMinMax ignored for column: " + col.getName()); sqlCmdBuffer.append(escapedColName).append(" "); } else if (Double.compare(summaryArr[colIndex].max(), summaryArr[colIndex].min()) == 0) { LOG.warn("max equals min. transformScaleMinMax ignored for column: " + col.getName()); sqlCmdBuffer.append(escapedColName).append(" "); } else { sqlCmdBuffer.append(String.format("((%s - %s) / %s) as %s ", escapedColName, summaryArr[colIndex].min(), (summaryArr[colIndex].max() - summaryArr[colIndex].min()), escapedColName)); } sqlCmdBuffer.append(","); } } sqlCmdBuffer.setLength(sqlCmdBuffer.length() - 1); sqlCmdBuffer.append(" FROM ").append(StringEscapeUtils.escapeJava(schema.getTableName())); DDF newddf = this.getManager().sql2ddf(sqlCmdBuffer.toString(), this.getEngine()); newddf.getMetaDataHandler().copyFactor(this.getDDF()); return inPlace ? this.getDDF().updateInplace(newddf) : newddf; }
Source:
private QueryBuilder buildPredicate(String columnName, Domain domain, Type type) { checkArgument(domain.getType().isOrderable(), "Domain type must be orderable"); BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder(); if (domain.getValues().isNone() && domain.isNullAllowed()) { boolQueryBuilder.mustNot(new ExistsQueryBuilder(columnName)); return boolQueryBuilder; } if (domain.getValues().isAll()) { boolQueryBuilder.must(new ExistsQueryBuilder(columnName)); return boolQueryBuilder; } return buildTermQuery(boolQueryBuilder, columnName, domain, type); }

Target:
private QueryBuilder buildPredicate(String columnName, Domain domain, Type type) { checkArgument(domain.getType().isOrderable(), "Domain type must be orderable"); BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder(); if (domain.getValues().isNone()) { boolQueryBuilder.mustNot(new ExistsQueryBuilder(columnName)); return boolQueryBuilder; } if (domain.getValues().isAll()) { boolQueryBuilder.must(new ExistsQueryBuilder(columnName)); return boolQueryBuilder; } return buildTermQuery(boolQueryBuilder, columnName, domain, type); }
Source:
public int hashCode() { int result = EqualityUtils.hashCodeOf(_segmentsFrom); result = EqualityUtils.hashCodeOf(result, _segmentsTo); result = EqualityUtils.hashCodeOf(result, _state); result = EqualityUtils.hashCodeOf(result, _timestamp); return result; }

Target:
public int hashCode() { return Objects.hash(_segmentsFrom, _segmentsTo, _state, _timestamp); }
Source:
private static String generateRandomState() { byte[] randomState = new byte[32]; new SecureRandom().nextBytes(randomState); return Base64.encodeBase64URLSafeString(randomState); }

Target:
static String generateRandomState() { byte[] state = new byte[32]; randomState.nextBytes(state); return Base64.encodeBase64URLSafeString(state); }
Source:
public void onSaveInstanceState(Bundle savedInstanceState) { savedInstanceState.putBoolean(CONTAINS_HERE_FUNCTION, containsHereFunction); super.onSaveInstanceState(savedInstanceState); }

Target:
public void onSaveInstanceState(Bundle savedInstanceState) { super.onSaveInstanceState(savedInstanceState); savedInstanceState.putBoolean(CONTAINS_HERE_FUNCTION, containsHereFunction); savedInstanceState.putBoolean(LOCATION_CHANGED_WHILE_LOADING, locationChangedWhileLoading); }
Source:
public void openRemoveServiceTaskConfirmPopup(ServiceTaskSummary serviceTaskSummary) { if (serviceTaskSummary.getInstalledOn().size() > 0) { confirmPopup.show(constants.RemoveServiceTaskTitle(), constants.Ok(), constants.CanNotRemoveServiceTaskMessage() + " " + serviceTaskSummary.getName(), null); } else { confirmPopup.show(constants.RemoveServiceTaskTitle(), constants.Remove(), constants.RemoveServiceTaskConfirmMessage() + " " + serviceTaskSummary.getName(), () -> refreshServiceTaskList(serviceTaskSummary)); } }

Target:
public void openRemoveServiceTaskConfirmPopup(ServiceTaskSummary serviceTaskSummary) { if (serviceTaskSummary.getInstalledOn().size() > 0) { cannotRemovePopup.alert(constants.RemoveServiceTaskTitle(), constants.CanNotRemoveServiceTaskMessage(serviceTaskSummary.getName())); } else { confirmPopup.show(constants.RemoveServiceTaskTitle(), constants.RemoveServiceTaskAction(), constants.RemoveServiceTaskConfirmMessage(serviceTaskSummary.getName()), () -> refreshServiceTaskList(serviceTaskSummary)); } }
Source:
public void newQos() { if (getWindow() != null) { return; } final NewQosModel<T, P> newQosModel = getNewQosModel(); setWindow(newQosModel); newQosModel.getDataCenters().setItems(Arrays.asList(getEntity())); newQosModel.getDataCenters().setSelectedItem(getEntity()); }

Target:
public void newQos() { if (getWindow() != null) { return; } final NewQosModel<T, P> newQosModel = getNewQosModel(); setWindow(newQosModel); newQosModel.getDataCenters().setItems(Arrays.asList(getEntity()), getEntity()); }
Source:
public RequestMatcherDelegatingAccessDeniedHandler( LinkedHashMap<RequestMatcher, AccessDeniedHandler> handlers, AccessDeniedHandler defaultHandler) { Assert.notEmpty(handlers, "handlers cannot be null or empty"); Assert.notNull(defaultHandler, "defaultHandler cannot be null"); this.handlers = handlers; this.defaultHandler = defaultHandler; }

Target:
public RequestMatcherDelegatingAccessDeniedHandler( LinkedHashMap<RequestMatcher, AccessDeniedHandler> handlers, AccessDeniedHandler defaultHandler) { Assert.notEmpty(handlers, "handlers cannot be null or empty"); Assert.notNull(defaultHandler, "defaultHandler cannot be null"); this.handlers = new LinkedHashMap<>(handlers); this.defaultHandler = defaultHandler; }
Source:
public void bind(UserShow show) { title.setText(show.getTitle()); int p = (int) Math.min(100, ((double) show.getWatchedEpisodes()) / show.getTotalEpisodes() * 100); progress.setProgress(p); if (subscription != null && !subscription.isUnsubscribed()) { subscription.unsubscribe(); } image.setImageResource(R.drawable.tmp_placeholder); subscription = show.requestImageUrl() .observeOn(AndroidSchedulers.mainThread()) .subscribe(url -> Glide.with(getContext()) .load(url) .centerCrop() .into(image)); }

Target:
public void bind(UserShow show) { title.setText(show.getTitle()); progress.setMax(show.getTotalEpisodes()); progress.setProgress(show.getWatchedEpisodes()); if (subscription != null && !subscription.isUnsubscribed()) { subscription.unsubscribe(); } image.setImageResource(R.drawable.tmp_placeholder); subscription = show.requestImageUrl() .observeOn(AndroidSchedulers.mainThread()) .subscribe(url -> Glide.with(getContext()) .load(url) .centerCrop() .into(image)); }
Source:
public static IAnswerData getAnswerData(FormEntryPrompt formEntryPrompt, String data){ if(formEntryPrompt.getDataType() == Constants.DATATYPE_CHOICE){ int index = Integer.parseInt(data); SelectChoice ans = formEntryPrompt.getSelectChoices().get(index -1); return new SelectOneData(ans.selection()); } else if(formEntryPrompt.getDataType() == Constants.DATATYPE_CHOICE_LIST){ String[] split = parseMultiSelectString(data); Vector<Selection> ret = new Vector<>(); for (String s: split){ int index = Integer.parseInt(s); Selection ans = formEntryPrompt.getSelectChoices().get(index -1).selection(); ret.add(ans); } return new SelectMultiData(ret); } else if (formEntryPrompt.getDataType() == Constants.DATATYPE_GEOPOINT){ return AnswerDataFactory.template(formEntryPrompt.getControlType(), formEntryPrompt.getDataType()).cast( new UncastData(data.replace(",", " ").replace("[","").replace("]", ""))); } return data.equals("") ? null : AnswerDataFactory.template(formEntryPrompt.getControlType(), formEntryPrompt.getDataType()).cast(new UncastData(data)); }

Target:
public static IAnswerData getAnswerData(FormEntryPrompt formEntryPrompt, String data) { int index; switch(formEntryPrompt.getDataType()){ case Constants.DATATYPE_CHOICE: index = Integer.parseInt(data); SelectChoice selectChoiceAnswer = formEntryPrompt.getSelectChoices().get(index - 1); return new SelectOneData(selectChoiceAnswer.selection()); case Constants.DATATYPE_CHOICE_LIST: String[] split = parseMultiSelectString(data); Vector<Selection> ret = new Vector<>(); for (String s : split) { index = Integer.parseInt(s); Selection selection = formEntryPrompt.getSelectChoices().get(index - 1).selection(); ret.add(selection); } return new SelectMultiData(ret); case Constants.DATATYPE_GEOPOINT: return AnswerDataFactory.template(formEntryPrompt.getControlType(), formEntryPrompt.getDataType()).cast( new UncastData(convertTouchFormsGeoPointString(data))); } return data.equals("") ? null : AnswerDataFactory.template(formEntryPrompt.getControlType(), formEntryPrompt.getDataType()).cast(new UncastData(data)); }
Source:
private EmpiTransactionContext createEmpiContext(ResourceModifiedMessage theMsg) { TransactionLogMessages transactionLogMessages = TransactionLogMessages.createFromTransactionGuid(theMsg.getTransactionId()); EmpiTransactionContext.OperationType empiOperation; switch (theMsg.getOperationType()) { case CREATE: empiOperation = EmpiTransactionContext.OperationType.CREATE_RESOURCE; break; case UPDATE: empiOperation = EmpiTransactionContext.OperationType.UPDATE_RESOURCE; break; case MANUALLY_TRIGGERED: empiOperation = EmpiTransactionContext.OperationType.SUBMIT_RESOURCES_TO_EMPI; break; case DELETE: default: ourLog.trace("Not creating an EmpiTransactionContext for {}", theMsg.getOperationType()); throw new InvalidRequestException("We can't handle non-update/create operations in EMPI"); } return new EmpiTransactionContext(transactionLogMessages, empiOperation); }

Target:
private EmpiTransactionContext createEmpiContext(ResourceModifiedMessage theMsg) { TransactionLogMessages transactionLogMessages = TransactionLogMessages.createFromTransactionGuid(theMsg.getTransactionId()); EmpiTransactionContext.OperationType empiOperation; switch (theMsg.getOperationType()) { case CREATE: empiOperation = EmpiTransactionContext.OperationType.CREATE_RESOURCE; break; case UPDATE: empiOperation = EmpiTransactionContext.OperationType.UPDATE_RESOURCE; break; case MANUALLY_TRIGGERED: empiOperation = EmpiTransactionContext.OperationType.SUBMIT_RESOURCE_TO_EMPI; break; case DELETE: default: ourLog.trace("Not creating an EmpiTransactionContext for {}", theMsg.getOperationType()); throw new InvalidRequestException("We can't handle non-update/create operations in EMPI"); } return new EmpiTransactionContext(transactionLogMessages, empiOperation); }
Source:
private String getBuildKey(final AbstractBuild<?, ?> build, BuildListener listener) { String overriddenKey = (projectKey != null && projectKey.trim().length() > 0) ? projectKey : getDescriptor().getProjectKey(); if (overriddenKey != null && overriddenKey.trim().length() > 0) { PrintStream logger = listener.getLogger(); try { EnvVars environment = build.getEnvironment(listener); return StringEscapeUtils.escapeJavaScript(environment.expand(projectKey)); } catch (IOException e) { logger.println("Unable to expand commit SHA value"); e.printStackTrace(logger); return null; } catch (InterruptedException e) { logger.println("Unable to expand commit SHA value"); e.printStackTrace(logger); return null; } } StringBuilder key = new StringBuilder(); if (prependParentProjectKey || getDescriptor().isPrependParentProjectKey()){ if (null != build.getParent().getParent()) { key.append(build.getParent().getParent().getFullName()).append('-'); } } key.append(build.getProject().getName()); if (includeBuildNumberInKey || getDescriptor().isIncludeBuildNumberInKey()) { key.append('-').append(build.getNumber()); } key.append('-').append(Jenkins.getInstance().getRootUrl()); return StringEscapeUtils.escapeJavaScript(key.toString()); }

Target:
private String getBuildKey(final AbstractBuild<?, ?> build, BuildListener listener) { StringBuilder key = new StringBuilder(); if (prependParentProjectKey || getDescriptor().isPrependParentProjectKey()){ if (null != build.getParent().getParent()) { key.append(build.getParent().getParent().getFullName()).append('-'); } } String overriddenKey = (projectKey != null && projectKey.trim().length() > 0) ? projectKey : getDescriptor().getProjectKey(); if (overriddenKey != null && overriddenKey.trim().length() > 0) { PrintStream logger = listener.getLogger(); try { EnvVars environment = build.getEnvironment(listener); key.append(environment.expand(projectKey)); } catch (IOException e) { logger.println("Cannot expand build key from parameter. Processing with default build key"); e.printStackTrace(logger); key.append(getDefaultBuildKey(build)); } catch (InterruptedException e) { logger.println("Cannot expand build key from parameter. Processing with default build key"); e.printStackTrace(logger); key.append(getDefaultBuildKey(build)); } } else { key.append(getDefaultBuildKey(build)); } return StringEscapeUtils.escapeJavaScript(key.toString()); }
Source:
protected void addStoragePermissionByQuotaMode(List<PermissionSubject> permsList, Guid storagePoolId, Guid StorageDomainId) { storage_pool storagePool = null; if (storagePoolId != null) { storagePool = getStoragePoolDAO().get(storagePoolId); if (storagePool != null) { if (storagePool.getQuotaEnforcementType() == QuotaEnforcementTypeEnum.DISABLED) { permsList.add(new PermissionSubject(StorageDomainId, VdcObjectType.Storage, ActionGroup.CREATE_DISK)); } } } if (storagePool == null) { permsList.add(new PermissionSubject(null, VdcObjectType.Storage, ActionGroup.CREATE_DISK)); } }

Target:
protected void addStoragePermissionByQuotaMode(List<PermissionSubject> permsList, Guid storagePoolId, Guid StorageDomainId) { storage_pool storagePool = null; if (storagePoolId != null) { storagePool = getStoragePoolDAO().get(storagePoolId); if (storagePool != null) { if (storagePool.getQuotaEnforcementType() == QuotaEnforcementTypeEnum.DISABLED) { permsList.add(new PermissionSubject(StorageDomainId, VdcObjectType.Storage, ActionGroup.CREATE_DISK)); } } } }
Source:
private void waitForDeploy(StreamDefinition definition) { StreamNode stream = parser.parse(definition.getDefinition()); boolean deployed = false; streamDeployer.deploy(definition.getName()); final int MAX_TRIES = 10; int tries = 1; while (!deployed && tries <= MAX_TRIES) { deployed = true; int i = 0; for (ModuleNode module : stream.getModuleNodes()) { if (getModule(module.getName(), i++, moduleDeployer) == null) { deployed = false; break; } } if (!deployed) { try { Thread.sleep(1000); streamDeployer.undeploy(definition.getName()); Thread.sleep(1000); streamDeployer.deploy(definition.getName()); tries++; } catch (InterruptedException e) { e.printStackTrace(); } } } if (deployed) { System.out.println("deployed after " + tries + " tries"); } assertTrue("stream " + definition.getName() + " not deployed ", deployed); }

Target:
private void waitForDeploy(StreamDefinition definition) { StreamNode stream = parser.parse(definition.getDefinition()); boolean deployed = false; streamDeployer.deploy(definition.getName()); final int MAX_TRIES = 10; int tries = 1; while (!deployed && tries <= MAX_TRIES) { deployed = true; int i = 0; for (ModuleNode module : stream.getModuleNodes()) { if (getModule(module.getName(), i++, moduleDeployer) == null) { deployed = false; break; } } if (!deployed) { try { Thread.sleep(1000); streamDeployer.undeploy(definition.getName()); Thread.sleep(1000); streamDeployer.deploy(definition.getName()); tries++; } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } if (deployed) { System.out.println("deployed after " + tries + " tries"); } assertTrue("stream " + definition.getName() + " not deployed ", deployed); }
Source:
private <T, U extends CopyStrategy<?>> void registerCopyStrategy(CopyStrategyLibrary copyStrategyLibrary, Class<T> type, Class<U> strategy) { try { copyStrategyLibrary.register(type, (CopyStrategy<T>) strategy.newInstance()); } catch (InstantiationException | IllegalAccessException e) { logger.error("Cannot register CopyStrategy '{}' - failed to instantiate", strategy, e); } }

Target:
private <T, U extends CopyStrategy<T>> void registerCopyStrategy(CopyStrategyLibrary copyStrategyLibrary, Class<T> type, Class<U> strategy) { try { copyStrategyLibrary.register(type, strategy.newInstance()); } catch (InstantiationException | IllegalAccessException e) { logger.error("Cannot register CopyStrategy '{}' - failed to instantiate", strategy, e); } }
Source:
protected void doFilterHttp(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (!systemEnvironment.isReAuthenticationEnabled()) { chain.doFilter(request, response); return; } synchronized (request.getSession().getId().intern()) { Long lastAuthenticationTime = (Long) request.getSession().getAttribute(LAST_REAUTHENICATION_CHECK_TIME); if (lastAuthenticationTime == null) { request.getSession().setAttribute(LAST_REAUTHENICATION_CHECK_TIME, timeProvider.currentTimeMillis()); } else if (forceReAuthentication(lastAuthenticationTime)) { request.getSession().setAttribute(LAST_REAUTHENICATION_CHECK_TIME, timeProvider.currentTimeMillis()); authentication.setAuthenticated(false); } } chain.doFilter(request, response); }

Target:
protected void doFilterHttp(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (!systemEnvironment.isReAuthenticationEnabled() || authentication == null) { chain.doFilter(request, response); return; } synchronized (request.getSession().getId().intern()) { Long lastAuthenticationTime = (Long) request.getSession().getAttribute(LAST_REAUTHENICATION_CHECK_TIME); if (lastAuthenticationTime == null) { request.getSession().setAttribute(LAST_REAUTHENICATION_CHECK_TIME, timeProvider.currentTimeMillis()); } else if (forceReAuthentication(lastAuthenticationTime)) { request.getSession().setAttribute(LAST_REAUTHENICATION_CHECK_TIME, timeProvider.currentTimeMillis()); authentication.setAuthenticated(false); } } chain.doFilter(request, response); }
Source:
public void clearFolder(final Account account, final String folderName, final ActivityListener listener) { putBackground("clearFolder", listener, new Runnable() { @Override public void run() { LocalFolder localFolder = null; try { Store localStore = account.getLocalStore(); localFolder = (LocalFolder) localStore.getFolder(account.getTrashFolderName()); localFolder.open(Folder.OPEN_MODE_RW); localFolder = account.getLocalStore().getFolder(folderName); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (UnavailableStorageException e) { Log.i(K9.LOG_TAG, "Failed to clear folder because storage is not available - trying again later."); throw new UnavailableAccountException(e); } catch (Exception e) { Log.e(K9.LOG_TAG, "clearFolder failed", e); addErrorMessage(account, null, e); } finally { closeFolder(localFolder); } listFoldersSynchronous(account, false, listener); } }); }

Target:
public void clearFolder(final Account account, final String folderName, final ActivityListener listener) { putBackground("clearFolder", listener, new Runnable() { @Override public void run() { clearFolderSynchronous(account, folderName, listener); } }); }
Source:
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.setProperty(Constants.PROPERTY_MAX_RETRIES, "15"); properties.setProperty("jclouds.ssh.retry-auth", "true"); properties.setProperty(Constants.PROPERTY_CONNECTION_TIMEOUT, "1200000"); properties.setProperty("image.login-user", "root"); properties.setProperty(ComputeServiceProperties.IMAGE_LOGIN_USER, "root:password"); properties.setProperty(TEMPLATE, "osFamily=UBUNTU,os64Bit=true,osVersionMatches=1[012].[01][04]"); return properties; }

Target:
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.setProperty(Constants.PROPERTY_MAX_RETRIES, "15"); properties.setProperty("jclouds.ssh.retry-auth", "true"); properties.setProperty(Constants.PROPERTY_CONNECTION_TIMEOUT, "1200000"); properties.setProperty(ComputeServiceProperties.IMAGE_LOGIN_USER, "root:password"); properties.setProperty(TEMPLATE, "osFamily=UBUNTU,os64Bit=true,osVersionMatches=1[012].[01][04]"); return properties; }
Source:
public static void httpsValidation(Object objectToCheck, String objectName, String endpoint, ClientLogger logger) { if (objectToCheck != null && !parseEndpoint(endpoint, logger).getScheme().equals(Constants.HTTPS)) { throw new IllegalArgumentException("Using a(n) " + objectName + " requires https"); } }

Target:
public static void httpsValidation(Object objectToCheck, String objectName, String endpoint, ClientLogger logger) { if (objectToCheck != null && !parseEndpoint(endpoint, logger).getScheme().equals(Constants.HTTPS)) { throw logger.logExceptionAsError(new IllegalArgumentException( "Using a(n) " + objectName + " requires https")); } }
Source:
char[] executePasswordCommand(String passwordCommand) throws Throwable { final SecurityManager sm = System.getSecurityManager(); CmdRuntimeActions action; if (sm != null) { sm.checkPermission(CredentialStorePermission.LOAD_EXTERNAL_STORE_PASSWORD); action = CmdRuntimeActions.PRIVILEGED; } else { action = CmdRuntimeActions.NON_PRIVILEGED; } String passwordCmdType; String passwordCmdLine; if (passwordCommand.trim().startsWith("{" + SUPPORTED_CMD_TYPE)) { StringTokenizer tokenizer = new StringTokenizer(passwordCommand, "{}"); passwordCmdType = tokenizer.nextToken(); passwordCmdLine = tokenizer.nextToken(); } else { passwordCmdType = SUPPORTED_CMD_TYPE; passwordCmdLine = passwordCommand; } if (!passwordCmdType.equals(SUPPORTED_CMD_TYPE)) { throw log.cacheForExternalCommandsNotSupported(); } try { return action.execCmd(passwordCmdLine); } catch (Exception e) { throw log.passwordCommandExecutionProblem( getName(), e); } }

Target:
char[] executePasswordCommand(String passwordCommand) throws Throwable { String passwordCmdType; String passwordCmdLine; if (passwordCommand.trim().startsWith("{" + SUPPORTED_CMD_TYPE)) { StringTokenizer tokenizer = new StringTokenizer(passwordCommand, "{}"); passwordCmdType = tokenizer.nextToken(); passwordCmdLine = tokenizer.nextToken(); } else { passwordCmdType = SUPPORTED_CMD_TYPE; passwordCmdLine = passwordCommand; } if (!passwordCmdType.equals(SUPPORTED_CMD_TYPE)) { throw log.cacheForExternalCommandsNotSupported(); } try { return execCmd(passwordCmdLine); } catch (Exception e) { throw log.passwordCommandExecutionProblem( getName(), e); } }
Source:
public List<Variant> mapLine(String line, int lineNumber) throws Exception { Assert.notNull(factory, "It is not allowed to use " + this.getClass().getSimpleName() + " with non-aggregated VCFs (hint: do not set VariantSource.Aggregation to NONE"); return factory.create(source, line); }

Target:
public List<Variant> mapLine(String line, int lineNumber) throws Exception { assertNotNull(this.getClass().getSimpleName() + " should be used to read aggregated VCFs only " + "(hint: do not set VariantSource.Aggregation to NONE)", factory); return factory.create(source, line); }
Source:
public static String toString(short ordinal) { return "UNKNOWN[ordinal=" + ordinal + ']'; }

Target:
public static String toString(short ordinal) { return "VersionOrdinal[ordinal=" + ordinal + ']'; }
Source:
public static <T> FromIndexFieldValueConverter<T, ValueWrapper<T>> fromIndexFieldConverter() { return new ValueWrapperFromIndexFieldValueConverter<>(); }

Target:
public static <T> FromIndexFieldValueConverter<T, ValueWrapper<T>> fromIndexFieldConverter() { return new FromIndexFieldValueConverter<T, ValueWrapper<T>>() { @Override public boolean isConvertedTypeAssignableTo(Class<?> superTypeCandidate) { return superTypeCandidate.isAssignableFrom( ValueWrapper.class ); } @Override public ValueWrapper<T> convert(T indexedValue) { return new ValueWrapper<T>( indexedValue ); } }; }
Source:
private String getTagsString() { StringBuilder sb = new StringBuilder(); Map<String, Ref> tagsMap = db.getTags(); for (String tagName : tagsMap.keySet()) { ObjectId peeledId = tagsMap.get(tagName).getPeeledObjectId(); if (peeledId != null && peeledId.equals(commit)) { if (sb.length() > 0) { sb.append(", "); } sb.append(tagName); } } return sb.toString(); }

Target:
private String getTagsString() { StringBuilder sb = new StringBuilder(); Map<String, Ref> tagsMap = db.getTags(); for (String tagName : tagsMap.keySet()) { ObjectId peeledId = tagsMap.get(tagName).getPeeledObjectId(); if (peeledId != null && peeledId.equals(commit)) { if (sb.length() > 0) sb.append(", "); sb.append(tagName); } } return sb.toString(); }
Source:
public void setCallback(Callback callback) { this.mCallback = callback; }

Target:
public void setCallback(Callback callback) { mCallback = callback; }
Source:
private Condition generateFHIRConditionForOpenMRSObs(Obs openMrsObs) { ca.uhn.fhir.model.dstu2.resource.Condition fhirCondition = new ca.uhn.fhir.model.dstu2.resource.Condition(); IdDt id = new IdDt(); id.setValue(openMrsObs.getUuid()); fhirCondition.setId(id); if (openMrsObs.getPerson().isPatient()) { ResourceReferenceDt patient = FHIRUtils.buildPatientOrPersonResourceReference(openMrsObs.getPerson()); fhirCondition.setPatient(patient); } DateDt dateDt = new DateDt(); dateDt.setValue(openMrsObs.getDateCreated()); fhirCondition.setDateAsserted(dateDt); if (openMrsObs.getConcept() != null) { CodeableConceptDt conceptDt = fhirCondition.getCode(); Collection<ConceptMap> mappings = openMrsObs.getConcept().getConceptMappings(); List<CodingDt> dts = conceptDt.getCoding(); if (mappings != null && !mappings.isEmpty()) { for (ConceptMap map : mappings) { if (map.getConceptReferenceTerm() != null) { dts.add(FHIRUtils.getCodingDtByConceptMappings(map)); } } } if (openMrsObs.getConcept().getName() != null) { dts.add(new CodingDt().setCode(openMrsObs.getConcept().getUuid()).setDisplay( openMrsObs.getConcept().getName().getName()).setSystem(FHIRConstants.OPENMRS_URI)); } else { dts.add(new CodingDt().setCode(openMrsObs.getConcept().getUuid()).setSystem( FHIRConstants.OPENMRS_URI)); } conceptDt.setCoding(dts); fhirCondition.setCode(conceptDt); } fhirCondition.setNotes(openMrsObs.getComment()); return fhirCondition; }

Target:
private Condition generateFHIRConditionForOpenMRSObs(Obs openMrsObs) { ca.uhn.fhir.model.dstu2.resource.Condition fhirCondition = new ca.uhn.fhir.model.dstu2.resource.Condition(); IdDt id = new IdDt(); id.setValue(openMrsObs.getUuid()); fhirCondition.setId(id); if (openMrsObs.getPerson().isPatient()) { ResourceReferenceDt patient = FHIRUtils.buildPatientOrPersonResourceReference(openMrsObs.getPerson()); fhirCondition.setPatient(patient); if (openMrsObs.getEncounter() != null) { fhirCondition.setEncounter(buildPatientReference(openMrsObs.getEncounter())); } } DateDt dateDt = new DateDt(); dateDt.setValue(openMrsObs.getDateCreated()); fhirCondition.setDateAsserted(dateDt); if (openMrsObs.getConcept() != null) { CodeableConceptDt conceptDt = fhirCondition.getCode(); Collection<ConceptMap> mappings = openMrsObs.getConcept().getConceptMappings(); List<CodingDt> dts = conceptDt.getCoding(); if (mappings != null && !mappings.isEmpty()) { for (ConceptMap map : mappings) { if (map.getConceptReferenceTerm() != null) { dts.add(FHIRUtils.getCodingDtByConceptMappings(map)); } } } if (openMrsObs.getConcept().getName() != null) { dts.add(new CodingDt().setCode(openMrsObs.getConcept().getUuid()).setDisplay( openMrsObs.getConcept().getName().getName()).setSystem(FHIRConstants.OPENMRS_URI)); } else { dts.add(new CodingDt().setCode(openMrsObs.getConcept().getUuid()).setSystem( FHIRConstants.OPENMRS_URI)); } conceptDt.setCoding(dts); fhirCondition.setCode(conceptDt); } fhirCondition.setNotes(openMrsObs.getComment()); return fhirCondition; }
Source:
public boolean equals(Object obj) { if (!(obj instanceof CorfuDynamicMessage)) { return false; } CorfuDynamicMessage other = (CorfuDynamicMessage) obj; if (payload == null && other.payload == null) return true; if (payload == null || other.payload == null) return false; if (payload.getAllFields().size() != other.payload.getAllFields().size()) { return false; } Iterator<Map.Entry<FieldDescriptor, Object>> thisMessage = payload.getAllFields().entrySet() .stream() .sorted() .collect(Collectors.toList()) .iterator(); Iterator<Map.Entry<FieldDescriptor, Object>> otherMessage = payload.getAllFields().entrySet() .stream() .sorted() .collect(Collectors.toList()) .iterator(); while (thisMessage.hasNext()) { if (!otherMessage.hasNext()) { return false; } Map.Entry<FieldDescriptor, Object> entry1 = thisMessage.next(); Map.Entry<FieldDescriptor, Object> entry2 = otherMessage.next(); if (!entry1.getKey().toProto().equals(entry2.getKey().toProto()) || !entry1.getValue().equals(entry2.getValue())) { return false; } } return true; }

Target:
public boolean equals(Object obj) { if (!(obj instanceof CorfuDynamicMessage)) { return false; } CorfuDynamicMessage other = (CorfuDynamicMessage) obj; if (payload == null && other.payload == null) return true; if (payload == null || other.payload == null) return false; if (payload.getAllFields().size() != other.payload.getAllFields().size()) { return false; } Iterator<Map.Entry<FieldDescriptor, Object>> thisMessage = new ArrayList<>(payload.getAllFields().entrySet()) .iterator(); Iterator<Map.Entry<FieldDescriptor, Object>> otherMessage = new ArrayList<>(payload.getAllFields().entrySet()) .iterator(); while (thisMessage.hasNext()) { if (!otherMessage.hasNext()) { return false; } Map.Entry<FieldDescriptor, Object> entry1 = thisMessage.next(); Map.Entry<FieldDescriptor, Object> entry2 = otherMessage.next(); if (!entry1.getKey().toProto().equals(entry2.getKey().toProto()) || !entry1.getValue().equals(entry2.getValue())) { return false; } } return true; }
Source:
public synchronized Integer getResourceId(ResName resName) { Integer id = resourceTable.inverse().get(resName); if (id == null && ("android".equals(resName.packageName) || "".equals(resName.packageName))) { if (maxUsedInt == null) { maxUsedInt = resourceTable.isEmpty() ? 0 : Collections.max(resourceTable.keySet()); generatedIdStart = maxUsedInt; } id = ++maxUsedInt; resourceTable.put(id, resName); LOGGER.fine("no id mapping found for " + resName.getFullyQualifiedName() + "; assigning ID #0x" + Integer.toHexString(id)); } if (id == null) return 0; return id; }

Target:
public synchronized Integer getResourceId(ResName resName) { Integer id = resourceTable.inverse().get(resName); if (id == null && isAndroidPackage(resName)) { id = androidResourceIdGenerator.generate(resName.type, resName.name); resourceTable.put(id, resName); LOGGER.fine("no id mapping found for " + resName.getFullyQualifiedName() + "; assigning ID #0x" + Integer.toHexString(id)); } if (id == null) return 0; return id; }
Source:
public byte[] getMetadataForTable(TableReference tableRef) { String lowerCaseTableName = tableRef.getQualifiedName().toLowerCase(); Map<Cell, Value> rows = getRows(AtlasDbConstants.DEFAULT_METADATA_TABLE, ImmutableSet.of(lowerCaseTableName.getBytes()), ColumnSelection.all(), Long.MAX_VALUE); if (!rows.isEmpty()) { return Iterables.getOnlyElement(rows.values()).getContents(); } java.util.Optional<Entry<TableReference, byte[]>> match = getMetadataForTables().entrySet().stream().filter( entry -> matchingIgnoreCase(entry.getKey(), tableRef)) .findFirst(); if (!match.isPresent()) { log.debug("Couldn't find table metadata for {}", LoggingArgs.tableRef(tableRef)); return AtlasDbConstants.EMPTY_TABLE_METADATA; } else { log.debug("Found table metadata for at matching name {}", LoggingArgs.tableRef(tableRef), LoggingArgs.tableRef("matchingTable", match.get().getKey())); putMetadataAndMaybeAlterTables( false, ImmutableMap.of(CassandraKeyValueServices.getMetadataCell(tableRef), match.get().getValue()), ImmutableSet.of()); return match.get().getValue(); } }

Target:
public byte[] getMetadataForTable(TableReference tableRef) { String lowerCaseTableName = tableRef.getQualifiedName().toLowerCase(); Map<Cell, Value> rows = getRows(AtlasDbConstants.DEFAULT_METADATA_TABLE, ImmutableSet.of(lowerCaseTableName.getBytes()), ColumnSelection.all(), Long.MAX_VALUE); if (!rows.isEmpty()) { return Iterables.getOnlyElement(rows.values()).getContents(); } java.util.Optional<Entry<TableReference, byte[]>> match = getMetadataForTables().entrySet().stream().filter( entry -> matchingIgnoreCase(entry.getKey(), tableRef)) .findFirst(); if (!match.isPresent()) { log.debug("Couldn't find table metadata for {}", LoggingArgs.tableRef(tableRef)); return AtlasDbConstants.EMPTY_TABLE_METADATA; } else { log.debug("Found table metadata for at matching name {}", LoggingArgs.tableRef(tableRef), LoggingArgs.tableRef("matchingTable", match.get().getKey())); return match.get().getValue(); } }
Source:
public Mono<VoidResponse> deleteFile(String fileName) { String filePath = directoryName + "/" + fileName; FileAsyncClient fileAsyncClient = new FileAsyncClient(azureFileStorageClient, shareName, filePath, snapshot); return fileAsyncClient.delete().map(VoidResponse::new); }

Target:
public Mono<VoidResponse> deleteFile(String fileName) { FileAsyncClient fileAsyncClient = getFileClient(fileName); return fileAsyncClient.delete().map(VoidResponse::new); }
Source:
public AbstractOpenPgpIntegrationTest(SmackIntegrationTestEnvironment environment) throws XMPPException.XMPPErrorException, TestNotPossibleException, SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException { super(environment); throwIfPubSubNotSupported(conOne); throwIfPubSubNotSupported(conTwo); throwIfPubSubNotSupported(conThree); Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME); Security.addProvider(new BouncyCastleProvider()); this.aliceConnection = conOne; this.bobConnection = conTwo; this.chloeConnection = conThree; this.alice = aliceConnection.getUser().asBareJid(); this.bob = bobConnection.getUser().asBareJid(); this.chloe = chloeConnection.getUser().asBareJid(); OpenPgpPubSubUtil.deletePubkeysListNode(aliceConnection); OpenPgpPubSubUtil.deletePubkeysListNode(bobConnection); OpenPgpPubSubUtil.deletePubkeysListNode(chloeConnection); }

Target:
protected AbstractOpenPgpIntegrationTest(SmackIntegrationTestEnvironment environment) throws XMPPException.XMPPErrorException, TestNotPossibleException, SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException { super(environment); throwIfPubSubNotSupported(conOne); throwIfPubSubNotSupported(conTwo); throwIfPubSubNotSupported(conThree); this.aliceConnection = conOne; this.bobConnection = conTwo; this.chloeConnection = conThree; this.alice = aliceConnection.getUser().asBareJid(); this.bob = bobConnection.getUser().asBareJid(); this.chloe = chloeConnection.getUser().asBareJid(); OpenPgpPubSubUtil.deletePubkeysListNode(aliceConnection); OpenPgpPubSubUtil.deletePubkeysListNode(bobConnection); OpenPgpPubSubUtil.deletePubkeysListNode(chloeConnection); }
Source:
ArrayResult aggregateData() { int rows = ((ArrayResult) this.getAllResultData().get(this.getAllResultData().keys().nextElement())).data.length; int columns = 0; for (Enumeration<Integer> e = this.getAllResultData().keys(); e.hasMoreElements();) { columns += ((ArrayResult) this.getAllResultData().get(e.nextElement())).data[0].length; } int[][] resultData = new int[rows][columns]; int columnsDone = 0; for (int i = 0; i < this.getExpectedNumResults(); i++) { int[][] work = ((ArrayResult) this.getAllResultData().get(this.getWorkers().get(i).getWorkerId())).data; for (int m = 0; m < work.length; m++) { for (int n = 0; n < work[0].length; n++) { resultData[m][columnsDone + n] = work[m][n]; } } columnsDone += work[0].length; } ArrayResult result = new ArrayResult(resultData); return result; }

Target:
ArrayResult aggregateData() { int rows = ((ArrayResult) this.getAllResultData().get(this.getAllResultData().keys().nextElement())).data.length; int columns = 0; for (Enumeration<Integer> e = this.getAllResultData().keys(); e.hasMoreElements();) { columns += ((ArrayResult) this.getAllResultData().get(e.nextElement())).data[0].length; } int[][] resultData = new int[rows][columns]; int columnsDone = 0; for (int i = 0; i < this.getExpectedNumResults(); i++) { int[][] work = ((ArrayResult) this.getAllResultData().get(this.getWorkers().get(i).getWorkerId())).data; for (int m = 0; m < work.length; m++) { for (int n = 0; n < work[0].length; n++) { resultData[m][columnsDone + n] = work[m][n]; } } columnsDone += work[0].length; } return new ArrayResult(resultData); }
Source:
public void testRemoveAll() { List<Guid> hookIds = new ArrayList<Guid>(); hookIds.add(HOOK_ID); hookIds.add(HOOK_ID2); dao.removeAll(hookIds); List<GlusterHookEntity> hooks = dao.getByClusterId(CLUSTER_ID); assertNotNull(hooks); }

Target:
public void testRemoveAll() { List<Guid> hookIds = new ArrayList<Guid>(); hookIds.add(HOOK_ID); hookIds.add(HOOK_ID2); dao.removeAll(hookIds); List<GlusterHookEntity> hooks = dao.getByClusterId(CLUSTER_ID); assertNotNull(hooks); assertTrue(hooks.isEmpty()); }
Source:
public final Observable<T> observeOn(Scheduler scheduler, int bufferSize) { if (this instanceof ScalarSynchronousObservable) { return ((ScalarSynchronousObservable<T>)this).scalarScheduleOn(scheduler); } return lift(new OperatorObserveOn<T>(scheduler, false, bufferSize)); }

Target:
public final Observable<T> observeOn(Scheduler scheduler, int bufferSize) { return observeOn(scheduler, false, bufferSize); }
Source:
public void testUpdatingDefaultVersionHostedTool() { ApiClient webClient = getWebClient(); ContainersApi containersApi = new ContainersApi(webClient); HostedApi hostedApi = new HostedApi(webClient); DockstoreTool hostedTool = hostedApi.createHostedTool("awesomeTool", "cwl", "quay.io", "coolNamespace"); SourceFile descriptorFile = new SourceFile(); descriptorFile.setContent("cwlVersion: v1.0\\nclass: CommandLineTool\\nbaseCommand: echo\\ninputs:\\nmessage:\\ntype: string\\ninputBinding:\\nposition: 1\\noutputs: []"); descriptorFile.setType(SourceFile.TypeEnum.DOCKSTORE_CWL); descriptorFile.setPath("/Dockstore.cwl"); SourceFile dockerfile = new SourceFile(); dockerfile.setContent("FROM ubuntu:latest"); dockerfile.setType(SourceFile.TypeEnum.DOCKERFILE); dockerfile.setPath("/Dockerfile"); DockstoreTool dockstoreTool = hostedApi.editHostedTool(hostedTool.getId(), Lists.newArrayList(descriptorFile, dockerfile)); Optional<Tag> first = dockstoreTool.getTags().stream().max(Comparator.comparingInt((Tag t) -> Integer.parseInt(t.getName()))); Assert.assertEquals("correct number of source files", 2, first.get().getSourceFiles().size()); if (first.isPresent()) { containersApi.updateDefaultVersion(hostedTool.getId(), first.get().getName()); } }

Target:
public void testUpdatingDefaultVersionHostedTool() { ApiClient webClient = getWebClient(); ContainersApi containersApi = new ContainersApi(webClient); HostedApi hostedApi = new HostedApi(webClient); DockstoreTool hostedTool = hostedApi.createHostedTool("awesomeTool", "cwl", "quay.io", "coolNamespace"); SourceFile descriptorFile = new SourceFile(); descriptorFile.setContent("cwlVersion: v1.0\\nclass: CommandLineTool\\nbaseCommand: echo\\ninputs:\\nmessage:\\ntype: string\\ninputBinding:\\nposition: 1\\noutputs: []"); descriptorFile.setType(SourceFile.TypeEnum.DOCKSTORE_CWL); descriptorFile.setPath("/Dockstore.cwl"); SourceFile dockerfile = new SourceFile(); dockerfile.setContent("FROM ubuntu:latest"); dockerfile.setType(SourceFile.TypeEnum.DOCKERFILE); dockerfile.setPath("/Dockerfile"); DockstoreTool dockstoreTool = hostedApi.editHostedTool(hostedTool.getId(), Lists.newArrayList(descriptorFile, dockerfile)); Optional<Tag> first = dockstoreTool.getTags().stream().max(Comparator.comparingInt((Tag t) -> Integer.parseInt(t.getName()))); Assert.assertEquals("correct number of source files", 2, first.get().getSourceFiles().size()); assertTrue(first.isPresent()); containersApi.updateToolDefaultVersion(hostedTool.getId(), first.get().getName()); }