auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
StreamChunkParser( @Nullable InputRowParser<ByteBuffer> parser, @Nullable InputFormat inputFormat, InputRowSchema inputRowSchema, TransformSpec transformSpec, File indexingTmpDir ) { if (parser == null && inputFormat == null) { throw new IAE("Either parser or inputFormat shouldn't be set"); } this.parser = parser; this.lazyByteEntityReaderSupplier = Suppliers.memoize(() -> new SettableByteEntityReader( inputFormat, inputRowSchema, transformSpec, indexingTmpDir )); }

Target:
StreamChunkParser( @Nullable InputRowParser<ByteBuffer> parser, @Nullable InputFormat inputFormat, InputRowSchema inputRowSchema, TransformSpec transformSpec, File indexingTmpDir ) { if (parser == null && inputFormat == null) { throw new IAE("Either parser or inputFormat should be set"); } this.parser = parser; if (inputFormat != null) { this.byteEntityReader = new SettableByteEntityReader( inputFormat, inputRowSchema, transformSpec, indexingTmpDir ); } else { this.byteEntityReader = null; } }
Source:
public void onIterationCompleted(final int numCompletedIterations) { LOG.log(Level.INFO, "[Shuffle] {0}th stage : {1} th iteration is completed", new Object[]{stageSequence, numCompletedIterations}); }

Target:
public void onIterationCompleted(final int numCompletedIterations) { LOG.log(Level.INFO, "[Shuffle] {0}-th stage : {1}-th iteration is completed", new Object[]{stageSequence, numCompletedIterations}); }
Source:
public void setProgramGroup(final String programGroup) { setAttribute(PROGRAM_GROUP, programGroup);}

Target:
public void setProgramGroup(final String programGroup) { setAttribute(PROGRAM_GROUP_TAG, programGroup); }
Source:
protected String getAdNetworkId() { return ""; }

Target:
protected String getAdNetworkId() { return zoneId; }
Source:
public ArrayList<TranslationResult> getTranslations( TranscriptionResult result) { ArrayList<TranslationResult> translatedResults = new ArrayList<>(); for(String language : languages.keySet()) { String translatedText = translationService.translate( result.getAlternatives().iterator().next().getTranscription(), result.getLanguage().substring(0,2), language); translatedResults.add(new TranslationResult( result, language, translatedText)); } return translatedResults; }

Target:
private List<TranslationResult> getTranslations( TranscriptionResult result) { ArrayList<TranslationResult> translatedResults = new ArrayList<>(); Set<String> translationLanguages; synchronized (languages) { translationLanguages = languages.keySet(); } Collection<TranscriptionAlternative> alternatives = result.getAlternatives(); if(!alternatives.isEmpty()) { for(String targetLanguage : translationLanguages) { String translatedText = translationService.translate( alternatives.iterator().next().getTranscription(), result.getParticipant().getSourceLanguage(), targetLanguage); translatedResults.add(new TranslationResult( result, targetLanguage, translatedText)); } } return translatedResults; }
Source:
void doAddNewInclude() { final String groupName = addIncludeBox.getText(); if (groupName.length() == 0) { return; } UUID uuid = accountGroupSuggestOracle.getUUID(groupName); addIncludeBox.setEnabled(false); GroupApi.addIncludedGroup(getGroupUUID(), uuid.get(), new GerritCallback<GroupInfo>() { public void onSuccess(final GroupInfo result) { addIncludeBox.setEnabled(true); addIncludeBox.setText(""); includes.insert(result); } @Override public void onFailure(final Throwable caught) { addIncludeBox.setEnabled(true); super.onFailure(caught); } }); }

Target:
void doAddNewInclude() { final String groupName = addIncludeBox.getText(); if (groupName.length() == 0) { return; } AccountGroup.UUID uuid = accountGroupSuggestOracle.getUUID(groupName); addIncludeBox.setEnabled(false); GroupApi.addIncludedGroup(getGroupUUID(), uuid.get(), new GerritCallback<GroupInfo>() { public void onSuccess(final GroupInfo result) { addIncludeBox.setEnabled(true); addIncludeBox.setText(""); includes.insert(result); } @Override public void onFailure(final Throwable caught) { addIncludeBox.setEnabled(true); super.onFailure(caught); } }); }
Source:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String datasource = getRequiredParameter(request, "datasource"); if (config.isCheckDatasource() && !validateDatasource(request, datasource)) { sendForbiddenError(response); return; } String resourceManagerUrl = config.getResourceManagerUrl(datasource); String id = request.getParameter("id"); if (id.startsWith("application_")) { killApplication(response, resourceManagerUrl, id); return; } if (config.isUseJdbcCancel(datasource)) { LOG.info(format("killing %s in %s by Statement#cancel", id, datasource)); try (Statement statement = statements.getStatement(datasource, id)) { if (statement == null) { LOG.error("statement is null"); } else { statement.cancel(); } statements.removeStatement(datasource, id); } catch (SQLException e) { throw new RuntimeException(e); } return; } YarnUtil.getApplication(resourceManagerUrl, id, getUsername(request), config.getResourceManagerBegin(datasource)).ifPresent(application -> { String applicationId = (String) application.get("id"); killApplication(response, resourceManagerUrl, applicationId); }); }

Target:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); if (id == null) { return; } String datasource = getRequiredParameter(request, "datasource"); if (config.isCheckDatasource() && !validateDatasource(request, datasource)) { sendForbiddenError(response); return; } String resourceManagerUrl = config.getResourceManagerUrl(datasource); if (id.startsWith("application_")) { killApplication(response, resourceManagerUrl, id); return; } if (config.isUseJdbcCancel(datasource)) { LOG.info(format("killing %s in %s by Statement#cancel", id, datasource)); try (Statement statement = statements.getStatement(datasource, id)) { if (statement == null) { LOG.error("statement is null"); } else { statement.cancel(); } statements.removeStatement(datasource, id); } catch (SQLException e) { throw new RuntimeException(e); } return; } YarnUtil.getApplication(resourceManagerUrl, id, getUsername(request), config.getResourceManagerBegin(datasource)).ifPresent(application -> { String applicationId = (String) application.get("id"); killApplication(response, resourceManagerUrl, applicationId); }); }
Source:
public String findCPUHost() { List<Hosts> hosts = find(); for(Hosts host: hosts){ if(host.getNumGpus() == 0){ return host.getHostname(); } } return null; }

Target:
public String findCPUHost() { List<Hosts> hosts = find(); for(Hosts host: hosts){ if(host.getNumGpus() == 0 && host.getCondaEnabled()){ return host.getHostname(); } } return null; }
Source:
public static void main(String[] args) throws Exception { while (!makeNodeUpToDate()) { Thread.sleep(5000); } String jarFile = DEFAULT_SCHEDULER_NODE_JAR; if (System.getProperty(NODE_JAR_SAVEAS_PROPERTY) != null) { jarFile = System.getProperty(NODE_JAR_SAVEAS_PROPERTY); } System.out.println("Launching a computing node"); ProcessBuilder pb = generateSubProcess(args, jarFile); final Process p = pb.start(); Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { try { p.destroy(); } catch (Exception e) { } } })); p.waitFor(); }

Target:
public static void main(String[] args) { RMNodeUpdater rmNodeUpdater = new RMNodeUpdater(); rmNodeUpdater.parseCommandLine(args); rmNodeUpdater.updateNodeAndLaunchJVM(args); }
Source:
public void processElement(ProcessContext context) throws ConstraintViolationException { if (converter == null) { AvroRegistry registry = new AvroRegistry(); converter = registry.createIndexedRecordConverter(context.element().getClass()); } IndexedRecord inputRecord = (IndexedRecord) converter.convertToAvro(context.element()); try { if (inputConstraints != null) { inputConstraints.validate(inputRecord, properties); } boolean returnedBooleanValue = true; String columnName = properties.columnName.getValue(); if (!StringUtils.isEmpty(columnName)) { List<Object> inputValues = getInputFields(inputRecord, columnName); if (inputValues.size() == 0) { returnedBooleanValue = false; } for (Object inputValue : inputValues) { returnedBooleanValue = returnedBooleanValue && checkCondition(inputValue, properties); } } if (returnedBooleanValue) { if (hasOutputSchema) { context.output(inputRecord); } } else { if (hasRejectSchema) { context.sideOutput(FilterRowRuntime.rejectOutput, inputRecord); } } } catch (ConstraintViolationException cve) { context.sideOutput(FilterRowRuntime.discardOutput, inputRecord); } }

Target:
public void processElement(ProcessContext context) throws ConstraintViolationException { if (converter == null) { AvroRegistry registry = new AvroRegistry(); converter = registry.createIndexedRecordConverter(context.element().getClass()); } IndexedRecord inputRecord = (IndexedRecord) converter.convertToAvro(context.element()); try { if (inputConstraints != null) { inputConstraints.validate(inputRecord, properties); } boolean returnedBooleanValue = true; String columnName = properties.columnName.getValue(); if (!StringUtils.isEmpty(columnName)) { List<Object> inputValues = getInputFields(inputRecord, columnName); if (inputValues.size() == 0) { returnedBooleanValue = false; } for (Object inputValue : inputValues) { returnedBooleanValue = returnedBooleanValue && checkCondition(inputValue, properties); } } if (returnedBooleanValue) { if (hasOutputSchema) { context.output(inputRecord); } } else { if (hasRejectSchema) { context.sideOutput(FilterRowRuntime.rejectOutput, inputRecord); } } } catch (ConstraintViolationException cve) { if (stopPipelineOnError) { throw cve; } context.sideOutput(FilterRowRuntime.discardOutput, inputRecord); } }
Source:
public void endWithFailure() { updateDiskStatus(ImageStatus.ILLEGAL); }

Target:
public void endWithFailure() { updateDiskStatus(ImageStatus.ILLEGAL); setSucceeded(true); }
Source:
public void run() { String processTitle = null; try { while (index < processes.size()) { final long begin = System.nanoTime(); Process process = processes.get(index++); processTitle = process.getTitle(); setWorkDetail(processTitle); migrationService.migrateMetadata(process); if (logger.isTraceEnabled()) { logger.trace("Migrating took ms", processTitle, TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - begin)); } setProgress(100 * index / processes.size()); if (isInterrupted()) { return; } } setProgress(100); } catch (Throwable thrown) { if (thrown instanceof Error) { throw (Error) thrown; } else { if (thrown instanceof Exception) { Helper.setErrorMessage(thrown.getLocalizedMessage(), processTitle, logger, (Exception) thrown); } super.setException(thrown); } } }

Target:
public void run() { String processTitle = null; try { for (int index = progress; index < processes.size(); index++) { final long begin = System.nanoTime(); Process process = processes.get(index); processTitle = process.getTitle(); setWorkDetail(processTitle); migrationService.migrateMetadata(process); if (logger.isTraceEnabled()) { logger.trace("Migrating took ms", processTitle, TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - begin)); } progress = index + 1; setProgress(100 * progress / processes.size()); if (isInterrupted()) { return; } } setProgress(100); } catch (DAOException exception) { Helper.setErrorMessage(exception.getLocalizedMessage(), processTitle, logger, exception); super.setException(exception); } }
Source:
private void waitingRequestOnError(final CallbackHandler handler, final AuthenticationRequestState waitingRequest, final int requestId, final AuthenticationException exc) { try { if (waitingRequest != null && waitingRequest.getDelegate() != null) { Logger.v(TAG, "Sending error to callback" + mAuthContext.getCorrelationInfoFromWaitingRequest(waitingRequest)); waitingRequest.getAPIEvent().setWasApiCallSuccessful(false); waitingRequest.getAPIEvent().setCorrelationId( waitingRequest.getRequest().getCorrelationId().toString()); waitingRequest.getAPIEvent().stopTelemetryAndFlush(); if (handler != null) { handler.onError(exc); } else { waitingRequest.getDelegate().onError(exc); } } } finally { if (exc != null && exc.getCode() != ADALError.AUTH_FAILED_CANCELLED) { mAuthContext.removeWaitingRequest(requestId); } } }

Target:
private void waitingRequestOnError(final CallbackHandler handler, final AuthenticationRequestState waitingRequest, final int requestId, final AuthenticationException exc) { try { if (waitingRequest != null && waitingRequest.getDelegate() != null) { Logger.v(TAG, "Sending error to callback" + mAuthContext.getCorrelationInfoFromWaitingRequest(waitingRequest)); waitingRequest.getAPIEvent().setWasApiCallSuccessful(false, exc); waitingRequest.getAPIEvent().setCorrelationId( waitingRequest.getRequest().getCorrelationId().toString()); waitingRequest.getAPIEvent().stopTelemetryAndFlush(); if (handler != null) { handler.onError(exc); } else { waitingRequest.getDelegate().onError(exc); } } } finally { if (exc != null && exc.getCode() != ADALError.AUTH_FAILED_CANCELLED) { mAuthContext.removeWaitingRequest(requestId); } } }
Source:
private void usualFormToDiscover(boolean isDiscovered) { if (isDiscovered) { authLabel.setText(constants.hostPopupAuthLabelForExternalHost()); rbPublicKey.setVisible(false); rbPassword.setVisible(false); expanderContent.setVisible(false); publicKeyEditor.setVisible(false); authSshPortEditor.setVisible(false); hostAddressEditor.setEnabled(true); userNameEditor.setVisible(false); } else { authLabel.setText(constants.hostPopupAuthLabel()); rbPublicKey.setVisible(true); rbPassword.setVisible(true); rbPassword.setValue(true); expanderContent.setVisible(true); publicKeyEditor.setVisible(true); authSshPortEditor.setVisible(true); displayPassPkWindow(true); userNameEditor.setVisible(true); } }

Target:
private void usualFormToDiscover(boolean isDiscovered) { if (isDiscovered) { authLabel.setText(constants.hostPopupAuthLabelForExternalHost()); hostAddressEditor.setEnabled(true); } else { authLabel.setText(constants.hostPopupAuthLabel()); displayPassPkWindow(true); rbPassword.setValue(true); } rbPublicKey.setVisible(!isDiscovered); rbPassword.setVisible(!isDiscovered); expanderContent.setVisible(!isDiscovered); publicKeyEditor.setVisible(!isDiscovered); authSshPortEditor.setVisible(!isDiscovered); userNameEditor.setVisible(!isDiscovered); }
Source:
public StoragePool getEntity() { return (StoragePool) ((super.getEntity() instanceof StoragePool) ? super.getEntity() : null); }

Target:
public StoragePool getEntity() { return (StoragePool) super.getEntity(); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; WorkloadDetails that = (WorkloadDetails) o; if (!id.equals(that.id)) return false; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (version != null ? !version.equals(that.version) : that.version != null) return false; if (description != null ? !description.equals(description) : that.description != null) return false; return true; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; WorkloadDetails that = (WorkloadDetails) o; if (!id.equals(that.id)) return false; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (version != null ? !version.equals(that.version) : that.version != null) return false; if (description != null ? !description.equals(that.description) : that.description != null) return false; return true; }
Source:
private void processFailures(Map<KeyExtent,List<Range>> failures, ResultReceiver receiver, List<Column> columns) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { if (log.isTraceEnabled()) log.trace("Failed to execute multiscans against " + failures.size() + " tablets, retrying..."); try { Thread.sleep(failSleepTime); } catch (InterruptedException e) { Thread.currentThread().interrupt(); log.debug("Exiting failure processing on interrupt"); return; } failSleepTime = Math.min(5000, failSleepTime * 2); Map<String,Map<KeyExtent,List<Range>>> binnedRanges = new HashMap<String,Map<KeyExtent,List<Range>>>(); List<Range> allRanges = new ArrayList<Range>(); for (List<Range> ranges : failures.values()) allRanges.addAll(ranges); if (!locator.isValid()) locator = new TimeoutTabletLocator(TabletLocator.getLocator(instance, new Text(table)), timeout); binRanges(locator, allRanges, binnedRanges); doLookups(binnedRanges, receiver, columns); }

Target:
private void processFailures(Map<KeyExtent,List<Range>> failures, ResultReceiver receiver, List<Column> columns) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { if (log.isTraceEnabled()) log.trace("Failed to execute multiscans against " + failures.size() + " tablets, retrying..."); try { Thread.sleep(failSleepTime); } catch (InterruptedException e) { Thread.currentThread().interrupt(); log.debug("Exiting failure processing on interrupt"); return; } failSleepTime = Math.min(5000, failSleepTime * 2); Map<String,Map<KeyExtent,List<Range>>> binnedRanges = new HashMap<String,Map<KeyExtent,List<Range>>>(); List<Range> allRanges = new ArrayList<Range>(); for (List<Range> ranges : failures.values()) allRanges.addAll(ranges); binRanges(locator, allRanges, binnedRanges); doLookups(binnedRanges, receiver, columns); }
Source:
protected File getAvatarDir(final String userId) { File avatarDir = new File(mSession.getCacheDir(), "avatar"); if (!avatarDir.exists()) { avatarDir.mkdirs(); } return avatarDir; }

Target:
protected File getAvatarDir(final String userId) { File avatarDir = new File(mSession.getCacheDir(), DEFAULT_AVATAR_DIR_NAME); if (!avatarDir.exists()) { avatarDir.mkdirs(); } cleanOutOldAvatars(avatarDir, DEFAULT_MAX_AGE); return avatarDir; }
Source:
public static void setUpBeforeClass() throws Exception { Configuration conf = TEST_UTIL.getConfiguration(); conf.setClass(HConstants.REGION_IMPL, InterruptInterceptingHRegion.class, Region.class); conf.setBoolean(HRegion.CLOSE_WAIT_ABORT, true); conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1); }

Target:
public static void setUpBeforeClass() throws Exception { Configuration conf = TEST_UTIL.getConfiguration(); conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1); conf.setClass(HConstants.REGION_IMPL, InterruptInterceptingHRegion.class, Region.class); conf.setBoolean(HRegion.CLOSE_WAIT_ABORT, true); long waitInterval = conf.getLong(HRegion.CLOSE_WAIT_INTERVAL, HRegion.DEFAULT_CLOSE_WAIT_INTERVAL); sleepTime = waitInterval * 2; conf.setLong(HRegion.CLOSE_WAIT_TIME, sleepTime * 2); }
Source:
public DatastoreImpl(String dir, String name, KeyProvider provider) throws SQLException, IOException, DatastoreException { Preconditions.checkNotNull(dir); Preconditions.checkNotNull(name); Preconditions.checkNotNull(provider); this.keyProvider = provider; this.datastoreDir = dir; this.datastoreName = name; this.extensionsDir = FilenameUtils.concat(this.datastoreDir, "extensions"); final String dbFilename = FilenameUtils.concat(this.datastoreDir, DB_FILE_NAME); queue = new SQLDatabaseQueue(dbFilename, provider); int dbVersion = queue.getVersion(); int highestSupportedVersionExclusive = 300; if (dbVersion >= highestSupportedVersionExclusive) { throw new DatastoreException(String.format("Database version is higher than the " + "version supported by this library, current version %d , highest supported " + "version %d", dbVersion, highestSupportedVersionExclusive)); } queue.updateSchema(new SchemaOnlyMigration(DatastoreConstants.getSchemaVersion3()), 3); queue.updateSchema(new SchemaOnlyMigration(DatastoreConstants.getSchemaVersion4()), 4); queue.updateSchema(new SchemaOnlyMigration(DatastoreConstants.getSchemaVersion5()), 5); queue.updateSchema(new SchemaOnlyMigration(DatastoreConstants.getSchemaVersion6()), 6); queue.updateSchema(new MigrateDatabase6To100(), 100); queue.updateSchema(new MigrateDatabase100To200(), 200); this.eventBus = new EventBus(); this.attachmentsDir = this.extensionDataFolder(ATTACHMENTS_EXTENSION_NAME); this.attachmentStreamFactory = new AttachmentStreamFactory(this.getKeyProvider()); }

Target:
public DatastoreImpl(String dir, String name, KeyProvider provider) throws SQLException, IOException, DatastoreException { Preconditions.checkNotNull(dir); Preconditions.checkNotNull(name); Preconditions.checkNotNull(provider); this.keyProvider = provider; this.datastoreDir = dir; this.datastoreName = name; this.extensionsDir = FilenameUtils.concat(this.datastoreDir, "extensions"); final String dbFilename = FilenameUtils.concat(this.datastoreDir, DB_FILE_NAME); queue = new SQLDatabaseQueue(dbFilename, provider); int dbVersion = queue.getVersion(); int highestSupportedVersionExclusive = 300; if (dbVersion >= highestSupportedVersionExclusive) { throw new DatastoreException(String.format("Database version is higher than the " + "version supported by this library, current version %d , highest supported " + "version %d", dbVersion, highestSupportedVersionExclusive - 1)); } queue.updateSchema(new SchemaOnlyMigration(DatastoreConstants.getSchemaVersion3()), 3); queue.updateSchema(new SchemaOnlyMigration(DatastoreConstants.getSchemaVersion4()), 4); queue.updateSchema(new SchemaOnlyMigration(DatastoreConstants.getSchemaVersion5()), 5); queue.updateSchema(new SchemaOnlyMigration(DatastoreConstants.getSchemaVersion6()), 6); queue.updateSchema(new MigrateDatabase6To100(), 100); queue.updateSchema(new MigrateDatabase100To200(), 200); this.eventBus = new EventBus(); this.attachmentsDir = this.extensionDataFolder(ATTACHMENTS_EXTENSION_NAME); this.attachmentStreamFactory = new AttachmentStreamFactory(this.getKeyProvider()); }
Source:
public void BlogTests_001_addFromProfile() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName, credentials.password, wikiURL); String blogTitle = PageContent.blogPostNamePrefix + base.getTimeStamp(); String blogContent = PageContent.blogContent + base.getTimeStamp(); UserProfilePageObject userProfile = base.navigateToProfilePage(credentials.userName, wikiURL); userProfile.clickOnBlogTab(); SpecialCreatePagePageObject createBlogPage = userProfile.clickOnCreateBlogPost(); VisualEditModePageObject visualEditMode = createBlogPage.populateTitleField(blogTitle); visualEditMode.addContent(blogContent); BlogPageObject blogPage = (BlogPageObject) visualEditMode.submit(PageType.Blog); blogPage.verifyBlogTitle(blogTitle); blogPage.verifyContent(blogContent); }

Target:
public void BlogTests_001_addFromProfile() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName, credentials.password, wikiURL); String blogTitle = PageContent.blogPostNamePrefix + base.getTimeStamp(); String blogContent = PageContent.blogContent + base.getTimeStamp(); UserProfilePageObject userProfile = base.navigateToProfilePage(credentials.userName, wikiURL); userProfile.clickOnBlogTab(); SpecialCreatePagePageObject createBlogPage = userProfile.clickOnCreateBlogPost(); VisualEditModePageObject visualEditMode = createBlogPage.populateTitleField(blogTitle); visualEditMode.addContent(blogContent); BlogPageObject blogPage = visualEditMode.submitBlog(); blogPage.verifyBlogTitle(blogTitle); blogPage.verifyContent(blogContent); }
Source:
public void testFindStorageDomainForMemoryWithSingleInvalidDomain() { verifyNoDomainForMemory(Arrays.asList(invalidStorageDomain1)); }

Target:
public void testFindStorageDomainForMemoryWithSingleInvalidDomain() { verifyNoDomainForMemory(Collections.singletonList(invalidStorageDomain1)); }
Source:
public void runSequencerTrim(Duration interval) { log.trace("Trim sequencer address space at round"); CorfuRuntime rt = getCorfuRuntime(); if (!rt.getLayoutView().getLayout().getPrimarySequencer() .equals(serverContext.getLocalEndpoint())) { return; } List<UUID> streamIds = rt.getSequencerView().getStreamsId(); List<List<UUID>> batches = Lists.partition(streamIds, BATCH_SIZE); if (batches.isEmpty()) return; int batchNum = batches.size(); long batchIntervalInMillis = interval.toMillis() / batchNum; for (int i = 0; i < batchNum; ++i) { List<UUID> batch = batches.get(i); sequencerBatchTrimScheduler .schedule(() -> getCorfuRuntime().getSequencerView().addressSpaceTrimInBatch(batch), i * batchIntervalInMillis, TimeUnit.MILLISECONDS); } }

Target:
public void runSequencerTrim(Duration interval) { log.trace("Trim sequencer address space at round"); CorfuRuntime rt = getCorfuRuntime(); getCorfuRuntime() .invalidateLayout() .thenApply(serverContext::saveManagementLayout) .join(); if (!rt.getLayoutView().getLayout().getPrimarySequencer() .equals(serverContext.getLocalEndpoint())) { return; } List<UUID> streamIds = rt.getSequencerView().getStreamsId(); List<List<UUID>> batches = Lists.partition(streamIds, BATCH_SIZE); if (batches.isEmpty()) { return; } int batchNum = batches.size(); long batchIntervalInMillis = interval.toMillis() / batchNum; for (int i = 0; i < batchNum; ++i) { List<UUID> batch = batches.get(i); sequencerBatchTrimScheduler .schedule(() -> getCorfuRuntime().getSequencerView().addressSpaceTrimInBatch(batch), i * batchIntervalInMillis, TimeUnit.MILLISECONDS); } }
Source:
private String parseTestName(JsonElement test) { String testName = test.getAsJsonObject().get("className").toString(); testName = testName.substring(1, testName.length() - 1); return testName + " " + test.getAsJsonObject().get("methodName").getAsString(); }

Target:
private String parseTestName(JsonElement test) { String testName = test.getAsJsonObject().get("className").getAsString(); return testName + " " + test.getAsJsonObject().get("methodName").getAsString(); }
Source:
public void setOS(String os) { incrementSequenceNumber(); fOS = os; if (fRoot != null && os != null && os.length() > 0) { Element nlNode = TargetDefinitionDocumentTools.getChildElement(fRoot, TargetDefinitionPersistenceHelper.ENVIRONMENT, TargetDefinitionPersistenceHelper.OS); nlNode.setTextContent(os); } else { removeElement(TargetDefinitionPersistenceHelper.ENVIRONMENT, TargetDefinitionPersistenceHelper.OS); } }

Target:
public void setOS(String os) { incrementSequenceNumber(); fOS = os; if (fRoot != null && os != null && !os.isEmpty()) { Element nlNode = TargetDefinitionDocumentTools.getChildElement(fRoot, TargetDefinitionPersistenceHelper.ENVIRONMENT, TargetDefinitionPersistenceHelper.OS); nlNode.setTextContent(os); } else { removeElement(TargetDefinitionPersistenceHelper.ENVIRONMENT, TargetDefinitionPersistenceHelper.OS); } }
Source:
public void handleFailureMessage( String code, String message ) { log.debug( "S: FAILURE %s \"%s\"", code, message ); currentError = ErrorUtil.newNeo4jError( code, message ); if ( ErrorUtil.isFatal( currentError ) ) { channel.pipeline().fireExceptionCaught( currentError ); return; } queue( new ResetResponseHandler( this, null ) ); channel.writeAndFlush( RESET, channel.voidPromise() ); ResponseHandler handler = handlers.remove(); handler.onFailure( currentError ); }

Target:
public void handleFailureMessage( String code, String message ) { log.debug( "S: FAILURE %s \"%s\"", code, message ); currentError = ErrorUtil.newNeo4jError( code, message ); if ( ErrorUtil.isFatal( currentError ) ) { channel.pipeline().fireExceptionCaught( currentError ); return; } queue( new ResetResponseHandler( this ) ); channel.writeAndFlush( RESET, channel.voidPromise() ); ResponseHandler handler = handlers.remove(); handler.onFailure( currentError ); }
Source:
private <T extends AbstractController> void assertUniqueMethodMapping(T c) { Set<RequestMappingInfo> requestMappingInfoSet = requestMappingHandlerMapping.getHandlerMethods().keySet(); for(RequestMappingInfo requestMappingInfo : requestMappingInfoSet){ Set<String> patterns = requestMappingInfo.getPatternsCondition().getPatterns(); for(String pattern: patterns){ if(c.getUri() != null && c.getUri().equals(pattern)){ HandlerMethod handlerMethod = requestMappingHandlerMapping.getHandlerMethods().get(requestMappingInfo); throw new IllegalStateException("Mapping conflict. Stormpath cannot map '" + c.getUri() + "'. " + "There is already '" + handlerMethod.getBean() + "' bean method\n" + handlerMethod + " mapped."); } } } }

Target:
private <T extends AbstractController> void assertUniqueMethodMapping(T c) { Set<RequestMappingInfo> requestMappingInfoSet = requestMappingHandlerMapping.getHandlerMethods().keySet(); for (RequestMappingInfo requestMappingInfo : requestMappingInfoSet) { Set<String> patterns = requestMappingInfo.getPatternsCondition().getPatterns(); for (String pattern: patterns) { if (c.getUri() != null && c.getUri().equals(pattern)) { HandlerMethod handlerMethod = requestMappingHandlerMapping.getHandlerMethods().get(requestMappingInfo); throw new IllegalStateException("Mapping conflict: Stormpath cannot map '" + c.getUri() + "'. " + handlerMethod.getBean() + "#" + handlerMethod + " is already mapped to this URI."); } } } }
Source:
public void updateLoanRepayment(LoanRepaymentRequest loanRepaymentRequest) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerLoan.updateLoanRepaymentTransaction(loanRepaymentRequest) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<LoanRepaymentRequest>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showError("Failed to Update LoanRepayment"); } @Override public void onNext(LoanRepaymentRequest loanRepaymentRequest) { getMvpView().showProgressbar(false); getMvpView().showLoanRepaymentUpdated(loanRepaymentRequest); } }) ); }

Target:
public void updateLoanRepayment(LoanRepaymentRequest loanRepaymentRequest) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerLoan.updateLoanRepaymentTransaction(loanRepaymentRequest) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<LoanRepaymentRequest>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showError(R.string.failed_to_load_loanrepayment); } @Override public void onNext(LoanRepaymentRequest loanRepaymentRequest) { getMvpView().showProgressbar(false); getMvpView().showLoanRepaymentUpdated(loanRepaymentRequest); } }) ); }
Source:
public List<Object> getChartSamplePoints(int tenantId, String user, long versionsetId, String featureListString) throws DatabaseHandlerException { List<Object> points = new ArrayList<Object>(); SamplePoints sample = getVersionsetSample(tenantId, user, versionsetId); List<List<String>> columnData = sample.getSamplePoints(); Map<String, Integer> dataHeaders = sample.getHeader(); if (featureListString == null || featureListString.isEmpty()) { return points; } String[] featureList = featureListString.split(","); for(int i=0; i<featureList.length; i++){ if(!dataHeaders.containsKey(featureList[i])) throw new DatabaseHandlerException(String.format("%s is not a feature of version set Id: %s", featureList[i], versionsetId)); } for (int row = 0; row < columnData.get(dataHeaders.get(featureList[0])).size(); row++) { Map<String, Object> data = new HashMap<String, Object>(); for (int featureCount = 0; featureCount < featureList.length; featureCount++) { data.put(featureList[featureCount], columnData.get(dataHeaders.get(featureList[featureCount])) .get(row)); } points.add(data); } return points; }

Target:
public List<Object> getChartSamplePoints(int tenantId, String user, long versionsetId, String featureListString) throws DatabaseHandlerException { List<Object> points = new ArrayList<Object>(); SamplePoints sample = getVersionsetSample(tenantId, user, versionsetId); List<List<String>> columnData = sample.getSamplePoints(); Map<String, Integer> dataHeaders = sample.getHeader(); if (featureListString == null || featureListString.isEmpty()) { return points; } String[] featureList = featureListString.split(","); for (String feature: featureList) { if (!dataHeaders.containsKey(feature)) { throw new DatabaseHandlerException(String.format("%s is not a feature of version set Id: %s", feature, versionsetId)); } } for (int row = 0; row < columnData.get(dataHeaders.get(featureList[0])).size(); row++) { Map<String, Object> data = new HashMap<String, Object>(); for (int featureCount = 0; featureCount < featureList.length; featureCount++) { data.put(featureList[featureCount], columnData.get(dataHeaders.get(featureList[featureCount])) .get(row)); } points.add(data); } return points; }
Source:
public void addAll(final List<T> objects, final List<? extends Locatable> intervals) { invalidateAllObjectsCache(); if (objects == null) { throw new IllegalArgumentException("null objects"); } if (intervals == null) { throw new IllegalArgumentException("null intervals"); } if (objects.size() != intervals.size()) { throw new IllegalArgumentException("Objects and intervals must be the same size but were " + objects.size() + " and " + intervals.size()); } for (int i=0; i<objects.size(); ++i) { addLhs(objects.get(i), intervals.get(i)); } }

Target:
public void addAll(final List<T> objects, final List<? extends Locatable> intervals) { if (objects == null) { throw new IllegalArgumentException("null objects"); } if (intervals == null) { throw new IllegalArgumentException("null intervals"); } if (objects.size() != intervals.size()) { throw new IllegalArgumentException("Objects and intervals must be the same size but were " + objects.size() + " and " + intervals.size()); } for (int i=0; i<objects.size(); ++i) { addLhs(objects.get(i), intervals.get(i)); } }
Source:
protected static String parseRole(List<Descriptor> roleDescriptors) { for (int i = 0; i < roleDescriptors.size(); i++) { Descriptor descriptor = roleDescriptors.get(i); if ("urn:mpeg:dash:role:2011".equals(descriptor.schemeIdUri) && descriptor.value != null) { return descriptor.value; } } return null; }

Target:
protected @C.RoleFlags int parseRole(List<Descriptor> roleDescriptors) { @C.RoleFlags int result = 0; for (int i = 0; i < roleDescriptors.size(); i++) { Descriptor descriptor = roleDescriptors.get(i); if ("urn:mpeg:dash:role:2011".equalsIgnoreCase(descriptor.schemeIdUri)) { result |= parseRoleSchemeValue(descriptor.value); } } return result; }
Source:
public PlanCostEstimate visitSort(SortNode node, Void context) { LocalCostEstimate localCost = LocalCostEstimate.ofCpu(getStats(node).getOutputSizeInBytes(node.getOutputSymbols(), types)); return costForStreaming(node, localCost); }

Target:
public PlanCostEstimate visitSort(SortNode node, Void context) { double cpuCost = getStats(node).getOutputSizeInBytes(node.getOutputSymbols(), types); double memoryCost = getStats(node).getOutputSizeInBytes(node.getOutputSymbols(), types); LocalCostEstimate localCost = LocalCostEstimate.of(cpuCost, memoryCost, 0); return costForAccumulation(node, localCost); }
Source:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_users); UsersDisplayer usersDisplayer = (UsersDisplayer) findViewById(R.id.usersView); Channel channel = (Channel) getIntent().getSerializableExtra(CHANNEL_EXTRA); presenter = new UsersPresenter( Dependencies.INSTANCE.getUserService(), Dependencies.INSTANCE.getChannelService(), usersDisplayer, channel, new AndroidNavigator(this) ); }

Target:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_users); UsersDisplayer usersDisplayer = (UsersDisplayer) findViewById(R.id.usersView); Channel channel = new Channel( getIntent().getStringExtra(NAME_EXTRA), Channel.Access.valueOf(getIntent().getStringExtra(ACCESS_EXTRA)) ); presenter = new UsersPresenter( Dependencies.INSTANCE.getUserService(), Dependencies.INSTANCE.getChannelService(), usersDisplayer, channel, new AndroidNavigator(this) ); }
Source:
public void testDropNonOutputSymbols() { Symbol a = new Symbol("a"); Symbol b = new Symbol("b"); Symbol c = new Symbol("c"); PlanNodeStatsEstimate estimate = PlanNodeStatsEstimate.builder() .addSymbolStatistics(a, SymbolStatsEstimate.builder().setDistinctValuesCount(20).build()) .addSymbolStatistics(b, SymbolStatsEstimate.builder().setDistinctValuesCount(30).build()) .addSymbolStatistics(c, SymbolStatsEstimate.buildFrom(SymbolStatsEstimate.unknown()).build()) .build(); PlanNodeStatsAssertion.assertThat(normalizer.normalize(estimate, ImmutableList.of(b, c), TypeProvider.copyOf(ImmutableMap.of(b, BIGINT, c, BIGINT)))) .symbolsWithKnownStats(b) .symbolStats(b, symbolAssert -> symbolAssert.distinctValuesCount(30)); }

Target:
public void testDropNonOutputSymbols() { Symbol a = new Symbol("a"); Symbol b = new Symbol("b"); Symbol c = new Symbol("c"); PlanNodeStatsEstimate estimate = PlanNodeStatsEstimate.builder() .addSymbolStatistics(a, SymbolStatsEstimate.builder().setDistinctValuesCount(20).build()) .addSymbolStatistics(b, SymbolStatsEstimate.builder().setDistinctValuesCount(30).build()) .addSymbolStatistics(c, SymbolStatsEstimate.unknown()) .build(); PlanNodeStatsAssertion.assertThat(normalizer.normalize(estimate, ImmutableList.of(b, c), TypeProvider.copyOf(ImmutableMap.of(b, BIGINT, c, BIGINT)))) .symbolsWithKnownStats(b) .symbolStats(b, symbolAssert -> symbolAssert.distinctValuesCount(30)); }
Source:
public void reportsRequestResult() throws Exception { final Repo repo = new MkGithub().randomRepo(); final Issue issue = repo.issues().create("", ""); final Talk talk = ReportsTest.example(repo, issue); final Agent agent = new Reports(repo.github()); agent.execute(talk); MatcherAssert.assertThat( talk.read(), XhtmlMatchers.hasXPath(XPATH) ); }

Target:
public void reportsRequestResult() throws Exception { final Repo repo = new MkGithub().randomRepo(); final Talk talk = ReportsTest.example( repo, repo.issues().create("", "") ); final Agent agent = new Reports(repo.github()); agent.execute(talk); MatcherAssert.assertThat( talk.read(), XhtmlMatchers.hasXPath(XPATH) ); }
Source:
public boolean tryAdvance(Consumer<? super DocumentWriteOperation> action) { try { FormatEntry nextEntry = getNextEntry(); if (nextEntry == null) { return false; } splitter.count++; BytesHandle nextBytesHandle = readEntry(nextEntry); String name = nextEntry.getZipEntry().getName(); String uri = name; if (splitter.getUriTransformer() == null && splitter.getUriMaker() == null) { ZipSplitter.UriMakerImpl uriMaker = new ZipSplitter.UriMakerImpl(); uriMaker.setInputName(splitter.inputName); splitter.setUriMaker(uriMaker); } if (splitter.getUriMaker() != null) { if (splitter.inputName != null) { splitter.getUriMaker().setInputName(splitter.inputName); } uri = splitter.getUriMaker().makeUri(splitter.count, name, nextBytesHandle); } if (splitter.getUriTransformer() != null) { uri = splitter.uriTransformer.apply(name); } DocumentWriteOperationImpl documentWriteOperation = new DocumentWriteOperationImpl( DocumentWriteOperation.OperationType.DOCUMENT_WRITE, uri, null, nextBytesHandle ); action.accept(documentWriteOperation); } catch (IOException e) { throw new RuntimeException("Could not read ZipEntry", e); } return true; }

Target:
public boolean tryAdvance(Consumer<? super DocumentWriteOperation> action) { try { FormatEntry nextEntry = getNextEntry(); if (nextEntry == null) { return false; } splitter.count++; BytesHandle nextBytesHandle = readEntry(nextEntry); String name = nextEntry.getZipEntry().getName(); String uri = name; if (splitter.getUriTransformer() == null && splitter.getUriMaker() == null) { ZipSplitter.UriMakerImpl uriMaker = new ZipSplitter.UriMakerImpl(); uriMaker.setInputName(splitter.inputName); splitter.setUriMaker(uriMaker); } if (splitter.getUriMaker() != null) { if (splitter.inputName != null) { splitter.getUriMaker().setInputName(splitter.inputName); } uri = splitter.getUriMaker().makeUri(splitter.count, name, nextBytesHandle); } else { uri = splitter.uriTransformer.apply(name); } DocumentWriteOperationImpl documentWriteOperation = new DocumentWriteOperationImpl( DocumentWriteOperation.OperationType.DOCUMENT_WRITE, uri, null, nextBytesHandle ); action.accept(documentWriteOperation); } catch (IOException e) { throw new RuntimeException("Could not read ZipEntry", e); } return true; }
Source:
public static CategoryController get() { if (mOne == null) { mOne = new CategoryController(); } return mOne; }

Target:
public static CategoryController get() { if (one == null) { one = new CategoryController(); } return one; }
Source:
public boolean isWebviewCourseDiscoveryEnabled() { if (mCourseEnrollmentType != null) { if (mCourseEnrollmentType.equalsIgnoreCase(EnrollmentType.WEBVIEW.name())) { return true; } else if (!mCourseEnrollmentType.equalsIgnoreCase(EnrollmentType.NATIVE.name())) { return false; } } return false; }

Target:
public boolean isWebviewCourseDiscoveryEnabled() { if (mCourseEnrollmentType == null) { return false; } switch (mCourseEnrollmentType.toUpperCase(Locale.US)) { case "WEBVIEW": return true; case "NATIVE": return false; default: logger.debug("No match in config for COURSE_ENROLLMENT.TYPE:" + mCourseEnrollmentType + ". Defaulting to Native"); return false; } }
Source:
public <T> Serializer<T> createKeySerializer(Class<T> clazz, ClassLoader classLoader, ServiceConfiguration<?>... configs) throws UnsupportedTypeException { DefaultSerializerConfiguration<T> conf = find(SerializerConfiguration.Type.KEY, configs); if(conf != null) { if(conf.getInstance() != null) { return conf.getInstance(); } } return createSerializer("-Key", clazz, classLoader, conf, configs); }

Target:
public <T> Serializer<T> createKeySerializer(Class<T> clazz, ClassLoader classLoader, ServiceConfiguration<?>... configs) throws UnsupportedTypeException { DefaultSerializerConfiguration<T> conf = find(SerializerConfiguration.Type.KEY, configs); Serializer<T> instance = getUserProvidedSerializer(conf); if(instance != null) { return instance; } return createSerializer("-Key", clazz, classLoader, conf, configs); }
Source:
public void perform( List<Pair<VM, VdsmVm>> monitoredVms, long fetchTime, VdsManager vdsManager, boolean updateStatistics) { if (monitoredVms.isEmpty()) { return; } ArrayList<VmAnalyzer> vmAnalyzers = new ArrayList<>(); try { analyzeVms(monitoredVms, fetchTime, vdsManager, updateStatistics, vmAnalyzers); addUnmanagedVms(vmAnalyzers, vdsManager.getVdsId()); flush(vmAnalyzers); postFlush(vmAnalyzers, vdsManager); vdsManager.vmsMonitoringInitFinished(); } catch (RuntimeException ex) { log.error("Failed during vms monitoring on host error is: {}", vdsManager.getVdsName(), ex); log.error("Exception:", ex); } finally { unlockVms(vmAnalyzers); } }

Target:
public void perform( List<Pair<VM, VdsmVm>> monitoredVms, long fetchTime, VdsManager vdsManager, boolean updateStatistics) { if (monitoredVms.isEmpty()) { return; } List<VmAnalyzer> vmAnalyzers = new ArrayList<>(); try { analyzeVms(monitoredVms, fetchTime, vdsManager, updateStatistics, vmAnalyzers); addUnmanagedVms(vmAnalyzers, vdsManager.getVdsId()); flush(vmAnalyzers); postFlush(vmAnalyzers, vdsManager); vdsManager.vmsMonitoringInitFinished(); } catch (RuntimeException ex) { log.error("Failed during vms monitoring on host error is: {}", vdsManager.getVdsName(), ex); log.error("Exception:", ex); } finally { unlockVms(vmAnalyzers); } }
Source:
private void configureScalingPolicy(DiagramEditPartService tool, ExportFormat.ScalingPolicy policy, Integer scalingLevel) { Integer workspaceLevelDefault = null; switch (policy) { case AUTO_SCALING: tool.setAutoScalingEnabled(true); if (scalingLevel == null) { workspaceLevelDefault = DiagramUIPlugin.getPlugin().getPreferenceStore().getInt(SiriusUIPreferencesKeys.PREF_SCALE_LEVEL_DIAGRAMS_ON_EXPORT.name()) * 10; tool.setDiagramScaleLevel(workspaceLevelDefault); } else { tool.setDiagramScaleLevel(scalingLevel); } break; case NO_SCALING: tool.setAutoScalingEnabled(false); tool.setDiagramScaleLevel(0); break; case WORKSPACE_DEFAULT: boolean workspaceDefault = DiagramUIPlugin.getPlugin().getPreferenceStore().getBoolean(SiriusDiagramUiPreferencesKeys.PREF_SCALE_DIAGRAMS_ON_EXPORT.name()); tool.setAutoScalingEnabled(workspaceDefault); if (workspaceDefault) { workspaceLevelDefault = DiagramUIPlugin.getPlugin().getPreferenceStore().getInt(SiriusUIPreferencesKeys.PREF_SCALE_LEVEL_DIAGRAMS_ON_EXPORT.name()) * 10; tool.setDiagramScaleLevel(workspaceLevelDefault); } break; case AUTO_SCALING_IF_LARGER: tool.setAutoScalingEnabled(true); if (scalingLevel == null) { workspaceLevelDefault = DiagramUIPlugin.getPlugin().getPreferenceStore().getInt(SiriusUIPreferencesKeys.PREF_SCALE_LEVEL_DIAGRAMS_ON_EXPORT.name()); tool.setDiagramScaleLevel(workspaceLevelDefault); } else { tool.setDiagramScaleLevel(scalingLevel); } tool.setAllowDownScaling(false); break; default: throw new UnsupportedOperationException(); } }

Target:
private void configureScalingPolicy(DiagramEditPartService tool, ExportFormat.ScalingPolicy policy, Integer scalingLevel) { Integer workspaceLevelDefault = null; switch (policy) { case AUTO_SCALING: tool.setAutoScalingEnabled(true); if (scalingLevel == null) { workspaceLevelDefault = SiriusEditPlugin.getPlugin().getPreferenceStore().getInt(SiriusUIPreferencesKeys.PREF_SCALE_LEVEL_DIAGRAMS_ON_EXPORT.name()) * 10; tool.setDiagramScaleLevel(workspaceLevelDefault); } else { tool.setDiagramScaleLevel(scalingLevel); } break; case NO_SCALING: tool.setAutoScalingEnabled(false); tool.setDiagramScaleLevel(0); break; case WORKSPACE_DEFAULT: boolean workspaceDefault = DiagramUIPlugin.getPlugin().getPreferenceStore().getBoolean(SiriusDiagramUiPreferencesKeys.PREF_SCALE_DIAGRAMS_ON_EXPORT.name()); tool.setAutoScalingEnabled(workspaceDefault); if (workspaceDefault) { workspaceLevelDefault = SiriusEditPlugin.getPlugin().getPreferenceStore().getInt(SiriusUIPreferencesKeys.PREF_SCALE_LEVEL_DIAGRAMS_ON_EXPORT.name()) * 10; tool.setDiagramScaleLevel(workspaceLevelDefault); } break; case AUTO_SCALING_IF_LARGER: tool.setAutoScalingEnabled(true); if (scalingLevel == null) { workspaceLevelDefault = SiriusEditPlugin.getPlugin().getPreferenceStore().getInt(SiriusUIPreferencesKeys.PREF_SCALE_LEVEL_DIAGRAMS_ON_EXPORT.name()); tool.setDiagramScaleLevel(workspaceLevelDefault); } else { tool.setDiagramScaleLevel(scalingLevel); } tool.setAllowDownScaling(false); break; default: throw new UnsupportedOperationException(); } }
Source:
public JsonObjectBuilder toJson(ServerConsumer consumer) { ServerSession session = server.getSessionByID(consumer.getSessionID()); JsonObjectBuilder obj = JsonLoader.createObjectBuilder().add("id", toString(consumer.sequentialID())).add("session", (session == null ? "" : toString(session.getName()))).add("clientID", (session == null ? "" : toString(session.getRemotingConnection().getClientID()))).add("user", (session == null ? "" : toString(session.getUsername()))).add("protocol", (session == null ? "" : toString(session.getRemotingConnection().getProtocolName()))).add("queue", toString(consumer.getQueue().getName())).add("queueType", toString(consumer.getQueue().getRoutingType()).toLowerCase()).add("address", toString(consumer.getQueue().getAddress().toString())).add("localAddress", (session == null ? "" : toString(session.getRemotingConnection().getTransportConnection().getLocalAddress()))).add("remoteAddress", (session == null ? "" : toString(session.getRemotingConnection().getTransportConnection().getRemoteAddress()))).add("creationTime", new Date(consumer.getCreationTime()).toString()); return obj; }

Target:
public JsonObjectBuilder toJson(ServerConsumer consumer) { ServerSession session = server.getSessionByID(consumer.getSessionID()); if (session == null) { return null; } JsonObjectBuilder obj = JsonLoader.createObjectBuilder().add("sequentialID", toString(consumer.getSequentialID())) .add("sessionName", toString(consumer.getSessionName())) .add("connectionClientID", toString(consumer.getConnectionClientID())) .add("user", toString(session.getUsername())) .add("connectionProtocolName", toString(consumer.getConnectionProtocolName())) .add("queueName", toString(consumer.getQueueName())) .add("queueType", toString(consumer.getQueueType()).toLowerCase()) .add("queueAddress", toString(consumer.getQueueAddress().toString())) .add("connectionLocalAddress", toString(consumer.getConnectionLocalAddress())) .add("connectionRemoteAddress", toString(consumer.getConnectionRemoteAddress())) .add("creationTime", new Date(consumer.getCreationTime()).toString()); return obj; }
Source:
VertxHttpServerResponse(HttpServerResponse httpServerResponse) { this.httpServerResponse = httpServerResponse; httpServerResponse.setWriteQueueMaxSize(16384); }

Target:
VertxHttpServerResponse(HttpServerResponse httpServerResponse) { this.httpServerResponse = httpServerResponse; }