auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private QueryDefinition createErrorsQueryDefinition() { String queryExpression = "select * from ExecutionErrorInfo where ERROR_ACK = "; if (TestConfig.getKieServerDataSourceDriverClass().startsWith("com.sybase")) { queryExpression += "0"; } else { queryExpression += "'0'"; } QueryDefinition query = new QueryDefinition(); query.setName("unAckErrors"); query.setSource(System.getProperty("org.kie.server.persistence.ds", "jdbc/jbpm-ds")); query.setExpression(queryExpression); query.setTarget("CUSTOM"); return query; }

Target:
private QueryDefinition createErrorsQueryDefinition() { String queryExpression = "select * from ExecutionErrorInfo where ERROR_ACK = "; queryExpression += TestConfig.isSybaseDataSource() ? "0" : "'0'"; QueryDefinition query = new QueryDefinition(); query.setName("unAckErrors"); query.setSource(System.getProperty("org.kie.server.persistence.ds", "jdbc/jbpm-ds")); query.setExpression(queryExpression); query.setTarget("CUSTOM"); return query; }
Source:
static boolean supportsJetpackSpeedUpSettings(SiteModel site) { String jetpackVersion = site.getJetpackVersion(); if (site.isUsingWpComRestApi() && site.isJetpackConnected() && !TextUtils.isEmpty(jetpackVersion)) { try { int index = jetpackVersion.lastIndexOf("-"); if (index > 0) { jetpackVersion = jetpackVersion.substring(0, index); } Version siteJetpackVersion = new Version(jetpackVersion); Version minVersion = new Version("5.8"); return siteJetpackVersion.compareTo(minVersion) >= 0; } catch (IllegalArgumentException e) { String errorStr = "Invalid site jetpack version " + jetpackVersion; AppLog.e(AppLog.T.UTILS, errorStr, e); CrashlyticsUtils.logException(e, AppLog.T.UTILS, errorStr); return true; } } return false; }

Target:
static boolean supportsJetpackSpeedUpSettings(SiteModel site) { return SiteUtils.checkMinimalJetpackVersion(site, SPEED_UP_SETTINGS_JETPACK_VERSION); }
Source:
public void finishTree(final DetailAST root) { final String[] lines = this.getLines(); for (int line = 0; line < lines.length; line += 1) { if (this.methods.inRange(line + 1) && this.validInnerClassMethod(line + 1) && EmptyLinesCheck.PATTERN.matcher(lines[line]).find()) { this.log(line + 1, "Empty line inside method"); } } this.methods.clear(); this.anons.clear(); super.finishTree(root); }

Target:
public void finishTree(final DetailAST root) { final String[] lines = this.getLines(); for (int line = 0; line < lines.length; ++line) { if (this.methods.inRange(line + 1) && this.validInnerClassMethod(line + 1) && EmptyLinesCheck.PATTERN.matcher(lines[line]).find()) { this.log(line + 1, "Empty line inside method"); } } this.methods.clear(); this.anons.clear(); super.finishTree(root); }
Source:
public CommandResult<CanvasViolation> move(final Element[] elements, final Point2D[] locations) { if (elements.length != locations.length) { throw new IllegalArgumentException("The length for the elements to move " + "does not match the locations provided."); } Command<AbstractCanvasHandler, CanvasViolation> command; if (elements.length == 1) { command = createMoveCommand(elements[0], locations[0]); } else { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> builder = new CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation>() .forward(); int i = 0; for (final Element element : elements) { final CanvasCommand<AbstractCanvasHandler> c = createMoveCommand(element, locations[i]); builder.addCommand(c); i++; } command = builder.build(); } final CommandResult<CanvasViolation> result = getCommandManager().execute(canvasHandler, command); if (!CommandUtils.isError(result) && shapeLocationsChangedEvent != null) { Collection<String> uuids = new ArrayList<>(); for (final Element element : elements) { uuids.add(element.getUUID()); } shapeLocationsChangedEvent.fire(new ShapeLocationsChangedEvent(uuids, canvasHandler)); } return result; }

Target:
public CommandResult<CanvasViolation> move(final Element[] elements, final Point2D[] locations) { if (elements.length != locations.length) { throw new IllegalArgumentException("The length for the elements to move " + "does not match the locations provided."); } Command<AbstractCanvasHandler, CanvasViolation> command; if (elements.length == 1) { command = createMoveCommand(elements[0], locations[0]); } else { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> builder = new CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation>() .forward(); int i = 0; for (final Element element : elements) { final CanvasCommand<AbstractCanvasHandler> c = createMoveCommand(element, locations[i]); builder.addCommand(c); i++; } command = builder.build(); } CommandResult<CanvasViolation> result = getCommandManager().allow(canvasHandler, command); if (!CommandUtils.isError(result)) { result = getCommandManager().execute(canvasHandler, command); if (!CommandUtils.isError(result)) { List<String> uuids = Arrays.stream(elements).map(Element::getUUID).collect(Collectors.toList()); shapeLocationsChangedEvent.fire(new ShapeLocationsChangedEvent(uuids, canvasHandler)); } } return result; }
Source:
private String beginningOfMonthManipulation(String value) { DateTime dateTime = new DateTime(value); return dateTime.dayOfMonth().withMinimumValue().toString(); }

Target:
private String beginningOfMonthManipulation(String value) { DateTime dateTime = new DateTime(value); return dateTime.dayOfMonth().withMinimumValue().withTime(0, 0, 0, 0).toString(); }
Source:
public int readFrom(ReadableByteChannel channel) throws IOException { int bytesRead = 0; if (buffer == null) { bytesRead = channel.read(sizeBuffer); if(bytesRead == -1) return -1; if (sizeBuffer.position() == sizeBuffer.capacity()) { sizeBuffer.flip(); sizeToRead = (int)sizeBuffer.getLong(); sizeRead += 8; buffer = ByteBuffer.allocate(sizeToRead - 8); } } if (buffer != null && sizeRead < sizeToRead) { sizeRead += channel.read(buffer); if (sizeRead == sizeToRead) { buffer.flip(); } } logger.trace("size read from channel {}", sizeRead); return bytesRead; }

Target:
public long readFrom(ReadableByteChannel channel) throws IOException { long bytesRead = 0; if (buffer == null) { bytesRead = channel.read(sizeBuffer); if (bytesRead == -1) { return -1; } if (sizeBuffer.position() == sizeBuffer.capacity()) { sizeBuffer.flip(); sizeToRead = (int) sizeBuffer.getLong(); sizeRead += 8; bytesRead += 8; buffer = ByteBuffer.allocate(sizeToRead - 8); } } if (buffer != null && sizeRead < sizeToRead) { long bytesReadFromChannel = channel.read(buffer); sizeRead += bytesReadFromChannel; bytesRead += bytesReadFromChannel; if (sizeRead == sizeToRead) { buffer.flip(); } } logger.trace("size read from channel {}", sizeRead); return bytesRead; }
Source:
protected void createExpression() { logger.info("Creating an expression for condition {}", condition); expressionFunctions.addAll(optionalExpressionFunctions); expr = PojoUtils.createExpression(inClazz, condition, Boolean.class, expressionFunctions.toArray(new String[expressionFunctions.size()])); }

Target:
protected void createExpression() { logger.info("Creating an expression for condition {}", condition); for (String expression : additionalExpressionFunctions) { if (expression != null) { expressionFunctions.add(expression); } } expr = PojoUtils.createExpression(inClazz, condition, Boolean.class, expressionFunctions.toArray(new String[expressionFunctions.size()])); }
Source:
private void updateConsoleAddressPartiallyOverridden(VDSGroup cluster) { AsyncQuery query = new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { boolean toShowWarning = (Boolean) ((VdcQueryReturnValue) returnValue).getReturnValue(); setConsoleAddressPartiallyOverridden(toShowWarning); } } ); Frontend.RunQuery( VdcQueryType.GetHostsInClusterPartiallyOverridden, new GetHostsInClusterPartiallyOverriddenParameters(cluster.getId()), query ); }

Target:
private void updateConsoleAddressPartiallyOverridden(VDSGroup cluster) { AsyncQuery query = new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { boolean isConsistent = (Boolean) ((VdcQueryReturnValue) returnValue).getReturnValue(); setConsoleAddressPartiallyOverridden(!isConsistent); } } ); Frontend.RunQuery( VdcQueryType.IsDisplayAddressConsistentInCluster, new IdQueryParameters(cluster.getId()), query ); }
Source:
public static void main(String... args) throws IOException { if (Context.getJavaVersion() >= 9){ UILog.log("Parabot", "Parabot doesn't support Java 9+ currently. Please downgrade to Java 8 to ensure Parabot is working correctly."); System.exit(0); } if(!System.getProperty("os.arch").contains("64")) { UILog.log("Parabot", "You are not running a 64-bit version of java, this might cause the client to lag or crash unexpectedly.\r\n" + "It's recommended to upgrade to a 64-bit version."); } parseArgs(args); Directories.validate(); Core.verbose(TranslationHelper.translate("DEBUG_MODE") + Core.inDebugMode()); try { Core.verbose(TranslationHelper.translate("SETTING_LOOK_AND_FEEL") + UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { t.printStackTrace(); } if (!Core.inDebugMode() && Core.hasValidation() && !Core.isValid()) { if (Core.newVersionAlert() == JOptionPane.YES_OPTION) { Core.downloadNewVersion(); return; } } Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER")); AccountManager.validate(); if (username != null && password != null) { new BotUI(username, password); username = null; password = null; return; } Core.verbose(TranslationHelper.translate("STARTING_LOGIN_GUI")); new BotUI(null, null); }

Target:
public static void main(String... args) throws IOException { if (Context.getJavaVersion() >= 9){ UILog.log("Parabot", "Parabot doesn't support Java 9+ currently. Please downgrade to Java 8 to ensure Parabot is working correctly."); System.exit(0); } if(!System.getProperty("os.arch").contains("64")) { UILog.log("Parabot", "You are not running a 64-bit version of Java, this might cause the client to lag or crash unexpectedly.\r\n" + "It's recommended to upgrade to a 64-bit version."); } parseArgs(args); Directories.validate(); Core.verbose(TranslationHelper.translate("DEBUG_MODE") + Core.inDebugMode()); try { Core.verbose(TranslationHelper.translate("SETTING_LOOK_AND_FEEL") + UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { t.printStackTrace(); } if (!Core.inDebugMode() && Core.hasValidation() && !Core.isValid()) { if (Core.newVersionAlert() == JOptionPane.YES_OPTION) { Core.downloadNewVersion(); return; } } Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER")); AccountManager.validate(); if (username != null && password != null) { new BotUI(username, password); username = null; password = null; return; } Core.verbose(TranslationHelper.translate("STARTING_LOGIN_GUI")); new BotUI(null, null); }
Source:
public BaseCouchbaseTableFunction(String bucketName, Class<V> valueClass, String... clusterNodes) { Preconditions.checkArgument(StringUtils.isNotEmpty(bucketName), "Bucket name is not allowed to be null or empty."); Preconditions.checkArgument(valueClass != null, "Value class is not allowed to be null."); Preconditions.checkArgument(ArrayUtils.isNotEmpty(clusterNodes), "Cluster nodes is not allowed to be null or empty."); this.bucketName = bucketName; this.clusterNodes = ImmutableList.copyOf(clusterNodes); this.environmentConfigs = new CouchbaseEnvironmentConfigs(); }

Target:
public BaseCouchbaseTableFunction(String bucketName, Class<V> valueClass, String... clusterNodes) { Preconditions.checkArgument(StringUtils.isNotEmpty(bucketName), "Bucket name is not allowed to be null or empty."); Preconditions.checkArgument(valueClass != null, "Value class is not allowed to be null."); Preconditions.checkArgument(ArrayUtils.isNotEmpty(clusterNodes), "Cluster nodes is not allowed to be null or empty."); this.bucketName = bucketName; this.clusterNodes = ImmutableList.copyOf(clusterNodes); environmentConfigs = new CouchbaseEnvironmentConfigs(); }
Source:
public void before() { mapName = randomMapName(); noStatsMapName = mapName + "_no_stats"; System.setProperty("hazelcast.proxy.destroy.timeout.millis", Integer.toString(PROXY_DESTROY_TIMEOUT)); Config config = getConfig(); config.setProperty(PARTITION_COUNT.getName(), Integer.toString(PARTITIONS)); config.getMapConfig(mapName).setInMemoryFormat(inMemoryFormat); config.getMapConfig(noStatsMapName).setStatisticsEnabled(false); instance = createInstance(config); map = instance.getMap(mapName); noStatsMap = instance.getMap(noStatsMapName); queryTypes = initQueryTypes(); }

Target:
public void before() { mapName = randomMapName(); noStatsMapName = mapName + "_no_stats"; System.setProperty(HAZELCAST_PROXY_DESTROY_TIMEOUT_MILLIS, Integer.toString(PROXY_DESTROY_TIMEOUT)); Config config = getConfig(); config.setProperty(PARTITION_COUNT.getName(), Integer.toString(PARTITIONS)); config.getMapConfig(mapName).setInMemoryFormat(inMemoryFormat); config.getMapConfig(noStatsMapName).setStatisticsEnabled(false); instance = createInstance(config); map = instance.getMap(mapName); noStatsMap = instance.getMap(noStatsMapName); queryTypes = initQueryTypes(); }
Source:
protected Predicate<GHHook> deleteWebhook() { return new Predicate<GHHook>() { public boolean apply(GHHook hook) { if (hook ==null) { return true; } try { hook.delete(); return true; } catch (IOException e) { throw new GHException("Failed to delete post-commit hook", e); } } }; }

Target:
protected Predicate<GHHook> deleteWebhook() { return new Predicate<GHHook>() { public boolean apply(GHHook hook) { try { Validate.notNull(hook).delete(); return true; } catch (IOException e) { throw new GHException("Failed to delete post-commit hook", e); } } }; }
Source:
public void onNomadCommit(CommitMessage message, AcceptRejectResponse response, NomadChangeInfo changeInfo) { if (response.isAccepted()) { DynamicConfigNomadChange dynamicConfigNomadChange = (DynamicConfigNomadChange) changeInfo.getNomadChange(); LOGGER.info("Nomad change committed: {}", message.getChangeUuid(), dynamicConfigNomadChange.getSummary()); List<? extends DynamicConfigNomadChange> nomadChanges = MultiSettingNomadChange.extractChanges(dynamicConfigNomadChange); synchronized (this) { for (DynamicConfigNomadChange nomadChange : nomadChanges) { Cluster upcomingCluster = nomadChange.apply(upcomingNodeContext.getCluster()); upcomingNodeContext = upcomingNodeContext.withCluster(upcomingCluster).orElseGet(upcomingNodeContext::alone); if (nomadChange.canApplyAtRuntime(upcomingNodeContext.getNodeName())) { Cluster runtimeCluster = nomadChange.apply(runtimeNodeContext.getCluster()); runtimeNodeContext = runtimeNodeContext.withCluster(runtimeCluster).orElseGet(runtimeNodeContext::alone); LOGGER.info("New cluster configuration: {}{}", lineSeparator(), clusterProperties(runtimeNodeContext)); } else { LOGGER.info("Pending cluster configuration: {}{}", lineSeparator(), clusterProperties(upcomingNodeContext)); } } } if (runtimeNodeContext.equals(upcomingNodeContext)) { LOGGER.info("New cluster configuration: {}{}", lineSeparator(), clusterProperties(runtimeNodeContext)); } else { LOGGER.info("Pending cluster configuration: {}{}", lineSeparator(), clusterProperties(upcomingNodeContext)); } } else { LOGGER.warn("Nomad change failed to commit: {}", message.getChangeUuid(), response); } listeners.forEach(c -> c.onNomadCommit(message, response, changeInfo)); }

Target:
public void onNomadCommit(CommitMessage message, AcceptRejectResponse response, NomadChangeInfo changeInfo) { if (response.isAccepted()) { DynamicConfigNomadChange dynamicConfigNomadChange = (DynamicConfigNomadChange) changeInfo.getNomadChange(); LOGGER.info("Nomad change committed: {}", message.getChangeUuid(), dynamicConfigNomadChange.getSummary()); List<? extends DynamicConfigNomadChange> nomadChanges = MultiSettingNomadChange.extractChanges(dynamicConfigNomadChange); synchronized (this) { for (DynamicConfigNomadChange nomadChange : nomadChanges) { Cluster upcomingCluster = nomadChange.apply(upcomingNodeContext.getCluster()); upcomingNodeContext = upcomingNodeContext.withCluster(upcomingCluster).orElseGet(upcomingNodeContext::alone); if (nomadChange.canApplyAtRuntime(upcomingNodeContext.getNodeName())) { Cluster runtimeCluster = nomadChange.apply(runtimeNodeContext.getCluster()); runtimeNodeContext = runtimeNodeContext.withCluster(runtimeCluster).orElseGet(runtimeNodeContext::alone); } } } if (runtimeNodeContext.equals(upcomingNodeContext)) { LOGGER.info("New cluster configuration: {}{}", lineSeparator(), clusterProperties(runtimeNodeContext)); } else { LOGGER.info("Pending cluster configuration: {}{}", lineSeparator(), clusterProperties(upcomingNodeContext)); } } else { LOGGER.warn("Nomad change failed to commit: {}", message.getChangeUuid(), response); } listeners.forEach(c -> c.onNomadCommit(message, response, changeInfo)); }
Source:
public static File[] getLogFiles(File[] logDirList,long snapshotZxid) { List<File> files = Util.sortDataDir(logDirList, "log", true); int lastIndex = files.size() - 1; List<File> v = new ArrayList<File>(5); for (int i = lastIndex; i >= 0; i--) { File f = files.get(i); long fzxid = Util.getZxidFromName(f.getName(), "log"); if (fzxid > snapshotZxid) { v.add(0, f); } else { v.add(0, f); break; } } return v.toArray(new File[0]); }

Target:
public static File[] getLogFiles(File[] logDirList,long snapshotZxid) { List<File> files = Util.sortDataDir(logDirList, "log", false); List<File> v = new ArrayList<File>(5); for (File f : files) { if (!f.getName().startsWith("log.")) { continue; } long fzxid = Util.getZxidFromName(f.getName(), "log"); if (fzxid > snapshotZxid) { v.add(0, f); } else { v.add(0, f); break; } } return v.toArray(new File[0]); }
Source:
public void testWorkManagerWork() throws Exception { MetricsTracker tracker = new MetricsTracker(); tracker.assertDiff(0, 0, 0, 0); SleepWork work = new SleepWork(getDurationMillis()); service.schedule(work); assertTrue(work.getSchedulingTime() != 0); Thread.sleep(getDurationMillis() / 3); assertState(RUNNING, work); tracker.assertDiff(0, 1, 0, 0); Thread.sleep(getDurationMillis()); tracker.assertDiff(0, 0, 1, 0); }

Target:
public void testWorkManagerWork() throws Exception { MetricsTracker tracker = new MetricsTracker(); tracker.assertDiff(0, 0, 0, 0); long duration = 3000; SleepWork work = new SleepWork(duration); service.schedule(work); assertTrue(work.getSchedulingTime() != 0); Thread.sleep(duration / 3); assertState(RUNNING, work); tracker.assertDiff(0, 1, 0, 0); Thread.sleep(duration); tracker.assertDiff(0, 0, 1, 0); }
Source:
private void populateFields() { myProjectId.setText(""); myVersion.setText(""); Module appEngineModule = myModuleComboBox.getSelectedModule(); if (appEngineModule != null) { AppEngineGradleFacet facet = AppEngineGradleFacet.getAppEngineFacetByModule(appEngineModule); if (facet == null) { return; } final AppEngineWebApp appEngineWebApp = facet.getAppEngineWebXml(); if (appEngineWebApp == null) { return; } myProjectId.setText(appEngineWebApp.getApplication().getRawText()); myVersion.setText(appEngineWebApp.getVersion().getRawText()); } }

Target:
private void populateFields() { myProjectId.setText(""); myVersion.setText(""); Module appEngineModule = myModuleComboBox.getSelectedModule(); if (appEngineModule != null) { AppEngineGradleFacet facet = AppEngineGradleFacet.getAppEngineFacetByModule(appEngineModule); if (facet == null) { Messages.showErrorDialog(this.getPeer().getOwner(), "Could not acquire App Engine module information.", "Deploy"); return; } final AppEngineWebApp appEngineWebApp = facet.getAppEngineWebXml(); if (appEngineWebApp == null) { Messages.showErrorDialog(this.getPeer().getOwner(), "Could not locate or parse the appengine-web.xml fle.", "Deploy"); return; } myProjectId.setText(appEngineWebApp.getApplication().getRawText()); myVersion.setText(appEngineWebApp.getVersion().getRawText()); } }
Source:
public void onColumnsChange(MockDataFile dataFile) { if (!this.dataFile.equals(dataFile)) { return; } updateColumns(); }

Target:
public void onColumnsChange(MockDataFile dataFile) { if (this.dataFile != dataFile) { return; } updateColumns(); }
Source:
public void beforeNotify(Report report) { HttpServletRequest request = BugsnagServletRequestListener.getServletRequest(); if (request == null) { return; } report .addToTab("request", "url", request.getRequestURL().toString()) .addToTab("request", "method", request.getMethod()) .addToTab("request", "params", request.getParameterMap()) .addToTab("request", "clientIp", RequestUtils.getClientIp(request)) .addToTab("request", "headers", RequestUtils.getHeaderMap(request)); if (report.getContext() == null) { report.setContext(RequestUtils.generateContext(request)); } }

Target:
public void beforeNotify(Report report) { HttpServletRequest request = BugsnagServletRequestListener.getServletRequest(); if (request == null) { return; } report .addToTab("request", "url", request.getRequestURL().toString()) .addToTab("request", "method", request.getMethod()) .addToTab("request", "params", new HashMap<String, String[]>(request.getParameterMap())) .addToTab("request", "clientIp", getClientIp(request)) .addToTab("request", "headers", getHeaderMap(request)); if (report.getContext() == null) { report.setContext(request.getMethod() + " " + request.getRequestURI()); } }
Source:
public void submit(C callable) { WrappedTask wt = new WrappedTask(callable); wt.future = executorService.submit(wt); wrappedTasks.add(wt); }

Target:
public void submit(C callable) { if (isCompleting) { throw new ConcurrentModificationException( "TimeoutTaskExecutor is not a thread-safe class but complete() is currently in progress."); } WrappedTask wt = new WrappedTask(callable); wt.future = executorService.submit(wt); wrappedTasks.add(wt); }
Source:
private String getContentOfStream(InputStream input) throws IOException { String charset = getRequestCharset(); logger.debug("Using charset " + charset); StringBuilder content = new StringBuilder(); byte[] buffer = new byte[1024]; int readed = 0; while ((readed = input.read(buffer)) != -1) { content.append(new String(buffer, 0, readed, charset)); } return content.toString(); }

Target:
private String getContentOfStream(InputStream input) throws IOException { String charset = getRequestCharset(); logger.debug("Using charset {}", charset); StringBuilder content = new StringBuilder(); byte[] buffer = new byte[1024]; int readed = 0; while ((readed = input.read(buffer)) != -1) { content.append(new String(buffer, 0, readed, charset)); } return content.toString(); }
Source:
public static void closeAllForUGI(UserGroupInformation ugi) throws IOException { if (LOGGER.isDebugEnabled()) { debugLogFileSystemClose("closeAllForUGI", "UGI: " + ugi.toString()); } CACHE.closeAll(ugi); }

Target:
public static void closeAllForUGI(UserGroupInformation ugi) throws IOException { debugLogFileSystemClose("closeAllForUGI", "UGI: " + ugi); CACHE.closeAll(ugi); }
Source:
public Result<?> get(int rowIndex, int columnIndex) { if (rowIndex < 0 || rowIndex >= rowCount) { throw new IllegalArgumentException( Messages.format( "Row index must be between zero and the row count ({}), but it was {}", rowCount, rowIndex)); } if (columnIndex < 0 || columnIndex >= columnCount) { throw new IllegalArgumentException( Messages.format( "Column index must be between zero and the column count ({}), but it was {}", columnCount, columnIndex)); } int index = (rowIndex * columnCount) + columnIndex; return values.get(index); }

Target:
public Result<?> get(int rowIndex, int columnIndex) { if (rowIndex < 0 || rowIndex >= rowCount) { throw new IllegalArgumentException(invalidRowIndexMessage(rowIndex)); } if (columnIndex < 0 || columnIndex >= columnCount) { throw new IllegalArgumentException(invalidColumnIndexMessage(columnIndex)); } int index = (rowIndex * columnCount) + columnIndex; return items.get(index); }
Source:
private RowType createJsonRowType(DataType databaseSchema) { DataType payload = DataTypes.ROW( DataTypes.FIELD("data", databaseSchema), DataTypes.FIELD("old", databaseSchema), DataTypes.FIELD("type", DataTypes.STRING())); return (RowType) payload.getLogicalType(); }

Target:
private RowType createJsonRowType(DataType databaseSchema) { DataType payload = DataTypes.ROW( DataTypes.FIELD("data", databaseSchema), DataTypes.FIELD("type", DataTypes.STRING())); return (RowType) payload.getLogicalType(); }
Source:
public ParseFirewallRules(Json json) { super(json, TypeLiteral.get(FirewallRules.class)); }

Target:
ParseFirewallRules(Json json) { super(json, TypeLiteral.get(FirewallRules.class)); }
Source:
public ConfigurationStore() { }

Target:
private ConfigurationStore() { }
Source:
public void close() { try { if (this.readingRaw.get() && !finalizeRaw() && LOGGER.isWarnEnabled()) { LOGGER.warn("Finalize on readRaw() returned false for " + this); } if (this.client.isConnected()) this.client.logout(); this.client.disconnect(); } catch (Exception e) { LOGGER.warn("failed to disconnect FTPClient", e); } }

Target:
public void close() { try { if (this.readingRaw.get() && !finalizeRaw() && LOGGER.isWarnEnabled()) { LOGGER.warn("Finalize on readRaw() returned false for " + this); } if (this.client.isConnected()) { this.client.logout(); } this.client.disconnect(); } catch (Exception e) { LOGGER.warn("failed to disconnect FTPClient", e); } }
Source:
public WorkloadPartition(final MemoryStore memoryStore) { this.memoryStore = memoryStore; this.ranges = new ConcurrentSet<>(); }

Target:
public WorkloadPartition(final MemoryStore memoryStore) { this.memoryStore = memoryStore; this.ranges = Collections.newSetFromMap(new ConcurrentHashMap<>()); }
Source:
public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); try { if (requestCode == UPLOAD_IMAGE_ACTIVITY_REQUEST_CODE && resultCode == RESULT_OK && null != data) { Uri selectedImage = data.getData(); String[] filePathColumn = { MediaStore.Images.Media.DATA }; Cursor cursor = getActivity().getApplicationContext().getContentResolver().query( selectedImage, filePathColumn, null, null, null); cursor.moveToFirst(); int columnIndex = cursor.getColumnIndex(filePathColumn[0]); imgDecodableString = cursor.getString(columnIndex); cursor.close(); Bitmap pickedImage = BitmapFactory.decodeFile(imgDecodableString); saveBitmap("client_image", pickedImage); uploadImage(ClientImageFile); } else if (requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE && resultCode == RESULT_OK) { uploadImage(ClientImageFile); } else { Toast.makeText(getActivity(), R.string.havent_picked_image, Toast.LENGTH_LONG).show(); } } catch (Exception e) { Toast.makeText(getActivity(), e.toString(), Toast.LENGTH_LONG) .show(); } }

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); try { if (requestCode == UPLOAD_IMAGE_ACTIVITY_REQUEST_CODE && resultCode == RESULT_OK && null != data) { Uri selectedImage = data.getData(); String[] filePathColumn = { MediaStore.Images.Media.DATA }; Cursor cursor = getActivity().getApplicationContext().getContentResolver().query( selectedImage, filePathColumn, null, null, null); cursor.moveToFirst(); int columnIndex = cursor.getColumnIndex(filePathColumn[0]); imgDecodableString = cursor.getString(columnIndex); cursor.close(); Bitmap pickedImage = BitmapFactory.decodeFile(imgDecodableString); saveBitmap(clientImageFile, pickedImage); uploadImage(clientImageFile); } else if (requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE && resultCode == RESULT_OK) { uploadImage(clientImageFile); } else { Toaster.show(rootView, R.string.havent_picked_image, Toast.LENGTH_LONG); } } catch (Exception e) { Toaster.show(rootView, e.toString(), Toast.LENGTH_LONG); } }
Source:
public void afterPropertiesSet() { super.afterPropertiesSet(); proxyObject = ProxyFactory.getProxy(getServiceInterface(), this); objectMapper = null; if (applicationContext != null && applicationContext.containsBean("objectMapper")) { objectMapper = (ObjectMapper) applicationContext.getBean("objectMapper"); } if (objectMapper == null && applicationContext != null) { try { objectMapper = BeanFactoryUtils.beanOfTypeIncludingAncestors(applicationContext, ObjectMapper.class); } catch (Exception e) { logger.debug(e); } } if (objectMapper == null) { objectMapper = new ObjectMapper(); } try { jsonRpcHttpClient = new JsonRpcHttpClient(objectMapper, new URL(getServiceUrl()), extraHttpHeaders); jsonRpcHttpClient.setRequestListener(requestListener); jsonRpcHttpClient.setSslContext(sslContext); jsonRpcHttpClient.setHostNameVerifier(hostNameVerifier); if (contentType != null) { jsonRpcHttpClient.setContentType(contentType); } if (exceptionResolver!=null) { jsonRpcHttpClient.setExceptionResolver(exceptionResolver); } } catch (MalformedURLException mue) { throw new RuntimeException(mue); } ReflectionUtil.clearCache(); }

Target:
public void afterPropertiesSet() { super.afterPropertiesSet(); proxyObject = ProxyFactory.getProxy(getServiceInterface(), this); if (jsonRpcHttpClient==null) { if (objectMapper == null && applicationContext != null && applicationContext.containsBean("objectMapper")) { objectMapper = (ObjectMapper) applicationContext.getBean("objectMapper"); } if (objectMapper == null && applicationContext != null) { try { objectMapper = BeanFactoryUtils.beanOfTypeIncludingAncestors(applicationContext, ObjectMapper.class); } catch (Exception e) { logger.debug(e); } } if (objectMapper == null) { objectMapper = new ObjectMapper(); } try { jsonRpcHttpClient = new JsonRpcHttpClient(objectMapper, new URL(getServiceUrl()), extraHttpHeaders); jsonRpcHttpClient.setRequestListener(requestListener); jsonRpcHttpClient.setSslContext(sslContext); jsonRpcHttpClient.setHostNameVerifier(hostNameVerifier); if (contentType != null) { jsonRpcHttpClient.setContentType(contentType); } if (exceptionResolver!=null) { jsonRpcHttpClient.setExceptionResolver(exceptionResolver); } } catch (MalformedURLException mue) { throw new RuntimeException(mue); } } ReflectionUtil.clearCache(); }
Source:
public void performHomingCycle() throws Exception { sendCommandImmediately(new GcodeCommand("G28.2 X0 Y0 Z0")); }

Target:
public void performHomingCycle() throws Exception { sendCommandImmediately(new GcodeCommand("G28.2 Z0 X0 Y0")); }
Source:
public ImageInputStream openImageInputStream() throws IOException { if (uri == null) throw new IllegalStateException("uri: null"); return this.uriLoader.openStream(this.toFileURI()); }

Target:
public ImageInputStream openImageInputStream() throws IOException { if (uri == null) throw new IllegalStateException("uri: null"); ImageInputStream iis = LOADER.openStream(this.toURI()); return new BulkURIImageInputStream(iis, this.offset, this.length); }
Source:
public void deletePluginIfExists(String pluginId) { String cacheKey = cacheKeyForPluginSettings(pluginId); Plugin plugin = this.findPlugin(pluginId); if (plugin instanceof NullPlugin) { return; } synchronized (cacheKey) { transactionTemplate.execute((TransactionCallback) transactionStatus -> sessionFactory.getCurrentSession() .createQuery(String.format("delete from %s where pluginId=:pluginId", Plugin.class.getSimpleName())) .setParameter("pluginId", pluginId) .executeUpdate()); goCache.remove(cacheKey); } }

Target:
public void deletePluginIfExists(String pluginId) { String cacheKey = cacheKeyForPluginSettings(pluginId); Plugin plugin = this.findPlugin(pluginId); if (plugin instanceof NullPlugin) { return; } synchronized (cacheKey) { Plugin found = this.findPlugin(pluginId); if (found instanceof NullPlugin) { return; } transactionTemplate.execute(transactionStatus -> { sessionFactory.getCurrentSession().delete(plugin); return Boolean.TRUE; }); goCache.remove(cacheKey); } }
Source:
private void storeSmsAsEvent(final PushNotificationSms pushNotificationSms) { try { this.eventNotificationMessageService.handleEvent(pushNotificationSms.getDeviceIdentification(), com.alliander.osgp.domain.core.valueobjects.EventType.SMS_NOTIFICATION, pushNotificationSms .getIpAddress().toString(), 0); } catch (final UnknownEntityException uee) { LOGGER.warn("Unable to store event for Push Notification Sms from unknown device: " + pushNotificationSms, uee); } catch (final Exception e) { LOGGER.error("Error storing event for Push Notification Sms: " + pushNotificationSms, e); } }

Target:
private void storeSmsAsEvent(final PushNotificationSms pushNotificationSms) { try { this.eventNotificationMessageService.handleEvent(pushNotificationSms.getDeviceIdentification(), com.alliander.osgp.domain.core.valueobjects.EventType.SMS_NOTIFICATION, pushNotificationSms .getIpAddress().toString(), 0); } catch (final UnknownEntityException uee) { LOGGER.warn("Unable to store event for Push Notification Sms from unknown device: {}", pushNotificationSms, uee); } catch (final Exception e) { LOGGER.error("Error storing event for Push Notification Sms: {}", pushNotificationSms, e); } }
Source:
public void detach() { boolean syncNetworkValues = false; if (!isInSync() && isManaged()) { getSetupModel().getNetworksToSync().add(getName()); syncNetworkValues = true; } assert attachedToNic != null; NetworkInterfaceModel attachingNic = attachedToNic; attachedToNic = null; List<LogicalNetworkModel> nicNetworks = attachingNic.getItems(); nicNetworks.remove(this); VdsNetworkInterface nicEntity = attachingNic.getEntity(); NetworkParameters netParams = new NetworkParameters(); if (!hasVlan()) { netParams.setBootProtocol(nicEntity.getBootProtocol()); netParams.setAddress(nicEntity.getAddress()); netParams.setSubnet(nicEntity.getSubnet()); } else { netParams.setBootProtocol(vlanNic.getEntity().getBootProtocol()); netParams.setAddress(vlanNic.getEntity().getAddress()); netParams.setSubnet(vlanNic.getEntity().getSubnet()); } if (isManagement()) { if (!hasVlan()) { netParams.setGateway(nicEntity.getGateway()); } else { netParams.setGateway(vlanNic.getEntity().getGateway()); } } getSetupModel().getNetworkToLastDetachParams().put(getName(), netParams); if (!hasVlan()) { nicEntity.setNetworkName(null); nicEntity.setBootProtocol(null); nicEntity.setAddress(null); nicEntity.setSubnet(null); nicEntity.setGateway(null); nicEntity.setNetworkImplementationDetails(null); } setBridge(null); if (nicEntity.getIsManagement()) { nicEntity.setType(0); } if (syncNetworkValues) { syncNetworkValues(); } }

Target:
public void detach() { boolean syncNetworkValues = false; if (!isInSync() && isManaged()) { getSetupModel().getNetworksToSync().add(getName()); syncNetworkValues = true; } assert attachedToNic != null; NetworkInterfaceModel attachingNic = attachedToNic; attachedToNic = null; List<LogicalNetworkModel> nicNetworks = attachingNic.getItems(); nicNetworks.remove(this); VdsNetworkInterface nicEntity = attachingNic.getEntity(); NetworkParameters netParams = new NetworkParameters(); if (!hasVlan()) { netParams.setBootProtocol(nicEntity.getBootProtocol()); netParams.setAddress(nicEntity.getAddress()); netParams.setSubnet(nicEntity.getSubnet()); } else { netParams.setBootProtocol(vlanNic.getEntity().getBootProtocol()); netParams.setAddress(vlanNic.getEntity().getAddress()); netParams.setSubnet(vlanNic.getEntity().getSubnet()); } if (isManagement()) { netParams.setGateway(!hasVlan() ? nicEntity.getGateway() : vlanNic.getEntity().getGateway()); } getSetupModel().getNetworkToLastDetachParams().put(getName(), netParams); if (!hasVlan()) { nicEntity.setNetworkName(null); nicEntity.setBootProtocol(null); nicEntity.setAddress(null); nicEntity.setSubnet(null); nicEntity.setGateway(null); nicEntity.setNetworkImplementationDetails(null); } setBridge(null); if (nicEntity.getIsManagement()) { nicEntity.setType(0); } if (syncNetworkValues) { syncNetworkValues(); } }
Source:
public MessageParser(SecorConfig config) { mConfig = config; if (mConfig.getMessageTimestampName() != null && !mConfig.getMessageTimestampName().isEmpty() && mConfig.getMessageTimestampNameSeparator() != null && !mConfig.getMessageTimestampNameSeparator().isEmpty()) { String separatorPattern = Pattern.quote(mConfig.getMessageTimestampNameSeparator()); mNestedFields = mConfig.getMessageTimestampName().split(separatorPattern); } try { messageTransformer = ReflectionUtil .createMessageTransformer(mConfig.getMessageTransformerClass(), mConfig); } catch (Exception e) { LOG.warn("Unable to initialize custom message transformer class... Using default", e); messageTransformer = new IdentityMessageTransformer(mConfig); } }

Target:
public MessageParser(SecorConfig config) { mConfig = config; if (mConfig.getMessageTimestampName() != null && !mConfig.getMessageTimestampName().isEmpty() && mConfig.getMessageTimestampNameSeparator() != null && !mConfig.getMessageTimestampNameSeparator().isEmpty()) { String separatorPattern = Pattern.quote(mConfig.getMessageTimestampNameSeparator()); mNestedFields = mConfig.getMessageTimestampName().split(separatorPattern); } }
Source:
void writeStatementRankTriple(Resource subject, StatementRank rank) { String rankRepresentation = rankToRdfRepresentation(rank); if (rankRepresentation != null){ try { this.rdfWriter.writeTripleStringObject(subject, RdfWriter.WB_RANK, rankRepresentation); } catch (RDFHandlerException e) { logger.warn("Could not write rank " + rank.toString() + " of statement " + subject.toString()); } }else{ logger.warn("Unkown rank " + rank.toString()); } }

Target:
void writeStatementRankTriple(Resource subject, StatementRank rank) { try { this.rdfWriter.writeTripleUriObject(subject, RdfWriter.WB_RANK, getUriStringForRank(rank)); } catch (RDFHandlerException e) { throw new RuntimeException(e.getMessage(), e); } }
Source:
private void addGraphicsOverlay() { PolygonBuilder polygonGeometry = new PolygonBuilder(SpatialReferences.getWebMercator()); polygonGeometry.addPoint(-20e5, 20e5); polygonGeometry.addPoint(20e5, 20.e5); polygonGeometry.addPoint(20e5, -20e5); polygonGeometry.addPoint(-20e5, -20e5); int yellow = Color.argb(4, 255, 255, 0); SimpleFillSymbol polygonSymbol = new SimpleFillSymbol(yellow, SimpleFillSymbol.Style.SOLID, null); Graphic graphic = new Graphic(polygonGeometry.toGeometry(), polygonSymbol); grOverlay = new GraphicsOverlay(); ListenableList<Graphic> graphics = grOverlay.getGraphics(); graphics.add(graphic); mMapView.getGraphicsOverlays().add(grOverlay); Log.i(TAG, "Graphic Overlay added to MapView"); }

Target:
private void addGraphicsOverlay() { PolygonBuilder polygonGeometry = new PolygonBuilder(SpatialReferences.getWebMercator()); polygonGeometry.addPoint(-20e5, 20e5); polygonGeometry.addPoint(20e5, 20.e5); polygonGeometry.addPoint(20e5, -20e5); polygonGeometry.addPoint(-20e5, -20e5); int yellow = Color.argb(128, 255, 255, 0); SimpleFillSymbol polygonSymbol = new SimpleFillSymbol(yellow, SimpleFillSymbol.Style.SOLID, null); Graphic graphic = new Graphic(polygonGeometry.toGeometry(), polygonSymbol); grOverlay = new GraphicsOverlay(); ListenableList<Graphic> graphics = grOverlay.getGraphics(); graphics.add(graphic); mMapView.getGraphicsOverlays().add(grOverlay); }
Source:
private void clearSweepProgress() { Optional<SweepProgress> progress = specificTableSweeper.getTxManager().runTaskReadOnly( specificTableSweeper.getSweepProgressStore()::loadProgress); if (progress.isPresent()) { specificTableSweeper.getSweepProgressStore().clearProgress(); } }

Target:
private void clearSweepProgress() { specificTableSweeper.getSweepProgressStore().clearProgress(); }
Source:
private boolean updateGtid(Event event) { EventHeader eventHeader = event.getHeader(); EventType eventType = eventHeader.getEventType(); if (gtidSet != null) { if (eventType == EventType.XID) { advanceGTID(); return true; } if (eventType == EventType.QUERY) { QueryEventData queryEventData = getInternalEventData(event); String query = queryEventData.getSql(); if ("COMMIT".equals(query) || "ROLLBACK".equals(query) || (previousEvent != null && previousEvent.getHeader().getEventType() == EventType.GTID && !"BEGIN".equals(query))) { advanceGTID(); } return true; } if (eventType == EventType.GTID) { if (previousGtidEvent != null) { if (advanceGTID()) { if (logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, "GtidSet wasn't synchronized before GTID. " + "Please submit a bug report to <LINK_0>"); } } } return true; } } return false; }

Target:
private boolean updateGtid(Event event) { EventHeader eventHeader = event.getHeader(); EventType eventType = eventHeader.getEventType(); if (gtidSet != null) { if (eventType == EventType.XID) { advanceGTID(); return true; } if (eventType == EventType.QUERY) { QueryEventData queryEventData = getInternalEventData(event); String query = queryEventData.getSql(); if ("COMMIT".equals(query) || "ROLLBACK".equals(query) || (previousEvent != null && previousEvent.getHeader().getEventType() == EventType.GTID && !"BEGIN".equals(query))) { advanceGTID(); } return true; } if (eventType == EventType.GTID) { if (previousGtidEvent != null) { if (advanceGTID()) { if (logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, "GtidSet wasn't synchronized before GTID. " + "Please submit a bug report to <LINK_0>"); } } } previousGtidEvent = event; return true; } } return false; }
Source:
public void onShutdown() { processors.remove(processor); processor = null; if (processors.isEmpty()) { if (appStatus == ApplicationStatus.Running) { appStatus = ApplicationStatus.SuccessfulFinish; } else if (appStatus == ApplicationStatus.New) { appStatus = ApplicationStatus.UnsuccessfulFinish; } shutdownAndNotify(); } }

Target:
public void onShutdown() { processors.remove(processor); processor = null; if (processors.isEmpty()) { shutdownAndNotify(); } }
Source:
public void verifyTemplateListElementVisible(int element) { waitForElementByElement(templateList.get(element)); }

Target:
public void verifyTemplateListElementVisible(int element) { waitForElementByElement(templateList.get(element)); PageObjectLogging.log("verifyTemplateListElementVisible", "Template element is visible ", true); }
Source:
public void stop()

Target:
public void stop() { this.caches.clear(); }
Source:
public int write(ByteBuffer src, long position) throws IOException { if (readonly) throw new NonWritableChannelException(); if (readBuffer.limit() != 0) clearReadBuffer(); else if (writePending) { if (writeBuffer.position() < writeLength) writeLength = writeBuffer.position(); long writePosition = position - realFilePosition; if (writePosition >= -src.remaining() && writePosition < writeLength) { long startPosition = position; long writeBytes; if (writePosition < 0) { int srcLimit = src.limit(); try { src.limit(src.position () + (int)-writePosition); while (true) { writeBytes = fileChannel.write(src, position); if (writeBytes == 0) { return (int) (position - startPosition); } position += writeBytes; if (position == realFilePosition) { break; } } } finally { src.limit(srcLimit); } writePosition = 0; } int writeBufferPosition = writeBuffer.position(); int srcLimit = src.limit(); int bufferWriteLength = Math.min(writeBuffer.remaining(), src.remaining()); try { writeBuffer.position((int)writePosition); src.limit(src.position() + bufferWriteLength); writeBuffer.put(src); if (writeBuffer.position() > writeLength) { writeLength = writeBuffer.position(); } } finally { writeBuffer.position(writeBufferPosition); src.limit(srcLimit); } position += bufferWriteLength; if (!src.hasRemaining()) return (int)(position - startPosition); return fileChannel.write(src, position) + (int)(position - startPosition); } } return fileChannel.write(src, position); }

Target:
public int write(ByteBuffer src, long position) throws IOException { if (readonly) throw new NonWritableChannelException(); if (readBuffer.limit() != 0) clearReadBuffer(); else if (writePending) { if (writeBuffer.position() > writeLength) writeLength = writeBuffer.position(); long writePosition = position - realFilePosition; if (writePosition >= -src.remaining() && writePosition < writeLength) { long startPosition = position; long writeBytes; if (writePosition < 0) { int srcLimit = src.limit(); try { src.limit(src.position () + (int)-writePosition); while (true) { writeBytes = fileChannel.write(src, position); if (writeBytes == 0) { return (int) (position - startPosition); } position += writeBytes; if (position == realFilePosition) { break; } } } finally { src.limit(srcLimit); } writePosition = 0; } int writeBufferPosition = writeBuffer.position(); int srcLimit = src.limit(); int bufferWriteLength = Math.min(writeBuffer.remaining(), src.remaining()); try { writeBuffer.position((int)writePosition); src.limit(src.position() + bufferWriteLength); writeBuffer.put(src); if (writeBuffer.position() > writeLength) writeLength = writeBuffer.position(); } finally { writeBuffer.position(writeBufferPosition); src.limit(srcLimit); } position += bufferWriteLength; if (!src.hasRemaining()) return (int)(position - startPosition); return fileChannel.write(src, position) + (int)(position - startPosition); } } return fileChannel.write(src, position); }
Source:
private HttpResponse executeDelete(String bucketName, String objectName, Map<String,String> queryParamMap) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { updateRegionCache(bucketName); HttpResponse response = execute(Method.DELETE, BucketRegionCache.INSTANCE.region(bucketName), bucketName, objectName, null, queryParamMap, null, null, -1); response.body().close(); return response; }

Target:
private HttpResponse executeDelete(String bucketName, String objectName, Map<String,String> queryParamMap) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { updateRegionCache(bucketName); HttpResponse response = execute(Method.DELETE, BucketRegionCache.INSTANCE.region(bucketName), bucketName, objectName, null, queryParamMap, null, 0); response.body().close(); return response; }
Source:
public HttpResponse doUpgrade() throws IOException { try { if (new VersionNumber("2.0").compareTo(getCurrentLevel())>0) { LOGGER.log(WARNING, "Performing 1.0 to 2.0 upgrade"); for (String shortName : Arrays.asList("workflow-aggregator", "pipeline-stage-view", "github-organization-folder")) { Plugin p = jenkins.getUpdateCenter().getPlugin(shortName); if (p==null) { LOGGER.warning("Plugin not found in the update center: " + shortName); } else { p.deploy(true); } } FileUtils.writeStringToFile(getStateFile(),"2.0"); return HttpResponses.redirectViaContextPath("updateCenter/"); } return NOOP; } finally { updateUpToDate(); } }

Target:
public HttpResponse doUpgrade() throws IOException { jenkins.checkPermission(Jenkins.ADMINISTER); try { if (new VersionNumber("2.0").compareTo(getCurrentLevel())>0) { LOGGER.log(WARNING, "Performing 1.0 to 2.0 upgrade"); for (String shortName : Arrays.asList("workflow-aggregator", "pipeline-stage-view", "github-organization-folder")) { Plugin p = jenkins.getUpdateCenter().getPlugin(shortName); if (p==null) { LOGGER.warning("Plugin not found in the update center: " + shortName); } else { p.deploy(true); } } FileUtils.writeStringToFile(getStateFile(),"2.0"); return HttpResponses.redirectViaContextPath("updateCenter/"); } return NOOP; } finally { updateUpToDate(); } }
Source:
public String toString() { return "GreaterThanHavingSpec{" + "{aggregationName='" + aggregationName + '\'' + ", value=" + value + '}'; }

Target:
public String toString() { return "GreaterThanHavingSpec{" + "aggregationName='" + aggregationName + '\'' + ", value=" + value + '}'; }