auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void pushJetpackMonitorSettings() { WordPress.getRestClientUtils().setJetpackMonitor( mSite.getSiteId(), mJpSettings.monitorActive, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { mRemoteJpSettings.monitorActive = response.optBoolean("active"); mJpSettings.monitorActive = mRemoteJpSettings.monitorActive; String status = mJpSettings.jetpackProtectEnabled ? "activated" : "deactivated"; AppLog.d(AppLog.T.API, "Jetpack Monitor module " + status); notifySavedOnUiThread(null); } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { AppLog.w(AppLog.T.API, "Error updating Jetpack Monitor module: " + error); notifySavedOnUiThread(error); } }); final Map<String, String> params = serializeJetpackParams(); if (params == null || params.isEmpty()) return; WordPress.getRestClientUtils().setJetpackSettings( mSite.getSiteId(), new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { AppLog.d(AppLog.T.API, "Jetpack Monitor module options updated"); mRemoteJpSettings.emailNotifications = mJpSettings.emailNotifications; mRemoteJpSettings.wpNotifications = mJpSettings.wpNotifications; notifySavedOnUiThread(null); } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { AppLog.w(AppLog.T.API, "Error updating Jetpack Monitor module options: " + error); notifySavedOnUiThread(error); } }, params); }

Target:
private void pushJetpackMonitorSettings() { final Map<String, String> params = serializeJetpackMonitorParams(); if (params.isEmpty()) { return; } final JetpackSettingsModel sentJpData = new JetpackSettingsModel(mJpSettings); WordPress.getRestClientUtilsV1_1().setJetpackMonitorSettings( mSite.getSiteId(), params, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { AppLog.d(AppLog.T.API, "Jetpack Monitor module updated"); mRemoteJpSettings.emailNotifications = sentJpData.emailNotifications; mRemoteJpSettings.wpNotifications = sentJpData.wpNotifications; notifySavedOnUiThread(null); } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { AppLog.w(AppLog.T.API, "Error updating Jetpack Monitor module: " + error); notifySavedOnUiThread(error); } }); }
Source:
public String getForkNodeConnectionString() { return "tcp://127.0.0.1:" + serverPort; }

Target:
public String getForkNodeConnectionString() { return "tcp://" + localHost + ":" + localPort; }
Source:
@Override public Iterator<Row> getRows(Session ses, SearchRow first, SearchRow last) { SqlSystemViewColumnCondition tableNameCond = conditionForColumn(TABLE_NAME, first, last); SqlSystemViewColumnCondition columnNameCond = conditionForColumn(COLUMN_NAME, first, last); Predicate<GridH2Table> tblFilter; Predicate<Column> colFilter; if (tableNameCond.isEquality()) { String tblName = tableNameCond.valueForEquality().getString(); tblFilter = tbl -> F.eq(tblName, tbl.getName()); } else tblFilter = tab -> true; if (columnNameCond.isEquality()) { String colName = columnNameCond.valueForEquality().getString(); colFilter = col -> F.eq(colName, col.getName()); } else colFilter = tab -> true; List<Row> res = new ArrayList<>(); for (GridH2Table tbl : schemaMgr.dataTables()) { if (!tblFilter.test(tbl)) continue; IndexColumn affCol = tbl.getExplicitAffinityKeyColumn(); for (int i = QueryUtils.DEFAULT_COLUMNS_COUNT; i < tbl.getColumns().length; ++i) { Column col = tbl.getColumns()[i]; if (!colFilter.test(col)) continue; Object[] data = new Object[] { col.getTable().getSchema().getName(), col.getTable().getName(), col.getName(), col.getColumnId(), DataType.getDataType(col.getType()).name, col.getType(), col.isNullable(), col.getDisplaySize(), col.getPrecision(), col.getScale(), affCol != null && F.eq(col.getColumnId(), affCol.column.getColumnId()), }; res.add(createRow(ses, data)); } } return res.iterator(); }

Target:
@Override public Iterator<Row> getRows(Session ses, SearchRow first, SearchRow last) { SqlSystemViewColumnCondition tableNameCond = conditionForColumn(TABLE_NAME, first, last); SqlSystemViewColumnCondition columnNameCond = conditionForColumn(COLUMN_NAME, first, last); Predicate<GridH2Table> tblFilter; Predicate<Column> colFilter; if (tableNameCond.isEquality()) { String tblName = tableNameCond.valueForEquality().getString(); tblFilter = tbl -> F.eq(tblName, tbl.getName()); } else tblFilter = tab -> true; if (columnNameCond.isEquality()) { String colName = columnNameCond.valueForEquality().getString(); colFilter = col -> F.eq(colName, col.getName()); } else colFilter = tab -> true; List<Row> res = new ArrayList<>(); for (GridH2Table tbl : schemaMgr.dataTables()) { if (!tblFilter.test(tbl)) continue; IndexColumn affCol = tbl.getExplicitAffinityKeyColumn(); for (int i = QueryUtils.DEFAULT_COLUMNS_COUNT; i < tbl.getColumns().length; ++i) { Column col = tbl.getColumns()[i]; if (!colFilter.test(col)) continue; Object[] data = new Object[] { tbl.getSchema().getName(), tbl.getName(), col.getName(), col.getColumnId() - QueryUtils.DEFAULT_COLUMNS_COUNT + 1, col.getDefaultExpression() != null ? toStringSafe(col.getDefaultExpression().getValue(ses)) : null, col.isNullable(), DataType.getDataType(col.getType()).name, characterLength(col), numericPrecision(col), numericScale(col), affCol != null && F.eq(col.getColumnId(), affCol.column.getColumnId()), }; res.add(createRow(ses, data)); } } return res.iterator(); }
Source:
private void prepareForSending() { try { if (partitionId != null) { attemptedPartitionIds.add(partitionId); } partitionId = getPartitionForPut(attemptedPartitionIds); chunkBlobId = new BlobId(BlobId.DEFAULT_FLAG, clusterMap.getLocalDatacenterId(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), partitionId); chunkBlobProperties = new BlobProperties(passedInBlobProperties.isEncrypted() ? chunkBlobSize : buf.remaining(), passedInBlobProperties.getServiceId(), passedInBlobProperties.getOwnerId(), passedInBlobProperties.getContentType(), passedInBlobProperties.isPrivate(), passedInBlobProperties.getTimeToLiveInSeconds(), passedInBlobProperties.getCreationTimeInMs(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), passedInBlobProperties.isEncrypted()); operationTracker = new SimpleOperationTracker(routerConfig.routerDatacenterName, partitionId, false, routerConfig.routerPutSuccessTarget, routerConfig.routerPutRequestParallelism); correlationIdToChunkPutRequestInfo.clear(); state = ChunkState.Ready; } catch (RouterException e) { setOperationExceptionAndComplete(e); } catch (Exception e) { setOperationExceptionAndComplete(new RouterException("Operation tracker could not be initialized", e, RouterErrorCode.UnexpectedInternalError)); } }

Target:
private void prepareForSending() { try { if (partitionId != null) { attemptedPartitionIds.add(partitionId); } partitionId = getPartitionForPut(attemptedPartitionIds); chunkBlobId = new BlobId(routerConfig.routerBlobidCurrentVersion, BlobId.BlobIdType.NATIVE, clusterMap.getLocalDatacenterId(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), partitionId); chunkBlobProperties = new BlobProperties(chunkBlobSize, passedInBlobProperties.getServiceId(), passedInBlobProperties.getOwnerId(), passedInBlobProperties.getContentType(), passedInBlobProperties.isPrivate(), passedInBlobProperties.getTimeToLiveInSeconds(), passedInBlobProperties.getCreationTimeInMs(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), passedInBlobProperties.isEncrypted()); operationTracker = new SimpleOperationTracker(routerConfig.routerDatacenterName, partitionId, false, routerConfig.routerPutSuccessTarget, routerConfig.routerPutRequestParallelism); correlationIdToChunkPutRequestInfo.clear(); state = ChunkState.Ready; } catch (RouterException e) { setOperationExceptionAndComplete(e); } catch (Exception e) { setOperationExceptionAndComplete(new RouterException("Operation tracker could not be initialized", e, RouterErrorCode.UnexpectedInternalError)); } }
Source:
public String transformForInfluxSystems(ServiceMetricEvent event) { String[] parts = getValue("metric", event).split("/"); String metric = String.join( "_", Arrays.asList( Arrays.copyOfRange( parts, 1, parts.length - 1 ) ) ); String payload = "druid_" + parts[0] + ","; payload += "service=" + getValue("service", event) + ((parts.length == 2) ? "" : ",metric=druid_" + metric) + ",hostname=" + getValue("host", event).split(":")[0]; ImmutableSet<String> dimNames = ImmutableSet.copyOf(event.getUserDims().keySet()); for (String dimName : dimNames) { if (this.dimensionWhiteList.contains(dimName)) { payload += "," + dimName + "=" + sanitize(String.valueOf(event.getUserDims().get(dimName))); } } payload += " druid_" + parts[parts.length - 1] + "=" + getValue("value", event); return payload + " " + event.getCreatedTime().getMillis() * 1000000 + '\n'; }

Target:
public String transformForInfluxSystems(ServiceMetricEvent event) { String[] parts = getValue("metric", event).split("/"); String metric = String.join( "_", Arrays.asList( Arrays.copyOfRange( parts, 1, parts.length - 1 ) ) ); StringBuilder payload = new StringBuilder("druid_"); payload.append(parts[0]); StringBuilder tag = new StringBuilder(",service="); tag.append(getValue("service", event)); String metricTag = parts.length == 2 ? "" : ",metric=druid_" + metric; tag.append(metricTag); tag.append(StringUtils.format(",hostname=%s", getValue("host", event).split(":")[0])); ImmutableSet<String> dimNames = ImmutableSet.copyOf(event.getUserDims().keySet()); for (String dimName : dimNames) { if (this.dimensionWhiteList.contains(dimName)) { tag.append(StringUtils.format(",%1$s=%2$s", dimName, sanitize(String.valueOf(event.getUserDims().get(dimName))))); } } payload.append(tag); payload.append(StringUtils.format(" druid_%1$s=%2$s", parts[parts.length - 1], getValue("value", event))); payload.append(StringUtils.format(" %d\n", event.getCreatedTime().getMillis() * 1000000)); return payload.toString(); }
Source:
private void removeAppender(Optional<Appender> appender) { removeAppender(appender.get()); appender = Optional.empty(); }

Target:
private void removeAppender(Optional<Appender> appender) { if (appender.isPresent()) { removeAppender(appender.get()); } }
Source:
protected String findError() { if( credentials.getDomain() == null || credentials.getUser() == null) { return "The Container Development Environment Server Adapter requires Red Hat Access credentials."; } if( selectedHypervisor == null ) { return "You must choose a hypervisor."; } String retString = null; if( homeDir == null || !(new File(homeDir)).exists()) { retString = "The selected file does not exist."; } else if( !(new File(homeDir).canExecute())) { retString = "The selected file is not executable."; } toggleDecorator(homeText, retString); if( retString != null ) return retString; if( minishiftVersionProps == null ) { return "Unknown error when checking minishift version: " + homeDir; } else if( !minishiftVersionProps.isValid()) { String err = minishiftVersionProps.getError(); if( err == null ) { err = "Unknown error while checking minishift version"; } return err; } else { String versionCompatError = isVersionCompatible(minishiftVersionProps); if( versionCompatError != null ) return versionCompatError; } return null; }

Target:
protected String findError() { if( credentials.getDomain() == null || credentials.getUser() == null) { return "The Container Development Environment Server Adapter requires Red Hat Access credentials."; } if( selectedHypervisor == null ) { return "You must choose a hypervisor."; } String retString = validateHomeDirectory(); if( retString != null ) return retString; return validateMinishiftVersion(); }
Source:
public void cancelFutures() { IgniteCheckedException err = new IgniteCheckedException("Failed to wait for topology update, cache (or node) is stopping."); if (aff != null) { aff.cancelFutures(err); } }

Target:
public void cancelFutures() { if (!starting.get()) return; IgniteCheckedException err = new IgniteCheckedException("Failed to wait for topology update, cache (or node) is stopping."); if (aff != null) aff.cancelFutures(err); }
Source:
private Collection<Ref> getAllRefs() throws IOException { RefDatabase refdb = repo.getRefDatabase(); Collection<Ref> refs = refdb.getRefs(RefDatabase.ALL).values(); List<Ref> addl = refdb.getAdditionalRefs(); if (!addl.isEmpty()) { List<Ref> all = new ArrayList<>(refs.size() + addl.size()); all.addAll(refs); for (Ref r : addl) { if (r.getName().startsWith(Constants.R_REFS)) all.add(r); } return all; } return refs; }

Target:
private Collection<Ref> getAllRefs() throws IOException { RefDatabase refdb = repo.getRefDatabase(); Collection<Ref> refs = refdb.getRefs(RefDatabase.ALL).values(); List<Ref> addl = refdb.getAdditionalRefs(); if (!addl.isEmpty()) { List<Ref> all = new ArrayList<>(refs.size() + addl.size()); all.addAll(refs); for (Ref r : addl) { if (r.getName().startsWith(Constants.R_REFS)) { all.add(r); } } return all; } return refs; }
Source:
public void validate() { takeOfflineBuilder.validate(); stateTransferBuilder.validate(); if (site == null) throw new CacheConfigurationException("The 'site' must be specified!"); if (backupFailurePolicy == BackupFailurePolicy.CUSTOM && (failurePolicyClass == null)) { throw new CacheConfigurationException("It is required to specify a 'failurePolicyClass' when using a " + "custom backup failure policy!"); } if (useTwoPhaseCommit && strategy == BackupConfiguration.BackupStrategy.ASYNC) { throw new CacheConfigurationException("'two-phase-commit' can be used only with SYNC backup strategy!"); } }

Target:
public void validate() { takeOfflineBuilder.validate(); stateTransferBuilder.validate(); if (site == null) throw log.backupSiteNullName(); if (backupFailurePolicy == BackupFailurePolicy.CUSTOM && (failurePolicyClass == null)) { throw log.customBackupFailurePolicyClassNotSpecified(); } if (useTwoPhaseCommit && strategy == BackupConfiguration.BackupStrategy.ASYNC) { throw log.twoPhaseCommitAsyncBackup(); } }
Source:
private static Options buildOptions() { final Options options = buildOptionsExcludeHidden(); options.addOption(OPTION_CAPITAL_C_NAME, OPTION_CHECKER_THREADS_NUMBER_NAME, true, "The number of Checker threads (must be greater than zero)"); options.addOption(OPTION_CAPITAL_W_NAME, OPTION_TREE_WALKER_THREADS_NUMBER_NAME, true, "The number of TreeWalker threads (must be greater than zero)"); return options; }

Target:
private static Options buildOptions() { final Options options = new Options(); options.addOption(OPTION_C_NAME, true, "Sets the check configuration file to use."); options.addOption(OPTION_O_NAME, true, "Sets the output file. Defaults to stdout"); options.addOption(OPTION_P_NAME, true, "Loads the properties file"); options.addOption(OPTION_F_NAME, true, String.format( "Sets the output format. (%s|%s). Defaults to %s", PLAIN_FORMAT_NAME, XML_FORMAT_NAME, PLAIN_FORMAT_NAME)); options.addOption(OPTION_V_NAME, false, "Print product version and exit"); options.addOption(OPTION_T_NAME, OPTION_TREE_NAME, false, "Print Abstract Syntax Tree(AST) of the file"); options.addOption(OPTION_CAPITAL_T_NAME, OPTION_TREE_COMMENT_NAME, false, "Print Abstract Syntax Tree(AST) of the file including comments"); options.addOption(OPTION_J_NAME, OPTION_JAVADOC_TREE_NAME, false, "Print Parse tree of the Javadoc comment"); options.addOption(OPTION_CAPITAL_J_NAME, OPTION_TREE_JAVADOC_NAME, false, "Print full Abstract Syntax Tree of the file"); options.addOption(OPTION_D_NAME, OPTION_DEBUG_NAME, false, "Print all debug logging of CheckStyle utility"); options.addOption(OPTION_E_NAME, OPTION_EXCLUDE_NAME, true, "Directory path to exclude from CheckStyle"); options.addOption(OPTION_X_NAME, OPTION_EXCLUDE_REGEXP_NAME, true, "Regular expression of directory to exclude from CheckStyle"); options.addOption(OPTION_EXECUTE_IGNORED_MODULES_NAME, false, "Allows ignored modules to be run."); options.addOption(OPTION_CAPITAL_C_NAME, OPTION_CHECKER_THREADS_NUMBER_NAME, true, "(experimental) The number of Checker threads (must be greater than zero)"); options.addOption(OPTION_CAPITAL_W_NAME, OPTION_TREE_WALKER_THREADS_NUMBER_NAME, true, "(experimental) The number of TreeWalker threads (must be greater than zero)"); return options; }
Source:
@Override public void process(Bitmap destBitmap, Bitmap sourceBitmap) { if (listener.get() == null) { return; } if (isBitmapEligibleForImageProcessing(sourceBitmap)) { copyWithWhiteBackground(destBitmap, sourceBitmap); Observable.fromCallable(() -> new565ScaledBitmap(sourceBitmap)) .subscribeOn(Schedulers.io()) .subscribe(scaledBmp -> { Palette colorPalette = Palette.from(scaledBmp).generate(); PointF facePos = detectFace(scaledBmp); int defaultColor = ContextCompat.getColor(WikipediaApp.getInstance(), R.color.base30); listener.get().onImageLoaded(destBitmap.getHeight(), facePos, extractMainColor(colorPalette, defaultColor)); }, L::d); } else { listener.get().onImageFailed(); } }

Target:
@Override public void process(Bitmap destBitmap, Bitmap sourceBitmap) { if (listener.get() == null) { return; } if (isBitmapEligibleForImageProcessing(sourceBitmap)) { copyWithWhiteBackground(destBitmap, sourceBitmap); Bitmap testBmp = new565ScaledBitmap(sourceBitmap); Palette colorPalette = Palette.from(testBmp).generate(); PointF facePos = null; try { facePos = detectFace(testBmp); } catch (OutOfMemoryError e) { L.logRemoteErrorIfProd(e); } int defaultColor = ContextCompat.getColor(WikipediaApp.getInstance(), R.color.base30); listener.get().onImageLoaded(destBitmap.getHeight(), facePos, extractMainColor(colorPalette, defaultColor)); } else { listener.get().onImageFailed(); } }
Source:
@Override public boolean canHandleRequest(@NonNull Request data) { Uri uri = data.uri; if (uri == null) return false; return SCHEME_FILE.equals(uri.getScheme()); }

Target:
@Override public boolean canHandleRequest(@NonNull Request data) { Uri uri = data.uri; return uri != null && SCHEME_FILE.equals(uri.getScheme()); }
Source:
public void start(Promise<Void> promise) { server = vertx.createNetServer(getServerOptions()); server.connectHandler(getServerHandler()); server.listen(s -> { if (s.succeeded()) { int serverPort = getClusterPublicPort(options, server.actualPort()); String serverHost = getClusterPublicHost(options); nodeInfo = new NodeInfo(serverHost, serverPort, options.getNodeMetadata()); nodeId = clusterManager.getNodeId(); Promise<Void> setPromise = Promise.promise(); setPromise.future().onComplete(ar -> { if (ar.succeeded()) { started = true; deliveryStrategy.init(vertx); promise.complete(); } else { promise.fail(ar.cause()); } }); clusterManager.setNodeInfo(nodeInfo, setPromise); } else { promise.fail(s.cause()); } }); }

Target:
public void start(Promise<Void> promise) { server = vertx.createNetServer(getServerOptions()); server.connectHandler(getServerHandler()); server.listen().flatMap(v -> { int serverPort = getClusterPublicPort(options, server.actualPort()); String serverHost = getClusterPublicHost(options); nodeInfo = new NodeInfo(serverHost, serverPort, options.getClusterNodeMetadata()); nodeId = clusterManager.getNodeId(); Promise<Void> setPromise = Promise.promise(); clusterManager.setNodeInfo(nodeInfo, setPromise); return setPromise.future(); }).onSuccess(v -> { started = true; nodeSelector.init(vertx); }).onComplete(promise); }
Source:
private List<ActivityLogEntry> searchLogsWithTimeIncrement(AdminActivityLogPageData data) { List<ActivityLogEntry> appLogs = new LinkedList<ActivityLogEntry>(); int numberOfSearchTimes = 0; totalLogsSearched = 0; while ((numberOfSearchTimes < MAX_SEARCH_TIMES) && (appLogs.size() < RELEVANT_LOGS_PER_PAGE)) { long nextTwoHour = data.getToDate() - SEARCH_TIME_INCREMENT; data.setFromDate(nextTwoHour); numberOfSearchTimes++; LogQuery query = buildQuery(data); List<ActivityLogEntry> searchResult = searchLogsByQuery(query, data); if (!searchResult.isEmpty()) { appLogs.addAll(searchResult); } data.setToDate(data.getFromDate()); } return appLogs; }

Target:
private List<ActivityLogEntry> searchLogsWithTimeIncrement(AdminActivityLogPageData data) { List<ActivityLogEntry> appLogs = new LinkedList<ActivityLogEntry>(); int numberOfSearchTimes = 0; totalLogsSearched = 0; while ((numberOfSearchTimes < MAX_SEARCH_TIMES) && (appLogs.size() < RELEVANT_LOGS_PER_PAGE)) { long nextTwoHour = data.getToDate() - SEARCH_TIME_INCREMENT; data.setFromDate(nextTwoHour); numberOfSearchTimes++; LogQuery query = buildQuery(data); List<ActivityLogEntry> searchResult = searchLogsByQuery(query, data); if (!searchResult.isEmpty()) { appLogs.addAll(searchResult); } data.setToDate(data.getFromDate() + 1); } return appLogs; }
Source:
private void removeFromTable(Slot e) { int tableIdx = hash(e.offset); Slot p = table[tableIdx]; if (p == e) { table[tableIdx] = e.tableNext; return; } for (; p != null; p = p.tableNext) { if (p.tableNext == e) { p.tableNext = e.tableNext; return; } } }

Target:
private void removeFromTable(Slot e) { int tableIdx = hash(e.offset); Slot p = table[tableIdx]; if (p == e) { table[tableIdx] = e.tableNext; return; } for (; p != null; p = p.tableNext) { if (p.tableNext == e) { p.tableNext = e.tableNext; return; } } throw new IllegalStateException(String.format( "entry for %s:%d not in table", e.pack, Long.valueOf(e.offset))); }
Source:
public CheckpointManager( String topologyName, String topologyId, String checkpointMgrId, String serverHost, int serverPort, SystemConfig systemConfig, CheckpointManagerConfig checkpointManagerConfig) throws IOException { this.checkpointManagerServerLoop = new NIOLooper(); HeronSocketOptions serverSocketOptions = new HeronSocketOptions(32768, 16, 32768, 16, 655360, 655360); IBackend checkpointsBackend; String classname = (String) checkpointManagerConfig.get(CheckpointManagerConfig.CONFIG_KEY_CLASSNAME); try { checkpointsBackend = (IBackend) Class.forName(classname).newInstance(); } catch (InstantiationException e) { throw new RuntimeException(e + " class must have a no-arg constructor."); } catch (IllegalAccessException e) { throw new RuntimeException(e + " class must be concrete."); } catch (ClassNotFoundException e) { throw new RuntimeException(e + " class must be a class path."); } checkpointsBackend.init( Collections.unmodifiableMap(checkpointManagerConfig.getBackendConfig())); this.checkpointManagerServer = new CheckpointManagerServer( topologyName, topologyId, checkpointMgrId, checkpointsBackend, checkpointManagerServerLoop, serverHost, serverPort, serverSocketOptions); }

Target:
public CheckpointManager( String topologyName, String topologyId, String checkpointMgrId, String serverHost, int serverPort, SystemConfig systemConfig, CheckpointManagerConfig checkpointManagerConfig) throws IOException, CheckpointManagerException { this.checkpointManagerServerLoop = new NIOLooper(); HeronSocketOptions serverSocketOptions = new HeronSocketOptions( checkpointManagerConfig.getWriteBatchSizeBytes(), checkpointManagerConfig.getWriteBatchTimeMs(), checkpointManagerConfig.getReadBatchSizeBytes(), checkpointManagerConfig.getReadBatchTimeMs(), checkpointManagerConfig.getSocketSendSize(), checkpointManagerConfig.getSocketReceiveSize()); IStatefulStorage statefulStorage; String classname = checkpointManagerConfig.getStorageClassname(); try { statefulStorage = (IStatefulStorage) Class.forName(classname).newInstance(); } catch (InstantiationException e) { throw new CheckpointManagerException(classname + " class must have a no-arg constructor.", e); } catch (IllegalAccessException e) { throw new CheckpointManagerException(classname + " class must be concrete.", e); } catch (ClassNotFoundException e) { throw new CheckpointManagerException(classname + " class must be a class path.", e); } try { statefulStorage.init( Collections.unmodifiableMap(checkpointManagerConfig.getStatefulStorageConfig())); } catch (StatefulStorageException e) { throw new CheckpointManagerException(classname + " init threw exception", e); } this.checkpointManagerServer = new CheckpointManagerServer( topologyName, topologyId, checkpointMgrId, statefulStorage, checkpointManagerServerLoop, serverHost, serverPort, serverSocketOptions); }
Source:
private void runOpenmrsServiceOnStartup(final OpenmrsService openmrsService, final String classString) { new Thread() { @Override public void run() { try { synchronized (refreshingContextLock) { refreshingContextLock.wait(); } Daemon.runStartupForService(openmrsService); } catch (InterruptedException e) { log.warn("Refresh lock was interrupted while waiting to run OpenmrsService.onStartup() for " + classString, e); } } }.start(); }

Target:
private void runOpenmrsServiceOnStartup(final OpenmrsService openmrsService, final String classString) { new Thread() { @Override public void run() { try { synchronized (contextRefreshedLock) { while (!contextRefreshedCheck) { contextRefreshedLock.wait(); } } Daemon.runStartupForService(openmrsService); } catch (InterruptedException e) { log.warn("Refresh lock was interrupted while waiting to run OpenmrsService.onStartup() for " + classString, e); } } }.start(); }
Source:
public synchronized void handleCompletedBatch(ProducerBatch batch, ProduceResponse.PartitionResponse response) { maybeUpdateLastAckedSequence(batch.topicPartition, batch.baseSequence() + batch.recordCount - 1); log.debug("ProducerId: {}; Set last ack'd sequence number for topic-partition to {}", batch.producerId(), batch.topicPartition, lastAckedSequence(batch.topicPartition).orElse(-1)); updateLastAckedOffset(response, batch); removeInFlightBatch(batch); if (!hasProducerIdAndEpoch(batch) && !hasInflightBatches(batch.topicPartition)) { topicPartitionBookkeeper.startSequencesAtBeginning(batch.topicPartition, this.producerIdAndEpoch); } }

Target:
public synchronized void handleCompletedBatch(ProducerBatch batch, ProduceResponse.PartitionResponse response) { int lastAckedSequence = maybeUpdateLastAckedSequence(batch.topicPartition, batch.lastSequence()); log.debug("ProducerId: {}; Set last ack'd sequence number for topic-partition to {}", batch.producerId(), batch.topicPartition, lastAckedSequence); updateLastAckedOffset(response, batch); removeInFlightBatch(batch); if (!matchesProducerIdAndEpoch(batch) && !hasInflightBatches(batch.topicPartition)) { topicPartitionBookkeeper.startSequencesAtBeginning(batch.topicPartition, this.producerIdAndEpoch); } }
Source:
public InterpreterResult interpret(String cypherQuery, InterpreterContext interpreterContext) { logger.info("Opening session"); if (StringUtils.isEmpty(cypherQuery)) { return new InterpreterResult(Code.ERROR, "Cypher query is Empty"); } try (Session session = getDriver().session()){ StatementResult result = execute(session, cypherQuery, interpreterContext); Set<String> cols = new HashSet<>(); List<List<String>> lines = new ArrayList<>(); Set<Node> nodes = new HashSet<>(); Set<Relationship> relationships = new HashSet<>(); while (result.hasNext()) { Record record = result.next(); if (cols.isEmpty()) { cols.addAll(record.keys()); } List<String> line = new ArrayList<>(); for (String col : cols) { Object value = record.get(col); setResultValue(value, nodes, relationships, line); } if (!line.isEmpty()) { lines.add(line); } } if (!nodes.isEmpty()) { return renderGraph(nodes, relationships); } else { return renderTable(cols, lines); } } catch (Exception e) { return new InterpreterResult(Code.ERROR, e.getMessage()); } }

Target:
public InterpreterResult interpret(String cypherQuery, InterpreterContext interpreterContext) { logger.info("Opening session"); if (StringUtils.isEmpty(cypherQuery)) { return new InterpreterResult(Code.ERROR, "Cypher query is Empty"); } try (Session session = getDriver().session()){ StatementResult result = execute(session, cypherQuery, interpreterContext); Set<String> cols = new HashSet<>(); List<List<String>> lines = new ArrayList<>(); Set<Node> nodes = new HashSet<>(); Set<Relationship> relationships = new HashSet<>(); while (result.hasNext()) { Record record = result.next(); if (cols.isEmpty()) { cols.addAll(record.keys()); } List<String> line = new ArrayList<>(); for (String col : cols) { Object value = record.get(col); setResultValue(value, nodes, relationships, line); } if (!line.isEmpty()) { lines.add(line); } } if (!nodes.isEmpty()) { return renderGraph(nodes, relationships); } else { return renderTable(cols, lines); } } catch (Exception e) { logger.error("Exception while interpreting cypher query", e); return new InterpreterResult(Code.ERROR, e.getMessage()); } }
Source:
public O compute2(final I input, final Dimensions paddedDimensions) { Dimensions paddedFFTMethodsInputDimensions = FFTMethodsUtility .getPaddedInputDimensionsRealToComplex(fast, paddedDimensions); if (obf == null) { obf = new OutOfBoundsConstantValueFactory<T, RandomAccessibleInterval<T>>( Util.getTypeFromInterval(input).createVariable()); } Interval inputInterval = ops().filter().paddingIntervalCentered(input, paddedFFTMethodsInputDimensions); return (O) Views.interval(Views.extend(input, obf), inputInterval); }

Target:
public O compute2(final I input, final Dimensions paddedDimensions) { Dimensions paddedFFTMethodsInputDimensions = FFTMethodsUtility .getPaddedInputDimensionsRealToComplex(fast, paddedDimensions); if (obf == null) { obf = new OutOfBoundsConstantValueFactory<T, RandomAccessibleInterval<T>>( Util.getTypeFromInterval(input).createVariable()); } Interval inputInterval = paddingIntervalCentered.compute2(input, paddedFFTMethodsInputDimensions); return (O) Views.interval(Views.extend(input, obf), inputInterval); }
Source:
private ResourceIterator<Node> nodesByLabelAndProperty( Label myLabel, String key, Value value ) { KernelTransaction transaction = statementContext.getKernelTransactionBoundToThisThread( true ); Statement statement = transaction.acquireStatement(); Read read = transaction.dataRead(); TokenRead tokenRead = transaction.tokenRead(); int propertyId = tokenRead.propertyKey( key ); int labelId = tokenRead.labelGetForName( myLabel.name() ); if ( propertyId == NO_SUCH_PROPERTY_KEY || labelId == NO_SUCH_LABEL ) { statement.close(); return emptyResourceIterator(); } CapableIndexReference index = transaction.schemaRead().index( labelId, propertyId ); if ( index != CapableIndexReference.NO_INDEX ) { try { NodeValueIndexCursor cursor = transaction.cursors().allocateNodeValueIndexCursor(); IndexQuery.ExactPredicate query = IndexQuery.exact( propertyId, value ); read.nodeIndexSeek( index, cursor, IndexOrder.NONE, query ); return new PrefetchingResourceIterator<Node>() { private boolean closed; @Override protected Node fetchNextOrNull() { if ( cursor.next() ) { return newNodeProxy( cursor.nodeReference() ); } else { close(); return null; } } @Override public void close() { if ( !closed ) { statement.close(); cursor.close(); closed = true; } } }; } catch ( KernelException e ) { } } return getNodesByLabelAndPropertyWithoutIndex( propertyId, value, statement, labelId ); }

Target:
private ResourceIterator<Node> nodesByLabelAndProperty( Label myLabel, String key, Value value ) { KernelTransaction transaction = statementContext.getKernelTransactionBoundToThisThread( true ); Statement statement = transaction.acquireStatement(); Read read = transaction.dataRead(); TokenRead tokenRead = transaction.tokenRead(); int propertyId = tokenRead.propertyKey( key ); int labelId = tokenRead.nodeLabel( myLabel.name() ); if ( propertyId == NO_SUCH_PROPERTY_KEY || labelId == NO_SUCH_LABEL ) { statement.close(); return emptyResourceIterator(); } CapableIndexReference index = transaction.schemaRead().index( labelId, propertyId ); if ( index != CapableIndexReference.NO_INDEX ) { try { NodeValueIndexCursor cursor = transaction.cursors().allocateNodeValueIndexCursor(); IndexQuery.ExactPredicate query = IndexQuery.exact( propertyId, value ); read.nodeIndexSeek( index, cursor, IndexOrder.NONE, query ); return new NodeCursorResourceIterator<>( cursor, statement ); } catch ( KernelException e ) { } } return getNodesByLabelAndPropertyWithoutIndex( propertyId, value, statement, labelId ); }
Source:
private static Type getInt32Type(RichColumnDescriptor descriptor) { OriginalType originalType = descriptor.getPrimitiveType().getOriginalType(); if (originalType == null) { return IntegerType.INTEGER; } switch (originalType) { case DECIMAL: return createDecimalType(descriptor.getPrimitiveType().getDecimalMetadata()); case DATE: return DateType.DATE; default: return IntegerType.INTEGER; } }

Target:
private static Type getInt32Type(RichColumnDescriptor descriptor) { OriginalType originalType = descriptor.getPrimitiveType().getOriginalType(); if (originalType == null) { return INTEGER; } switch (originalType) { case DECIMAL: return createDecimalType(descriptor.getPrimitiveType().getDecimalMetadata()); case DATE: return DateType.DATE; default: return INTEGER; } }
Source:
public synchronized void correlate(final Event e) { if (m_kieSession == null) { LOG.info("No valid session"); return; } LOG.debug("Begin correlation for Event uei: {}", e.getDbid(), e.getUei()); m_kieSession.insert(e); try { if (!m_isStreaming) m_kieSession.fireAllRules(); } catch (Exception e1) { LOG.error("Exception while firing rules ", e1); } m_eventsMeter.mark(); LOG.debug("End correlation for Event uei: {}", e.getDbid(), e.getUei()); }

Target:
public synchronized void correlate(final Event e) { if (m_kieSession == null) { LOG.info("No valid session, Event with id: and UEI: will not be added as a fact.", e.getDbid(), e.getUei()); return; } LOG.debug("Begin correlation for Event uei: {}", e.getDbid(), e.getUei()); m_kieSession.insert(e); try { if (!m_isStreaming) m_kieSession.fireAllRules(); } catch (Exception e1) { LOG.error("Exception while firing rules ", e1); } m_eventsMeter.mark(); LOG.debug("End correlation for Event uei: {}", e.getDbid(), e.getUei()); }
Source:
public static Constraint getViewConstraint(Element view) { if (view != null) { Collection<Constraint> constraints = view.get_constraintOfConstrainedElement(); for (Constraint constraint : constraints) { if (constraint != null && Converters.getElementToIdConverter().apply(constraint).endsWith(("_vc"))) { return constraint; } } } return null; }

Target:
public static Constraint getViewConstraint(Element view) { if (view != null) { Collection<Constraint> constraints = view.get_constraintOfConstrainedElement(); for (Constraint constraint : constraints) { if (constraint != null && Converters.getElementToIdConverter().apply(constraint).endsWith((MDKConstants.VIEW_CONSTRAINT_SYSML_ID_SUFFIX))) { return constraint; } } } return null; }
Source:
public CheckpointMetrics build() { checkState(alignmentDurationNanos.isDone()); return new CheckpointMetrics( FutureUtils.getWithoutException(alignmentDurationNanos), syncDurationMillis, asyncDurationMillis, checkpointStartDelayNanos); }

Target:
public CheckpointMetrics build() { return new CheckpointMetrics( checkStateAndGet(bytesProcessedDuringAlignment), bytesPersistedDuringAlignment, checkStateAndGet(alignmentDurationNanos), syncDurationMillis, asyncDurationMillis, checkpointStartDelayNanos); }
Source:
public String postStep(HTTPRequest request) { double GBPerMonth; long bytesPerMonth; String capTo = request.getPartAsStringFailsafe("capTo", 4096); StringBuilder target = new StringBuilder(FirstTimeWizardToadlet.WIZARD_STEP.BANDWIDTH_MONTHLY.name()).append("&parseTarget="); try { GBPerMonth = Double.valueOf(capTo); bytesPerMonth = Math.round(GBPerMonth * GB); } catch (NumberFormatException e) { target.append(URLEncoder.encode(capTo, true)); target.append("&parseError=true"); return target.toString(); } double bytesPerSecond = bytesPerMonth/secondsPerMonth; double minBytesPerSecond = Node.getMinimumBandwidth(); double bwinc = bytesPerSecond - 2*minBytesPerSecond; double dllimit = minBytesPerSecond + (bwinc * ((4./5.))); double ullimit = minBytesPerSecond + (bwinc / 5.); String downloadLimit = String.valueOf(Math.ceil(dllimit)); String uploadLimit = String.valueOf(Math.ceil(ullimit)); try { setBandwidthLimit(downloadLimit, false); setBandwidthLimit(uploadLimit, true); } catch (InvalidConfigValueException e) { target.append(URLEncoder.encode(String.valueOf(GBPerMonth), true)); target.append("&tooLow=true"); return target.toString(); } setWizardComplete(); return FirstTimeWizardToadlet.WIZARD_STEP.COMPLETE.name(); }

Target:
public String postStep(HTTPRequest request) { double GBPerMonth; long bytesPerMonth; String capTo = request.getPartAsStringFailsafe("capTo", 4096); StringBuilder target = new StringBuilder(FirstTimeWizardToadlet.WIZARD_STEP.BANDWIDTH_MONTHLY.name()).append("&parseTarget="); try { GBPerMonth = Double.valueOf(capTo); bytesPerMonth = Math.round(GBPerMonth * GB); } catch (NumberFormatException e) { target.append(URLEncoder.encode(capTo, true)); target.append("&parseError=true"); return target.toString(); } double bytesPerSecond = bytesPerMonth/secondsPerMonth; double minBytesPerSecond = Node.getMinimumBandwidth(); double bwinc = bytesPerSecond - 2*minBytesPerSecond; double asymptoticDlFraction = 4. / 5.; double dllimit = minBytesPerSecond + (bwinc * asymptoticDlFraction); double ullimit = minBytesPerSecond + (bwinc * (1 - asymptoticDlFraction)); String downloadLimit = String.valueOf(Math.ceil(dllimit)); String uploadLimit = String.valueOf(Math.ceil(ullimit)); try { setBandwidthLimit(downloadLimit, false); setBandwidthLimit(uploadLimit, true); } catch (InvalidConfigValueException e) { target.append(URLEncoder.encode(String.valueOf(GBPerMonth), true)); target.append("&tooLow=true"); return target.toString(); } setWizardComplete(); return FirstTimeWizardToadlet.WIZARD_STEP.COMPLETE.name(); }
Source:
public String getDetailedPeerState() { return getPeerState().toString().toLowerCase() + ((getZabState() != ZabState.ELECTION) ? " - " + getZabState().toString().toLowerCase() : "") + ((getSyncMode() != SyncMode.NONE) ? " - " + getSyncMode().toString().toLowerCase() : ""); }

Target:
public String getDetailedPeerState() { final StringBuilder sb = new StringBuilder(getPeerState().toString().toLowerCase()); final ZabState zabState = getZabState(); if (!ZabState.ELECTION.equals(zabState)) { sb.append(" - ").append(zabState.toString().toLowerCase()); } final SyncMode syncMode = getSyncMode(); if (!SyncMode.NONE.equals(syncMode)) { sb.append(" - ").append(syncMode.toString().toLowerCase()); } return sb.toString(); }
Source:
private void guaranteeSameVPC(TargetGroup targetGroup, Collection<BaragonAgentMetadata> agents, Collection<LoadBalancer> loadBalancers) { String vpcId = targetGroup.getVpcId(); for (BaragonAgentMetadata agent : agents) { if (agent.getEc2().getVpcId().isPresent()) { if (! agent.getEc2().getVpcId().get().equals(vpcId)) { LOG.warn("Agent not on same VPC as its target group {}", agent, targetGroup); } } else { LOG.warn("Agent not assigned to a VPC", agent); } } for (LoadBalancer loadBalancer : loadBalancers) { if (!vpcId.equals(loadBalancer.getVpcId())) { LOG.warn("Load balancer on different VPC from target group {}", loadBalancer, targetGroup); } } }

Target:
private void guaranteeSameVPC(TargetGroup targetGroup, Collection<BaragonAgentMetadata> agents, Collection<LoadBalancer> loadBalancers) { String vpcId = targetGroup.getVpcId(); for (BaragonAgentMetadata agent : agents) { if (agent.getEc2().getVpcId().isPresent()) { if (! agent.getEc2().getVpcId().get().equals(vpcId)) { LOG.error("Agent not on same VPC as its target group {}", agent, targetGroup); throw new IllegalStateException(String.format("Agent %s not on same VPC as its target group %s", agent, targetGroup)); } } else { LOG.error("Agent not assigned to a VPC", agent); throw new IllegalStateException(String.format("Agent %s not assigned to a VPC", agent)); } } for (LoadBalancer loadBalancer : loadBalancers) { if (!vpcId.equals(loadBalancer.getVpcId())) { LOG.error("Load balancer on different VPC from target group {}", loadBalancer, targetGroup); throw new IllegalStateException(String.format("Load balancer %s on different VPC from target group %s", loadBalancer, targetGroup)); } } }
Source:
MessageActionDto handleAction_Process(UserDto actingUser, BuddyConnectResponseMessage connectResponseMessageEntity, MessageActionDto payload) { if (connectResponseMessageEntity.getStatus() == Status.REJECTED) { buddyService.removeBuddyAfterConnectRejection(actingUser.getId(), connectResponseMessageEntity.getBuddyId()); } else { buddyService.setBuddyAcceptedWithSecretUserInfo(connectResponseMessageEntity.getBuddyId(), connectResponseMessageEntity.getRelatedUserAnonymizedId().get(), connectResponseMessageEntity.getSenderNickname()); } UserDto actingUserAfterUpdate = userService.getPrivateUser(actingUser.getId()); connectResponseMessageEntity = updateMessageStatusAsProcessed(connectResponseMessageEntity); Optional<User> senderUser = connectResponseMessageEntity.getSenderUser(); String mobileNumber = senderUser.map(User::getMobileNumber).orElse("already deleted"); String id = senderUser.map(u -> u.getId().toString()).orElse("already deleted"); logger.info( "User with mobile number '{}' and ID '{}' processed buddy connect response from user with mobile number '{}' and ID '{}'", actingUser.getMobileNumber(), actingUser.getId(), mobileNumber, id); return MessageActionDto .createInstanceActionDone(theDtoFactory.createInstance(actingUserAfterUpdate, connectResponseMessageEntity)); }

Target:
MessageActionDto handleAction_Process(UserDto actingUser, BuddyConnectResponseMessage connectResponseMessageEntity, MessageActionDto payload) { if (connectResponseMessageEntity.getStatus() == Status.REJECTED) { buddyService.removeBuddyAfterConnectRejection(actingUser.getId(), connectResponseMessageEntity.getBuddyId()); } else { buddyService.setBuddyAcceptedWithSecretUserInfo(connectResponseMessageEntity.getBuddyId(), connectResponseMessageEntity.getRelatedUserAnonymizedId().get(), connectResponseMessageEntity.getSenderNickname()); } actingUser = userService.getPrivateUser(actingUser.getId()); connectResponseMessageEntity = updateMessageStatusAsProcessed(connectResponseMessageEntity); logHandledAction_Process(actingUser, connectResponseMessageEntity); return MessageActionDto .createInstanceActionDone(theDtoFactory.createInstance(actingUser, connectResponseMessageEntity)); }
Source:
public BinaryRelation binaryRelation() { switch (kind) { case EQUAL: return new EqualRelation(leftOp, rightOp); case NOT_EQUAL: return new NotEqualRelation(leftOp, rightOp); case LESS_THAN: return new LessThanRelation(leftOp, rightOp); case LESS_THAN_OR_EQUAL: return new LessThanOrEqualRelation(leftOp, rightOp); case GREATER_THAN: return new GreaterThanRelation(leftOp, rightOp); case GREATER_THAN_OR_EQUAL: return new GreaterThanOrEqualRelation(leftOp, rightOp); case METHOD_EQUALS: return new MethodEqualsRelation(leftOp, rightOp); case NOT_METHOD_EQUALS: return new NotMethodEqualsRelation(leftOp, rightOp); default: throw new IllegalStateException("In case someone adds an element to the enum...!"); } }

Target:
public BinaryRelation binaryRelation() { BinaryRelation relation; switch (kind) { case EQUAL: relation = new EqualRelation(leftOp, rightOp); break; case NOT_EQUAL: relation = new NotEqualRelation(leftOp, rightOp); break; case LESS_THAN: relation = new LessThanRelation(leftOp, rightOp); break; case LESS_THAN_OR_EQUAL: relation = new LessThanOrEqualRelation(leftOp, rightOp); break; case GREATER_THAN: relation = new GreaterThanRelation(leftOp, rightOp); break; case GREATER_THAN_OR_EQUAL: relation = new GreaterThanOrEqualRelation(leftOp, rightOp); break; case METHOD_EQUALS: relation = new MethodEqualsRelation(leftOp, rightOp); break; case NOT_METHOD_EQUALS: relation = new NotMethodEqualsRelation(leftOp, rightOp); break; default: throw new IllegalStateException("Creation of relation of kind " + kind + " is missing!"); } return relation; }
Source:
public void removeSegment(String segmentName) { super.removeSegment(segmentName); try { loadLookupTable(); _logger.info("Successfully removed segment and reloaded lookup table for {}", getTableName()); } catch (Exception e) { _logger.error("Error reloading lookup table after segment remove for table {}", getTableName()); } }

Target:
public void removeSegment(String segmentName) { super.removeSegment(segmentName); try { loadLookupTable(); _logger.info("Successfully removed segment and reloaded lookup table: {}", segmentName, getTableName()); } catch (Exception e) { throw new RuntimeException(String .format("Error reloading lookup table after segment remove ({}) for table: {}", segmentName, getTableName()), e); } }
Source:
public List<PlotPoint> loadSeries(FilePath workspaceRootDir, int buildNumber, PrintStream logger) { List<PlotPoint> ret = null; FilePath[] seriesFiles; try { seriesFiles = workspaceRootDir.list(getFile()); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Exception trying to retrieve series files", e); return null; } if (ArrayUtils.isEmpty(seriesFiles)) { LOGGER.info("No plot data file found: " + workspaceRootDir.getName() + " " + getFile()); return null; } for (int index = 0; index < seriesFiles.length; index++) { List<PlotPoint> seriesList = loadSeriesFile(seriesFiles[index], buildNumber, logger); if (seriesList != null) { if (ret != null) { ret.addAll(seriesList); } else { ret = seriesList; } } } return ret; }

Target:
public List<PlotPoint> loadSeries(FilePath workspaceRootDir, int buildNumber, PrintStream logger) { List<PlotPoint> ret = null; FilePath[] seriesFiles; try { seriesFiles = workspaceRootDir.list(getFile()); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Exception trying to retrieve series files", e); return null; } if (ArrayUtils.isEmpty(seriesFiles)) { LOGGER.info("No plot data file found: " + workspaceRootDir.getName() + " " + getFile()); return null; } for (FilePath seriesFile : seriesFiles) { List<PlotPoint> seriesList = loadSeriesFile(seriesFile, buildNumber); if (seriesList != null) { if (ret != null) { ret.addAll(seriesList); } else { ret = seriesList; } } } return ret; }
Source:
private static List<DimensionSpec> makeFieldsFromFieldNames(List<String> fieldNames) { return Lists.transform( fieldNames, new Function<String, DimensionSpec>() { @Override public DimensionSpec apply(String input) { return new DefaultDimensionSpec(input, input); } } ); }

Target:
private static List<DimensionSpec> makeFieldsFromFieldNames(List<String> fieldNames) { return ImmutableList.copyOf( Lists.transform( fieldNames, new Function<String, DimensionSpec>() { @Override public DimensionSpec apply(String input) { return new DefaultDimensionSpec(input, input); } } ) ); }
Source:
public SWTBotTreeItem collapse() { waitForEnabled(); if (!isExpanded()) { log.warn(MessageFormat.format("Tree item {0} is already collapsed. Won''t collapse it again.", this)); return this; } asyncExec(new VoidResult() { @Override public void run() { widget.setExpanded(false); } }); postCollapseNotify(); return this; }

Target:
public SWTBotTreeItem collapse() { waitForEnabled(); if (!isExpanded()) { log.warn(MessageFormat.format("Tree item {0} is already collapsed. Won''t collapse it again.", this)); return this; } preCollapseNotify(); syncExec(new VoidResult() { @Override public void run() { widget.setExpanded(false); } }); postCollapseNotify(); return this; }
Source:
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) { JsonObject msg = new JsonObject(); msg.put("consumerTag", consumerTag); populate(msg, envelope); if (includeProperties) { put("properties", toJson(properties), msg); } try { msg.put("body", parse(properties, body)); msg.put("deliveryTag", envelope.getDeliveryTag()); this.handlerContext.runOnContext(v -> handler.handle(Future.succeededFuture(msg))); } catch (Exception e) { this.handlerContext.runOnContext(v -> handler.handle(Future.failedFuture(e))); } }

Target:
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { JsonObject msg = new JsonObject(); msg.put("consumerTag", consumerTag); populate(msg, envelope); if (includeProperties) { put("properties", toJson(properties), msg); } try { msg.put("body", parse(properties, body)); msg.put("deliveryTag", envelope.getDeliveryTag()); this.handlerContext.runOnContext(v -> handler.handle(Future.succeededFuture(msg))); } catch (Exception e) { this.handlerContext.runOnContext(v -> handler.handle(Future.failedFuture(e))); } }