auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static FilterExpression replaceMilestoneAliases(IModel model, FilterExpression expr) { List<String> repoIds = getMetaQualifierContent(expr, QualifierType.REPO).stream() .map(String::toLowerCase) .collect(Collectors.toList()); if (repoIds.isEmpty()) { repoIds.add(model.getDefaultRepo().toLowerCase()); } List<TurboMilestone> allMilestones = model.getMilestones().stream() .filter(ms -> ms.getDueDate().isPresent()) .filter(ms -> repoIds.contains(ms.getRepoId().toLowerCase())) .sorted((a, b) -> getMilestoneDueDateComparator().compare(a, b)) .collect(Collectors.toList()); model.getMilestones().stream().filter(ms ->ms.isOpen()).count(); Optional<Integer> currentMilestoneIndex = getCurrentMilestoneIndex(allMilestones); if (!currentMilestoneIndex.isPresent()) { return expr; } return expr.map(q -> { if (Qualifier.isMilestoneQualifier(q)) { return q.convertMilestoneAliasQualifier(allMilestones, currentMilestoneIndex.get()); } else { return q; } }); }

Target:
public static FilterExpression replaceMilestoneAliases(IModel model, FilterExpression expr) { List<String> repoIds = getMetaQualifierContent(expr, QualifierType.REPO).stream() .map(String::toLowerCase) .collect(Collectors.toList()); if (repoIds.isEmpty()) { repoIds.add(model.getDefaultRepo().toLowerCase()); } List<TurboMilestone> milestonesOfReposInPanel = TurboMilestone.filterMilestonesOfRepos( model.getMilestones(), repoIds); List<TurboMilestone> aliasableMilestones = getAliasableMilestones(milestonesOfReposInPanel); Map<Integer, TurboMilestone> milestoneAliasIndex = getMilestoneAliasIndex(aliasableMilestones); if (milestoneAliasIndex.isEmpty()) { return expr; } return expr.map(q -> { if (Qualifier.isMilestoneQualifier(q)) { return q.convertMilestoneAliasQualifier(milestoneAliasIndex); } else { return q; } }); }
Source:
public void test() { WebDriver driver = connect(); JQuery menu = jq(".z-menu"); Point menuLocation = toElement(menu).getLocation(); click(menu); waitResponse(); Assert.assertTrue(menuLocation.getY() < getMenupopupLocation().getY()); click(jq(".z-button")); waitResponse(); click(menu); waitResponse(); Assert.assertTrue(menuLocation.getX() < getMenupopupLocation().getX()); click(jq("body")); waitResponse(); WebDriver.Window window = driver.manage().window(); window.setSize(new Dimension(500, window.getSize().getHeight())); waitResponse(); click(menu); waitResponse(); Assert.assertTrue(menuLocation.getX() > getMenupopupLocation().getX()); }

Target:
public void test() { WebDriver driver = connect(); JQuery menu = jq(".z-menu"); Point menuLocation = toElement(menu).getLocation(); click(menu); waitResponse(); Assert.assertTrue(menuLocation.getY() < getMenupopupLocation().getY()); click(jq(".z-button")); waitResponse(); click(menu); waitResponse(); Assert.assertTrue(menuLocation.getX() < getMenupopupLocation().getX()); click(jq("body")); waitResponse(); WebDriver.Window window = driver.manage().window(); window.setSize(new Dimension(400, window.getSize().getHeight())); waitResponse(); click(menu); waitResponse(); Assert.assertTrue(menuLocation.getX() > getMenupopupLocation().getX()); }
Source:
private static Server getServerFromMap(Map<String, String[]> parameters) { boolean jenkinsAltUrl = parameters.get("jenkinsAltUrl") != null && "on".equals(parameters.get("jenkinsAltUrl")[0]) ? true : false; boolean jenkinsCSRF = false; try { jenkinsCSRF = parameters.get("jenkinsCSRF") != null && "on".equals(parameters.get("jenkinsCSRF")[0]) ? true : false; } catch (Exception e) { } return new Server(parameters.get("jenkinsUrl")[0], parameters.get("jenkinsUser")[0], parameters.get("jenkinsToken")[0], jenkinsAltUrl, jenkinsCSRF ); }

Target:
private static Server getServerFromMap(Map<String, String[]> parameters) { boolean jenkinsAltUrl = parameters.get("jenkinsAltUrl") != null && "on".equals(parameters.get("jenkinsAltUrl")[0]) ? true : false; boolean jenkinsCSRF = parameters.get("jenkinsCSRF") != null && "on".equals(parameters.get("jenkinsCSRF")[0]) ? true : false; return new Server(parameters.get("jenkinsUrl")[0], parameters.get("jenkinsUser")[0], parameters.get("jenkinsToken")[0], jenkinsAltUrl, jenkinsCSRF ); }
Source:
protected void whenFailToAuthenticateThrowExceptionOrRedirectToUrl(final Map<String, Object[]> params, final String responseType, final HttpServletResponse resp, Issuer issuer, UserAccount userAccount) throws IOException { if (userAccount == null || userAccount.getExternalEntity() == null || !_samlAuthManager.isUserAuthorized(userAccount.getId(), issuer.getValue())) { String saml2FailedLoginRedirectUrl = (String)getConfigKeys()[0].value(); if (StringUtils.isBlank(saml2FailedLoginRedirectUrl)) { throw new ServerApiException(ApiErrorCode.ACCOUNT_ERROR, _apiServer.getSerializedApiError(ApiErrorCode.ACCOUNT_ERROR.getHttpCode(), "Your authenticated user is not authorized for SAML Single Sign-On, please contact your administrator", params, responseType)); } else { resp.sendRedirect(saml2FailedLoginRedirectUrl); } } }

Target:
protected void whenFailToAuthenticateThrowExceptionOrRedirectToUrl(final Map<String, Object[]> params, final String responseType, final HttpServletResponse resp, Issuer issuer, UserAccount userAccount) throws IOException { if (userAccount == null || userAccount.getExternalEntity() == null || !samlAuthManager.isUserAuthorized(userAccount.getId(), issuer.getValue())) { String saml2RedirectUrl = saml2FailedLoginRedirectUrl.value(); if (StringUtils.isBlank(saml2RedirectUrl)) { throw new ServerApiException(ApiErrorCode.ACCOUNT_ERROR, apiServer.getSerializedApiError(ApiErrorCode.ACCOUNT_ERROR.getHttpCode(), "Your authenticated user is not authorized for SAML Single Sign-On, please contact your administrator", params, responseType)); } else { resp.sendRedirect(saml2RedirectUrl); } } }
Source:
private void updateExistingVm(UserPortalListModel userPortalListModel, final boolean applyCpuChangesLater) { final UnitVmModel model = (UnitVmModel) getWindow(); UserPortalItemModel selectedItem = (UserPortalItemModel) userPortalListModel.getSelectedItem(); Guid oldClusterID = ((VM) selectedItem.getEntity()).getVdsGroupId(); Guid newClusterID = model.getSelectedCluster().getId(); if (oldClusterID.equals(newClusterID) == false) { Frontend.getInstance().runAction(VdcActionType.ChangeVMCluster, new ChangeVMClusterParameters(newClusterID, gettempVm().getId()), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { VdcReturnValueBase returnValueBase = result.getReturnValue(); final UserPortalListModel userPortalListModel = (UserPortalListModel) result.getState(); if (returnValueBase != null && returnValueBase.getSucceeded()) { VmManagementParametersBase param = getUpdateVmParameters(applyCpuChangesLater); Frontend.getInstance() .runAction(VdcActionType.UpdateVm, param, new UnitVmModelNetworkAsyncCallback(model, defaultNetworkCreatingManager, gettempVm().getId()), this); } else { userPortalListModel.getWindow().stopProgress(); } } }, this); } else { VmManagementParametersBase param = getUpdateVmParameters(applyCpuChangesLater); Frontend.getInstance().runAction(VdcActionType.UpdateVm, param, new UnitVmModelNetworkAsyncCallback(model, defaultNetworkCreatingManager, gettempVm().getId()), this); } }

Target:
private void updateExistingVm(UserPortalListModel userPortalListModel, final boolean applyCpuChangesLater) { final UnitVmModel model = (UnitVmModel) getWindow(); UserPortalItemModel selectedItem = (UserPortalItemModel) userPortalListModel.getSelectedItem(); Guid oldClusterID = ((VM) selectedItem.getEntity()).getVdsGroupId(); Guid newClusterID = model.getSelectedCluster().getId(); if (oldClusterID.equals(newClusterID) == false) { Frontend.getInstance().runAction(VdcActionType.ChangeVMCluster, new ChangeVMClusterParameters(newClusterID, gettempVm().getId()), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { VdcReturnValueBase returnValueBase = result.getReturnValue(); if (returnValueBase != null && returnValueBase.getSucceeded()) { VmManagementParametersBase param = getUpdateVmParameters(applyCpuChangesLater); Frontend.getInstance() .runAction(VdcActionType.UpdateVm, param, new UnitVmModelNetworkAsyncCallback(model, defaultNetworkCreatingManager, gettempVm().getId()), this); } else { getWindow().stopProgress(); } } }, this); } else { VmManagementParametersBase param = getUpdateVmParameters(applyCpuChangesLater); Frontend.getInstance().runAction(VdcActionType.UpdateVm, param, new UnitVmModelNetworkAsyncCallback(model, defaultNetworkCreatingManager, gettempVm().getId()), this); } }
Source:
protected ArrayList<Theme> doInBackground(JSONObject... args) { if (args[0] == null) { return null; } final JSONArray array = args[0].optJSONArray("themes"); if (array == null) { return null; } final ArrayList<Theme> themes = new ArrayList<>(); final int count = array.length(); for (int i = 0; i < count; i++) { try { JSONObject object = array.getJSONObject(i); Theme theme = Theme.fromJSONV1_2(object, mSite.getSiteId()); if (theme != null) { WordPress.wpDB.saveTheme(theme); themes.add(theme); } } catch (JSONException e) { AppLog.e(T.THEMES, e); } } fetchCurrentTheme(); return themes.size() > 0 ? themes : null; }

Target:
protected ArrayList<Theme> doInBackground(JSONObject... args) { if (args[0] == null) { return null; } final JSONArray array = args[0].optJSONArray("themes"); if (array == null) { return null; } final ArrayList<Theme> themes = new ArrayList<>(); for (int i = 0; i < array.length(); i++) { try { JSONObject object = array.getJSONObject(i); Theme theme = Theme.fromJSONV1_2(object, mSite); if (theme != null) { ThemeTable.saveTheme(WordPress.wpDB.getDatabase(), theme); themes.add(theme); } } catch (JSONException e) { AppLog.e(T.THEMES, e); } } fetchCurrentTheme(); return themes.size() > 0 ? themes : null; }
Source:
public static void main(String[] args) throws Exception { ApplicationRunnerCommandLine cmdLine = new ApplicationRunnerCommandLine(); OptionSet options = cmdLine.parser().parse(args); Config config = cmdLine.loadConfig(options); ApplicationRunnerOperation op = cmdLine.getOperation(options); if (config.containsKey(STREAM_APPLICATION_CLASS_CONFIG)) { ApplicationRunner runner = ApplicationRunner.fromConfig(config); StreamApplication app = (StreamApplication) Class.forName(config.get(STREAM_APPLICATION_CLASS_CONFIG)).newInstance(); switch (op) { case RUN: runner.run(app); break; case KILL: runner.kill(app); break; case STATUS: System.out.println(runner.status(app)); break; default: throw new IllegalArgumentException("Unrecognized operation: " + op); } } else { JobRunner$.MODULE$.main(args); } }

Target:
public static void main(String[] args) throws Exception { ApplicationRunnerCommandLine cmdLine = new ApplicationRunnerCommandLine(); OptionSet options = cmdLine.parser().parse(args); Config orgConfig = cmdLine.loadConfig(options); Config config = Util.rewriteConfig(orgConfig); ApplicationRunnerOperation op = cmdLine.getOperation(options); if (config.containsKey(STREAM_APPLICATION_CLASS_CONFIG)) { ApplicationRunner runner = ApplicationRunner.fromConfig(config); StreamApplication app = (StreamApplication) Class.forName(config.get(STREAM_APPLICATION_CLASS_CONFIG)).newInstance(); switch (op) { case RUN: runner.run(app); break; case KILL: runner.kill(app); break; case STATUS: System.out.println(runner.status(app)); break; default: throw new IllegalArgumentException("Unrecognized operation: " + op); } } else { JobRunner$.MODULE$.main(args); } }
Source:
public void test000_openrepo_default_absolute_workdirconfig() throws IOException { File repo1Parent = new File(trash.getParentFile(), "r1"); File workdir = new File(trash.getParentFile(), "rw"); assertTrue(workdir.mkdir()); FileRepository repo1initial = new FileRepository(new File(repo1Parent, Constants.DOT_GIT)); repo1initial.create(); final FileBasedConfig cfg = repo1initial.getConfig(); cfg.setString("core", null, "worktree", workdir.getAbsolutePath()); cfg.save(); repo1initial.close(); File theDir = new File(repo1Parent, Constants.DOT_GIT); FileRepository r = new FileRepositoryBuilder().setGitDir(theDir) .build(); assertEqualsPath(theDir, r.getDirectory()); assertEqualsPath(workdir, r.getWorkTree()); assertEqualsPath(new File(theDir, "index"), r.getIndexFile()); assertEqualsPath(new File(theDir, "objects"), r.getObjectDatabase() .getDirectory()); }

Target:
public void test000_openrepo_default_absolute_workdirconfig() throws IOException { File repo1Parent = new File(trash.getParentFile(), "r1"); File workdir = new File(trash.getParentFile(), "rw"); FileUtils.mkdir(workdir); FileRepository repo1initial = new FileRepository(new File(repo1Parent, Constants.DOT_GIT)); repo1initial.create(); final FileBasedConfig cfg = repo1initial.getConfig(); cfg.setString("core", null, "worktree", workdir.getAbsolutePath()); cfg.save(); repo1initial.close(); File theDir = new File(repo1Parent, Constants.DOT_GIT); FileRepository r = new FileRepositoryBuilder().setGitDir(theDir) .build(); assertEqualsPath(theDir, r.getDirectory()); assertEqualsPath(workdir, r.getWorkTree()); assertEqualsPath(new File(theDir, "index"), r.getIndexFile()); assertEqualsPath(new File(theDir, "objects"), r.getObjectDatabase() .getDirectory()); }
Source:
public void validate(Element element, ElementValidation validation) { super.validate(element, validation); validatorHelper.param.inOrder() .type(CanonicalNameConstants.VIEW_PAGER).optional() .primitiveOrWrapper(TypeKind.INT).optional() .validate((ExecutableElement) element, validation); }

Target:
public void validate(Element element, ElementValidation validation) { super.validate(element, validation); validatorHelper.param.anyOrder() .type(CanonicalNameConstants.VIEW_PAGER).optional() .primitiveOrWrapper(TypeKind.INT).optional() .validate((ExecutableElement) element, validation); }
Source:
public static void init(Vector<String> pathsToClusterFiles, Vector<Integer> thresholds, Vector<Boolean> isLowercaseBrownClusters) { brownclusters = new BrownClusters(); brownclusters.isLowercaseBrownClustersByResource = new boolean[isLowercaseBrownClusters.size()]; brownclusters.wordToPathByResource = new ArrayList<>(); brownclusters.resources = new ArrayList<>(); for (int i = 0; i < pathsToClusterFiles.size(); i++) { THashMap<String, String> h = new THashMap<>(); InFile in = new InFile(ResourceUtilities.loadResource(pathsToClusterFiles.elementAt(i))); String line = in.readLine(); int wordsAdded = 0; while (line != null) { StringTokenizer st = new StringTokenizer(line); String path = st.nextToken(); String word = st.nextToken(); int occ = Integer.parseInt(st.nextToken()); if (occ >= thresholds.elementAt(i)) { h.put(word, path); wordsAdded++; } line = in.readLine(); } if (ParametersForLbjCode.currentParameters.debug) { logger.info(wordsAdded + " words added"); } brownclusters.wordToPathByResource.add(h); brownclusters.isLowercaseBrownClustersByResource[i] = isLowercaseBrownClusters.elementAt(i); brownclusters.resources.add(pathsToClusterFiles.elementAt(i)); in.close(); } }

Target:
public static void init(Vector<String> pathsToClusterFiles, Vector<Integer> thresholds, Vector<Boolean> isLowercaseBrownClusters) { synchronized (INIT_SYNC) { brownclusters = new BrownClusters(); brownclusters.isLowercaseBrownClustersByResource = new boolean[isLowercaseBrownClusters.size()]; brownclusters.wordToPathByResource = new ArrayList<>(); brownclusters.resources = new ArrayList<>(); for (int i = 0; i < pathsToClusterFiles.size(); i++) { THashMap<String, String> h = new THashMap<>(); InFile in = new InFile(ResourceUtilities.loadResource(pathsToClusterFiles.elementAt(i))); String line = in.readLine(); int wordsAdded = 0; while (line != null) { StringTokenizer st = new StringTokenizer(line); String path = st.nextToken(); String word = st.nextToken(); int occ = Integer.parseInt(st.nextToken()); if (occ >= thresholds.elementAt(i)) { h.put(word, path); wordsAdded++; } line = in.readLine(); } if (ParametersForLbjCode.currentParameters.debug) { logger.info(wordsAdded + " words added"); } brownclusters.wordToPathByResource.add(h); brownclusters.isLowercaseBrownClustersByResource[i] = isLowercaseBrownClusters.elementAt(i); brownclusters.resources.add(pathsToClusterFiles.elementAt(i)); in.close(); } } }
Source:
public String toString() { return getName() + ";" + getJavaType().getName() + ";" + guid.toString(); }

Target:
public String toString() { return "version=" + VERSION + ";guid="+ guid.toString(); }
Source:
private static final boolean isSupportedValue(Object value) { Class c = value.getClass(); return SUPPORTED_BASIC_TYPES.contains(c); }

Target:
private static final boolean isSupportedValue(Object value) { Class clazz = value.getClass(); return SUPPORTED_BASIC_TYPES.contains(clazz); }
Source:
private List<ClouderaManagerProduct> getClouderaManagerProductsFromStack(Stack stack) { Stream<ClusterComponent> clusterCompStream = Optional.ofNullable(stack).map(Stack::getCluster).map(Cluster::getComponents).orElse(Set.of()).stream(); boolean datalake = stack == null ? false : stack.isDatalake(); Stream<ClusterComponent> cmProductStream = datalake ? clusterCompStream.filter(clusterComponent -> clusterComponent.getName().equals(StackType.CDH.name())) : clusterCompStream.filter(clusterComponent -> ComponentType.CDH_PRODUCT_DETAILS.equals(clusterComponent.getComponentType())); return cmProductStream .map(ClusterComponent::getAttributes) .map(toAttributeClass(ClouderaManagerProduct.class)) .collect(Collectors.toList()); }

Target:
private List<ClouderaManagerProduct> getClouderaManagerProductsFromStack(Stack stack) { return getClusterComponents(stack).stream() .filter(createClusterComponentFilter(stack)) .map(ClusterComponent::getAttributes) .map(toAttributeClass(ClouderaManagerProduct.class)) .collect(Collectors.toList()); }
Source:
public Optional<EndGatewayData> fill(DataContainer container, EndGatewayData data) { return Optional.empty(); }

Target:
public Optional<EndGatewayData> fill(DataContainer container, EndGatewayData data) { checkNotNull(data, "data"); Optional<Vector3i> exitPosition = container.getObject(Keys.EXIT_POSITION.getQuery(), Vector3i.class); if (exitPosition.isPresent()) { data = data.set(Keys.EXIT_POSITION, exitPosition.get()); } Optional<Boolean> exactTeleport = container.getBoolean(Keys.EXACT_TELEPORT.getQuery()); if (exactTeleport.isPresent()) { data = data.set(Keys.EXACT_TELEPORT, exactTeleport.get()); } Optional<Long> age = container.getLong(Keys.END_GATEWAY_AGE.getQuery()); if (age.isPresent()) { data = data.set(Keys.END_GATEWAY_AGE, age.get()); } Optional<Integer> teleportCooldown = container.getInt(Keys.END_GATEWAY_TELEPORT_COOLDOWN.getQuery()); if (teleportCooldown.isPresent()) { data = data.set(Keys.END_GATEWAY_TELEPORT_COOLDOWN, teleportCooldown.get()); } return Optional.of(data); }
Source:
public String getExpiryColorCoding() { if (expiryColorCoding == null) { Date CertExpiryDate = x509Cert.getNotAfter(); SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date today = new Date(); long DateDiff = CertExpiryDate.getTime() - today.getTime(); long ExpiresInDays = DateDiff / (24 * 60 * 60 * 1000); if (ExpiresInDays <= 30) { setExpiryColorCoding("RED"); } else if (ExpiresInDays > 30 && ExpiresInDays <= 90) { setExpiryColorCoding("YELLOW"); } else { setExpiryColorCoding("GREEN"); } } return expiryColorCoding; }

Target:
public String getExpiryColorCoding() { if (expiryColorCoding == null) { Date certExpiryDate = x509Cert.getNotAfter(); Date today = new Date(); long dateDiff = certExpiryDate.getTime() - today.getTime(); expiresInDays = dateDiff / (24 * 60 * 60 * 1000); if (expiresInDays <= 30) { setExpiryColorCoding(CERT_EXPIRY_COLOR_CODING.RED.toString()); } else if (expiresInDays > 30 && expiresInDays <= 90) { setExpiryColorCoding(CERT_EXPIRY_COLOR_CODING.YELLOW.toString()); } else { setExpiryColorCoding(CERT_EXPIRY_COLOR_CODING.GREEN.toString()); } } return expiryColorCoding; }
Source:
public static void initDimension(int dim) { WorldServer overworld = getWorld(0); if (overworld == null) { throw new RuntimeException("Cannot Hotload Dim: Overworld is not Loaded!"); } WorldServer alterantiveDimension = null; try { DimensionType type = DimensionManager.getProviderType(dim); if (dim != 0) { DimensionPreloadEvent adEvent = new DimensionPreloadEvent(dim, type); MinecraftForge.EVENT_BUS.post(adEvent); alterantiveDimension = adEvent.getAlternativeDimension(); } } catch (Exception e) { System.err.println("Cannot Hotload Dim: " + e.getMessage()); return; } MinecraftServer mcServer = overworld.getMinecraftServer(); WorldServer world = (dim == 0 ? overworld : ( alterantiveDimension != null ? alterantiveDimension : ((WorldServer)(new WorldServerMulti(mcServer, overworld.getSaveHandler(), dim, overworld, mcServer.theProfiler).init())))); world.addEventListener(new ServerWorldEventHandler(mcServer, world)); MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); if (!mcServer.isSinglePlayer()) { world.getWorldInfo().setGameType(mcServer.getGameType()); } mcServer.setDifficultyForAllWorlds(mcServer.getDifficulty()); }

Target:
public static void initDimension(int dim) { WorldServer overworld = getWorld(0); if (overworld == null) { throw new RuntimeException("Cannot Hotload Dim: Overworld is not Loaded!"); } WorldServer alternativeDimension = null; try { DimensionType type = DimensionManager.getProviderType(dim); if (dim != 0) { DimensionPreloadEvent adEvent = new DimensionPreloadEvent(dim, type); MinecraftForge.EVENT_BUS.post(adEvent); alternativeDimension = adEvent.getAlternativeDimension(); } } catch (Exception e) { System.err.println("Cannot Hotload Dim: " + e.getMessage()); return; } MinecraftServer mcServer = overworld.getMinecraftServer(); WorldServer world; if (dim == 0) { world = overworld; } else if (alternativeDimension != null) { world = alternativeDimension; } else { world = new WorldServerMulti(mcServer, overworld.getSaveHandler(), dim, overworld, mcServer.theProfiler); world.init(); } world.addEventListener(new ServerWorldEventHandler(mcServer, world)); MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); if (!mcServer.isSinglePlayer()) { world.getWorldInfo().setGameType(mcServer.getGameType()); } mcServer.setDifficultyForAllWorlds(mcServer.getDifficulty()); }
Source:
public PaymentPluginApi getPaymentPluginApi() throws PaymentApiException { final String pluginName = getPaymentProviderPluginName(true); return getPaymentPluginApi(pluginName); }

Target:
public PaymentPluginApi getPaymentPluginApi() throws PaymentApiException { final String pluginName = getPaymentProviderPluginName(false); return getPaymentPluginApi(pluginName); }
Source:
T select( ValueGroup valueGroup ) throws IOException { return uncheckedSelect( valueGroup ); }

Target:
T select( ValueGroup valueGroup ) throws IOException { try { return uncheckedSelect( valueGroup ); } catch ( UncheckedIOException e ) { throw e.getCause(); } }
Source:
public Builder addStep(String classname) { try { Object newInstance = Thread.currentThread().getContextClassLoader().loadClass(classname).newInstance(); if (newInstance instanceof Step) { states.add((Step)newInstance); } } catch (InstantiationException | IllegalAccessException | ClassNotFoundException ex) { LogManager.getLogger(StepIterator.class).error("Failurer instatiating step for " + classname,ex); } return this; }

Target:
public Builder addStep(String classname) { try { Object newInstance = Thread.currentThread().getContextClassLoader().loadClass(classname).newInstance(); if (newInstance instanceof Step) { states.add((Step)newInstance); } else { LogManager.getLogger(StepIterator.class).error("Class cannot be cast to Step " + classname + ". Skipping adding the step."); } } catch (InstantiationException | IllegalAccessException | ClassNotFoundException ex) { LogManager.getLogger(StepIterator.class).error("Failure instatiating step for " + classname,ex); } return this; }
Source:
public static void publishDraftPatchSet(final ReviewDb db, final PatchSet.Id patchSetId) throws OrmException, NoSuchChangeException{ final Change.Id changeId = patchSetId.getParentKey(); final PatchSet patch = db.patchSets().get(patchSetId); if (patch == null || !patch.isDraft()) { throw new NoSuchChangeException(changeId); } final PatchSet updatedPatchSet = db.patchSets().atomicUpdate(patchSetId, new AtomicUpdate<PatchSet>() { @Override public PatchSet update(PatchSet patchset) { if (patchset.isDraft()) { patchset.setDraft(false); } return null; } }); final Change change = db.changes().get(changeId); if (change.getStatus() == Change.Status.DRAFT) { db.changes().atomicUpdate(changeId, new AtomicUpdate<Change>() { @Override public Change update(Change change) { if (change.getStatus() == Change.Status.DRAFT && change.currentPatchSetId().equals(patchSetId)) { change.setStatus(Change.Status.NEW); ChangeUtil.updated(change); return change; } else { return null; } } }); } }

Target:
public static void publishDraftPatchSet(final ReviewDb db, final PatchSet.Id patchSetId) throws OrmException, NoSuchChangeException{ final Change.Id changeId = patchSetId.getParentKey(); final PatchSet patch = db.patchSets().get(patchSetId); if (patch == null || !patch.isDraft()) { throw new NoSuchChangeException(changeId); } db.patchSets().atomicUpdate(patchSetId, new AtomicUpdate<PatchSet>() { @Override public PatchSet update(PatchSet patchset) { if (patchset.isDraft()) { patchset.setDraft(false); } return null; } }); final Change change = db.changes().get(changeId); if (change.getStatus() == Change.Status.DRAFT) { db.changes().atomicUpdate(changeId, new AtomicUpdate<Change>() { @Override public Change update(Change change) { if (change.getStatus() == Change.Status.DRAFT && change.currentPatchSetId().equals(patchSetId)) { change.setStatus(Change.Status.NEW); ChangeUtil.updated(change); return change; } else { return null; } } }); } }
Source:
private TextBody buildText(boolean isDraft, SimpleMessageFormat messageFormat) { TextBodyBuilder textBodyBuilder = new TextBodyBuilder( mMessageContentView.getText().toString(), mIdentity.getSignatureUse() ? mSignatureView.getCharacters() : null ); if (isDraft || mQuotedTextMode == QuotedTextMode.SHOW) { textBodyBuilder.setIncludeQuotedText(true); } else { textBodyBuilder.setIncludeQuotedText(false); } if (!isDraft) { textBodyBuilder.setAppendSignature(true); } else { textBodyBuilder.setAppendSignature(false); } textBodyBuilder.setDraft(isDraft); textBodyBuilder.setSignatureBeforeQuotedText(mAccount.isSignatureBeforeQuotedText()); if (mQuoteStyle == QuoteStyle.PREFIX && mAccount.isReplyAfterQuote()) { textBodyBuilder.setReplyAfterQuote(true); } else { textBodyBuilder.setReplyAfterQuote(false); } TextBody body; if (messageFormat == SimpleMessageFormat.HTML) { body = textBodyBuilder.buildTextHtml(mQuotedHtmlContent); } else { body = textBodyBuilder.buildTextPlain(mQuotedText.getText().toString()); } return body; }

Target:
private TextBody buildText(boolean isDraft, SimpleMessageFormat messageFormat) { String messageText = mMessageContentView.getCharacters(); TextBodyBuilder textBodyBuilder = new TextBodyBuilder(messageText); boolean includeQuotedText = (isDraft || mQuotedTextMode == QuotedTextMode.SHOW); boolean isReplyAfterQuote = (mQuoteStyle == QuoteStyle.PREFIX && mAccount.isReplyAfterQuote()); textBodyBuilder.setIncludeQuotedText(false); if (includeQuotedText) { if (messageFormat == SimpleMessageFormat.HTML && mQuotedHtmlContent != null) { textBodyBuilder.setIncludeQuotedText(true); textBodyBuilder.setQuotedTextHtml(mQuotedHtmlContent); textBodyBuilder.setReplyAfterQuote(isReplyAfterQuote); } String quotedText = mQuotedText.getCharacters(); if (messageFormat == SimpleMessageFormat.TEXT && quotedText.length() > 0) { textBodyBuilder.setIncludeQuotedText(true); textBodyBuilder.setQuotedText(quotedText); textBodyBuilder.setReplyAfterQuote(isReplyAfterQuote); } } textBodyBuilder.setInsertSeparator(!isDraft); boolean useSignature = (!isDraft && mIdentity.getSignatureUse()); if (useSignature) { textBodyBuilder.setAppendSignature(true); textBodyBuilder.setSignature(mSignatureView.getCharacters()); textBodyBuilder.setSignatureBeforeQuotedText(mAccount.isSignatureBeforeQuotedText()); } else { textBodyBuilder.setAppendSignature(false); } TextBody body; if (messageFormat == SimpleMessageFormat.HTML) { body = textBodyBuilder.buildTextHtml(); } else { body = textBodyBuilder.buildTextPlain(); } return body; }
Source:
public void init(GameContainer gc, StateBasedGame sbg) throws SlickException { this.sbg = sbg; controller = new Controller(gc, sbg); soundObserver = new SoundObserver(); ArrayList<Player> players = Model.getPlayers(); for(Player player: players) { controller.registerObserver(player.getWallet()); } controller.registerObserver(soundObserver); controller.registerObserver(this); timers = controller.getTimers(); timers.restartTimer(); view = new View(gc, timers); try { wavEffect = AudioLoader.getAudio("WAV", ResourceLoader.getResourceAsStream("Bubble_Trouble_Theme.wav")); } catch (IOException e) { e.printStackTrace(); } wavEffect.playAsSoundEffect(1.0f, 1.0f, true); SoundStore.get().poll(0); }

Target:
public void init(GameContainer gc, StateBasedGame sbg) throws SlickException { this.sbg = sbg; controller = new Controller(gc, sbg); soundObserver = new SoundObserver(); for(Player player: Model.getPlayers()) { controller.registerObserver(player.getWallet()); } controller.registerObserver(soundObserver); controller.registerObserver(this); timers = controller.getTimers(); timers.restartTimer(); view = new View(gc, timers); try { wavEffect = AudioLoader.getAudio("WAV", ResourceLoader.getResourceAsStream("Bubble_Trouble_Theme.wav")); } catch (IOException e) { e.printStackTrace(); } wavEffect.playAsSoundEffect(1.0f, 1.0f, true); SoundStore.get().poll(0); }
Source:
public void testAnalysisCache() { executeTarget("testAnalysisCache"); assertOutputContaining("Avoid really long methods"); }

Target:
public void testAnalysisCache() { executeTarget("testAnalysisCache"); assertOutputContaining("Avoid really long methods"); assertDoesntContain(buildRule.getLog(), "This analysis could be faster"); assertTrue(currentTempFile().exists()); }
Source:
public static void main(String args[]) { long start = JVM.monotonicTimeMillis(); RE r1 = new RE("\\[([^\\[\\]])*\\]"); RE r2 = new RE("(\\d{3})(\\d{4})"); String number = "5555231119"; boolean m1 = false; boolean m2 = false; for (int i = 0; i < 1000; i++) { m1 = r1.match(number); m2 = r2.match(number); } System.out.println("Matches: " + m1 + " " + m2); System.out.println("REGEX: " + (JVM.monotonicTimeMillis() - start)); }

Target:
public static void main(String args[]) { long start = JVM.monotonicTimeMillis(); RE r1 = new RE("\\[([^\\[\\]])*\\]"); RE r2 = new RE("(\\d{3})(\\d{4})"); long initTime = JVM.monotonicTimeMillis() - start; String number = "5555231119"; boolean m1 = false; boolean m2 = false; start = JVM.monotonicTimeMillis(); for (int i = 0; i < 1000; i++) { m1 = r1.match(number); m2 = r2.match(number); } long matchTime = JVM.monotonicTimeMillis() - start; System.out.println("Matches: " + m1 + " " + m2); System.out.println("REGEX init time: " + initTime); System.out.println("REGEX match time: " + matchTime); }
Source:
private void downloadUpdateData() { try { fileDownloader.setProgressTrackerWindowDescription("Checking for update", "Checking for update..."); fileDownloader.setEnableProgressWindow(false); fileDownloader.downloadFileFromUrlToFile( new URI(UPDATE_SERVER_DATA_NAME), new File(UPDATE_DIRECTORY + File.separator + UPDATE_LOCAL_DATA_NAME)); } catch (URISyntaxException e) { e.printStackTrace(); } }

Target:
private boolean downloadUpdateData() { try { FileDownloader fileDownloader = new FileDownloader( new URI(UPDATE_SERVER_DATA_NAME), new File(UPDATE_DIRECTORY + File.separator + UPDATE_LOCAL_DATA_NAME), a -> {}); return fileDownloader.download(); } catch (URISyntaxException e) { logger.error(ERROR_DOWNLOAD_UPDATE_DATA, e); return false; } }
Source:
public void init(Context context) { this.context = ((SamzaSqlApplicationContext) context.getApplicationTaskContext()).getTranslatorContexts().get(queryId); this.project = (Project) this.context.getRelNode(projectId); this.expr = this.context.getExpressionCompiler().compile(project.getInputs(), project.getProjects()); ContainerContext containerContext = context.getContainerContext(); metricsRegistry = containerContext.getContainerMetricsRegistry(); processingTimeHistogram = new SamzaHistogram(metricsRegistry, logicalOpId, PROCESSING_TIME_HISTOGRAM_NAME); messagesCounter = metricsRegistry.newCounter(logicalOpId, MESSAGES_COUNTER_NAME); messagesCounter.clear(); }

Target:
public void init(Context context) { this.translatorContext = ((SamzaSqlApplicationContext) context.getApplicationTaskContext()).getTranslatorContexts().get(queryId); this.project = (Project) this.translatorContext.getRelNode(projectId); this.expr = this.translatorContext.getExpressionCompiler().compile(project.getInputs(), project.getProjects()); ContainerContext containerContext = context.getContainerContext(); metricsRegistry = containerContext.getContainerMetricsRegistry(); processingTime = new SamzaHistogram(metricsRegistry, logicalOpId, PROCESSING_TIME_NAME); numEvents = metricsRegistry.newCounter(logicalOpId, NUM_EVENTS_NAME); numEvents.clear(); }
Source:
public Account find(final String nameOrEmail) throws OrmException { Matcher m = Pattern.compile("^.* \\(([1-9][0-9]*)\\)$").matcher(nameOrEmail); if (m.matches()) { return byId.get(Account.Id.parse(m.group(1))).getAccount(); } if (nameOrEmail.matches("^[1-9][0-9]*$")) { return byId.get(Account.Id.parse(nameOrEmail)).getAccount(); } Account account = findByNameOrEmail(nameOrEmail); if (account != null) return account; if (nameOrEmail.matches(Account.USER_NAME_PATTERN)) { return findByUserName(nameOrEmail); } return null; }

Target:
public Account find(final String nameOrEmail) throws OrmException { Matcher m = Pattern.compile("^.* \\(([1-9][0-9]*)\\)$").matcher(nameOrEmail); if (m.matches()) { return byId.get(Account.Id.parse(m.group(1))).getAccount(); } if (nameOrEmail.matches("^[1-9][0-9]*$")) { return byId.get(Account.Id.parse(nameOrEmail)).getAccount(); } Account account = findByNameOrEmail(nameOrEmail); if (account != null) { return account; } if (nameOrEmail.matches(Account.USER_NAME_PATTERN)) { return findByUserName(nameOrEmail); } return null; }
Source:
public void run() { setThreadName(); while (isConsuming()) { Optional<MessageBatch> inflight = Optional.empty(); try { logger.debug("Trying to create new batch for subscription {}", subscription.getId()); MessageBatchingResult result = receiver.next(subscription); inflight = of(result.getBatch()); inflight.ifPresent(batch -> { logger.debug("Delivering batch for subscription {}", subscription.getId()); deliver(batch, createRetryer(batch, subscription.getBatchSubscriptionPolicy())); logger.debug("Finished delivering batch for subscription {}", subscription.getId()); offsets.putAllDelivered(batch.getPartitionOffsets()); }); result.getDiscarded().forEach(m -> monitoring.markDiscarded(m, subscription, "too large")); } finally { logger.debug("Cleaning batch for subscription {}", subscription.getId()); inflight.ifPresent(this::clean); } } logger.info("Stopped consumer for subscription {}", subscription.getId()); unsetThreadName(); stoppedLatch.countDown(); }

Target:
public void run() { setThreadName(); try { consume(); } finally { logger.info("Stopped consumer for subscription {}", subscription.getId()); unsetThreadName(); stoppedLatch.countDown(); } }
Source:
public static void mongoGetExperiment(final DB dbs, final String userId, final String problemId, final String sessionInfo, final MultiConnectionManager internalConnections) throws DatabaseAccessException { final Request.Builder requestBuilder = Request.newBuilder(); requestBuilder.setSessionInfo(sessionInfo); requestBuilder.setRequestType(MessageType.DATA_REQUEST); final ItemRequest.Builder build = ItemRequest.newBuilder(); build.setQuery(ItemQuery.EXPERIMENT); final DBRef myDbRef = new DBRef(dbs, EXPERIMENT_COLLECTION, new ObjectId(problemId)); final DBObject cursor = myDbRef.fetch(); if (cursor == null) { LOG.warn("The student has not submitted anything for this problem: " + problemId); return; } final Object sketchId = cursor.get(userId); if (sketchId == null) { LOG.warn("The student has not submitted anything for this problem: " + problemId); return; } LOG.info("SketchId: ", sketchId); build.addItemId(sketchId.toString()); final DataRequest.Builder data = DataRequest.newBuilder(); data.addItems(build); requestBuilder.setOtherData(data.build().toByteString()); try { internalConnections.send(requestBuilder.build(), null, SubmissionClientWebSocket.class); } catch (ConnectionException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); throw new DatabaseAccessException("Failed to send request to submission server for experiment", e); } }

Target:
public static void mongoGetExperiment(final DB dbs, final String userId, final String problemId, final String sessionInfo, final MultiConnectionManager internalConnections) throws DatabaseAccessException { final Request.Builder requestBuilder = Request.newBuilder(); requestBuilder.setSessionInfo(sessionInfo); requestBuilder.setRequestType(MessageType.DATA_REQUEST); final ItemRequest.Builder build = ItemRequest.newBuilder(); build.setQuery(ItemQuery.EXPERIMENT); final DBRef myDbRef = new DBRef(dbs, EXPERIMENT_COLLECTION, new ObjectId(problemId)); final DBObject cursor = myDbRef.fetch(); if (cursor == null) { LOG.info("The student has not submitted anything for this problem: {}", problemId); return; } final Object sketchId = cursor.get(userId); if (sketchId == null) { LOG.info("The student has not submitted anything for this problem: {}", problemId); return; } LOG.debug("resultant SketchId: {}", sketchId); build.addItemId(sketchId.toString()); final DataRequest.Builder data = DataRequest.newBuilder(); data.addItems(build); requestBuilder.setOtherData(data.build().toByteString()); try { internalConnections.send(requestBuilder.build(), null, SubmissionClientWebSocket.class); } catch (ConnectionException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); throw new DatabaseAccessException("Failed to send request to submission server for experiment", e); } }
Source:
public TypedProperties(final TypedProperties other) { other.withReadLock(() -> { properties = other.properties == null ? null : new HashMap<>(other.properties); ENCODE_SIZE_FIELD_UPDATER.set(this, other.encodeSize); return null; }); }

Target:
public TypedProperties(final TypedProperties other) { long lock = other.readLock(); try { properties = other.properties == null ? null : new HashMap<>(other.properties); ENCODE_SIZE_FIELD_UPDATER.lazySet(this, other.encodeSize); } finally { other.unlockRead(lock); } }
Source:
public synchronized void startDiskUsageService() { if (isDiskUsageServiceEnabled) { long delay = config.getDiskUsageServiceInitialDelay(); long period = config.getDiskUsageServiceTasksInterval(); log.info("Starting DiskUsage Service (delay: {}s, period: {}s)", delay, period); duService.runScheduled(delay, period); log.info("DiskUsage Service started."); } else { log.info("DiskUsage Service is disabled."); } }

Target:
public synchronized void startDiskUsageService() { if (isDiskUsageServiceEnabled) { long delay = config.getDiskUsageServiceInitialDelay(); long period = config.getDiskUsageServiceTasksInterval(); log.info("Starting DiskUsage Service (delay: {}s, period: {}s)", delay, period); duService.start(delay, period); log.info("DiskUsage Service started."); } else { log.info("DiskUsage Service is disabled."); } }
Source:
private DiffConfig(final Config rc) { noPrefix = rc.getBoolean("diff", "noprefix", false); final String renameString = rc.getString("diff", null, "renames"); if ("true".equals(renameString)) renameDetectionType = RenameDetectionType.TRUE; else if ("copy".equals(renameString) || "copies".equals(renameString)) renameDetectionType = RenameDetectionType.COPY; else renameDetectionType = RenameDetectionType.FALSE; renameLimit = rc.getInt("diff", "renamelimit", 200); }

Target:
private DiffConfig(final Config rc) { noPrefix = rc.getBoolean("diff", "noprefix", false); final String renameString = rc.getString("diff", null, "renames"); if ("copy".equals(renameString) || "copies".equals(renameString)) renameDetectionType = RenameDetectionType.COPY; else { final Boolean renameBoolean = StringUtils .toBooleanOrNull(renameString); renameDetectionType = Boolean.TRUE.equals(renameBoolean) ? RenameDetectionType.TRUE : RenameDetectionType.FALSE; } renameLimit = rc.getInt("diff", "renamelimit", 200); }
Source:
private static OutermostChildElements getOutermostChildElements(List<Node> children) { Element firstChildElement = null; Element lastChildElement = null; for (Node child : children) { if (child.getNodeType() == Node.ELEMENT_NODE) { if (firstChildElement == null) { firstChildElement = (Element) child; } lastChildElement = (Element) child; } } return new OutermostChildElements(firstChildElement, lastChildElement); }

Target:
private static Optional<OutermostChildElements> getOutermostChildElements(List<Node> children) { Element firstChildElement = null; Element lastChildElement = null; for (Node child : children) { if (child.getNodeType() == Node.ELEMENT_NODE) { if (firstChildElement == null) { firstChildElement = (Element) child; } lastChildElement = (Element) child; } } if (firstChildElement != null) { return Optional.of(new OutermostChildElements(firstChildElement, lastChildElement)); } return Optional.empty(); }
Source:
protected void _addToBloomFilterScopeOnly(List<ScopeOnlySchemaRecord> records){ _logger.info("Adding records into scope only bloom filter.", records.size()); for(ScopeOnlySchemaRecord record : records) { String key = constructScopeOnlyKey(record.getScope()); bloomFilter.put(key); } }

Target:
protected void _addToBloomFilterScopeOnly(List<ScopeOnlySchemaRecord> records){ _logger.info("Adding records into scope only bloom filter.", records.size()); for(ScopeOnlySchemaRecord record : records) { String key = constructScopeOnlyKey(record.getScope()); bloomFilterScopeOnly.put(key); } }
Source:
public static void beforeClass() throws IOException, CommandFailedException { socketBindingResources = new SocketBindingResources(client, 3, "election-policy_"); SingletonSubsystemOperations.withOperations(operations).prepareCacheContainer(CACHE_CONTAINER_RESOURCE_ADDRESS); operations.add(SINGLETON_POLICY_ADDRESS, Values.of(CACHE_CONTAINER, CACHE_CONTAINER_RESOURCE)).assertSuccess(); operations.add(SINGLETON_POLICY_EDIT_ADDRESS, Values.of(CACHE_CONTAINER, CACHE_CONTAINER_RESOURCE)).assertSuccess(); operations.add(SINGLETON_POLICY_EDIT_ADDRESS.and(ELECTION_POLICY, "simple")).assertSuccess(); }

Target:
public static void beforeClass() throws IOException, CommandFailedException { socketBindingResources = new SocketBindingResources(client, 3, "election-policy_"); singletonOperations.prepareCacheContainer(CACHE_CONTAINER_RESOURCE_ADDRESS); operations.add(SINGLETON_POLICY_ADDRESS, Values.of(CACHE_CONTAINER, CACHE_CONTAINER_RESOURCE)).assertSuccess(); operations.batch(new Batch() .add(SINGLETON_POLICY_EDIT_ADDRESS, Values.of(CACHE_CONTAINER, CACHE_CONTAINER_RESOURCE)) .add(SINGLETON_POLICY_EDIT_ADDRESS.and(ELECTION_POLICY, "simple"))); }
Source:
public Converters(final BeanRepository beanRepository) { converterFactories = new ArrayList<>(); ServiceLoader<ConverterFactory> loader = ServiceLoader.load(ConverterFactory.class); loader.reload(); Iterator<ConverterFactory> iterator = loader.iterator(); while (iterator.hasNext()) { ConverterFactory factory = iterator.next(); LOG.trace("Found converter factory with type identifier {}", factory.getClass(), factory.getTypeIdentifier()); if(!isTypeAlreadyAdded(factory) && !isClassAlreadyAdded(factory)) { factory.init(beanRepository); converterFactories.add(factory); } } }

Target:
public Converters(final BeanRepository beanRepository) { converterFactories = new ArrayList<>(); ServiceLoader<ConverterFactory> loader = ServiceLoader.load(ConverterFactory.class); loader.reload(); Iterator<ConverterFactory> iterator = loader.iterator(); while (iterator.hasNext()) { ConverterFactory factory = iterator.next(); LOG.trace("Found converter factory with type identifier {}", factory.getClass(), factory.getTypeIdentifier()); if(!isTypeAlreadyAdded(factory) && !isAnyConversionTypeAlreadyAdded(factory)) { factory.init(beanRepository); converterFactories.add(factory); }else{ throw new DolphinRuntimeException("Converter of type(s) "+ Arrays.toString(factory.getSupportedTypes().toArray()) + " already added to the factory."); } } }
Source:
private DisjunctionNode(List<QueryTree> children) { this.children.addAll(children); this.children.sort(Comparator.comparingDouble(QueryTree::weight)); }

Target:
private DisjunctionNode(List<QueryTree> children) { this.children = new ArrayList<>(children); this.children.sort(Comparator.comparingDouble(QueryTree::weight)); }
Source:
private static String getShortMid(String text) { if(text.startsWith("www.freebase.com/")) { return text.substring(17).replaceAll("/", "."); } else if(text.startsWith("<LINK_0>")) { return text.substring(27); } else if(text.startsWith("fb:")) { return text.substring(3); } return text; }

Target:
private static String getShortMid(String text) { if(text.startsWith(FREEBASE_URI)) { return text.substring(FREEBASE_URI.length()).replaceAll("/", "."); } else if(text.startsWith(RDF_FREEBASE_URI)) { return text.substring(RDF_FREEBASE_URI.length()); } else if(text.startsWith(FREEBASE_SHORT_URI)) { return text.substring(FREEBASE_SHORT_URI.length()); } return text; }
Source:
public void assertDoesNotContainIgnoringCase(AssertionInfo info, CharSequence actual, CharSequence... values) { doCommonCheckForCharSequence(info, actual, values); Set<CharSequence> foundSequences = new LinkedHashSet<>(); for (CharSequence sequence : values) { if (actual.toString().toLowerCase().contains(sequence.toString().toLowerCase())) foundSequences.add(sequence); } if (foundSequences.isEmpty()) return; if (foundSequences.size() == 1 && values.length == 1) { throw failures.failure(info, shouldNotContainIgnoringCase(actual, values[0])); } throw failures.failure(info, shouldNotContainIgnoringCase(actual, values, foundSequences)); }

Target:
public void assertDoesNotContainIgnoringCase(AssertionInfo info, CharSequence actual, CharSequence... values) { doCommonCheckForCharSequence(info, actual, values); String actualLowerCase = actual.toString().toLowerCase(); Set<CharSequence> foundValues = stream(values).filter(value -> actualLowerCase.contains(value.toString().toLowerCase())) .collect(toCollection(LinkedHashSet::new)); if (foundValues.isEmpty()) return; if (foundValues.size() == 1 && values.length == 1) { throw failures.failure(info, shouldNotContainIgnoringCase(actual, values[0])); } throw failures.failure(info, shouldNotContainIgnoringCase(actual, values, foundValues)); }
Source:
public TopicStatus(String topic, String connector, int task, long discoverTimestamp) { this.topic = topic; this.connector = connector; this.task = task; this.discoverTimestamp = discoverTimestamp; }

Target:
public TopicStatus(String topic, String connector, int task, long discoverTimestamp) { this.topic = Objects.requireNonNull(topic); this.connector = Objects.requireNonNull(connector); this.task = task; this.discoverTimestamp = discoverTimestamp; }
Source:
private void applyHighlighting(SolrQuery query) { if (highlightParams == null) { return; } query.setHighlight(true); for (Map.Entry<String, String> highlightParam : highlightParams.getParams().entrySet()) { query.set(highlightParam.getKey(), highlightParam.getValue()); } for (HighlightingFieldParams highlightFieldParams : highlightParams.getFieldsParams()) { query.addHighlightField(highlightFieldParams.getFieldName()); if (!highlightFieldParams.getHighlightFromFields().isEmpty()) { String highlightQueryString = query.getQuery(); for (String highlightFromField : highlightFieldParams.getHighlightFromFields()) { highlightQueryString = highlightQueryString.replace(highlightFromField + ":", highlightFieldParams.getFieldName() + ":"); } query.set(HighlightParams.Q, highlightQueryString); } for (Map.Entry<String, String> highlightFieldParam : highlightFieldParams.getParams().entrySet()) { query.set("f." + highlightFieldParams.getFieldName() + "." + highlightFieldParam.getKey(), highlightFieldParam.getValue()); } } }

Target:
private void applyHighlighting(SolrQuery query) { if (highlightParams == null) { return; } applyGlobalHighlightParams(query); for (HighlightingFieldParams highlightFieldParams : highlightParams.getFieldsParams()) { applyPerFieldHighlightParams(query, highlightFieldParams); } }