auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void ExecuteVmCommand() { lockVmWithCompensationIfNeeded(); if (!isInternalExecution()) { freeLock(); } restoreSnapshotAndRemoveObsoleteSnapshots(); if (getImagesList().size() > 0) { VdcReturnValueBase returnValue = null; for (DiskImage image : getImagesList()) { if (image.getimageStatus() != ImageStatus.ILLEGAL) { ImagesContainterParametersBase params = new RestoreFromSnapshotParameters(image.getImageId(), getVmId(), targetSnapshot, removedSnapshotId); returnValue = runAsyncTask(VdcActionType.RestoreFromSnapshot, params); } } if (getTaskIdList().size() == 0) { log.errorFormat("Can't restore snapshot for VM, since no destroyImage task could be established in the VDSM."); if (returnValue != null) { getReturnValue().setFault(returnValue.getFault()); return; } } else { setSucceeded(true); } deleteOrphanedImages(); removeSnapshotsFromDB(); } else { removeSnapshotsFromDB(); EndVmCommand(); setSucceeded(true); } }

Target:
protected void ExecuteVmCommand() { lockVmWithCompensationIfNeeded(); if (!isInternalExecution()) { freeLock(); } restoreSnapshotAndRemoveObsoleteSnapshots(); boolean succeeded = true; boolean hasAsyncTasks = false; if (getImagesList().size() > 0) { for (DiskImage image : getImagesList()) { if (image.getimageStatus() != ImageStatus.ILLEGAL) { ImagesContainterParametersBase params = new RestoreFromSnapshotParameters(image.getImageId(), getVmId(), targetSnapshot, removedSnapshotId); VdcReturnValueBase returnValue = runAsyncTask(VdcActionType.RestoreFromSnapshot, params); if (!returnValue.getSucceeded()) { succeeded = false; getReturnValue().setFault(returnValue.getFault()); } } } hasAsyncTasks = !getTaskIdList().isEmpty(); } removeSnapshotsFromDB(); if (hasAsyncTasks) { deleteOrphanedImages(); } else { EndVmCommand(); } setSucceeded(succeeded); }
Source:
public boolean hasTxLogs() throws RuntimeException { File[] files = storeDir.listFiles( LogFiles.FILENAME_FILTER ); if ( files == null ) { throw new RuntimeException( "Files was null. Incorrect directory or I/O error?" ); } return files.length > 0; }

Target:
public boolean hasTxLogs() { File[] files = storeDir.listFiles( LogFiles.FILENAME_FILTER ); if ( files == null ) { throw new RuntimeException( "Files was null. Incorrect directory or I/O error?" ); } return files.length > 0; }
Source:
protected Map<Guid, KeyValuePairCompat<String, List<Guid>>> populateVmsMetadataForOvfUpdate(List<Guid> idsToProcess) { Map<Guid, KeyValuePairCompat<String, List<Guid>>> vmsAndTemplateMetadata = new HashMap<Guid, KeyValuePairCompat<String, List<Guid>>>(); List<VM> vms = getVmDao().getVmsByIds(idsToProcess); for (VM vm : vms) { if (VMStatus.ImageLocked != vm.getStatus()) { updateVmDisksFromDb(vm); if (!verifyImagesStatus(vm.getDiskList())) { continue; } ArrayList<DiskImage> vmImages = getVmImagesFromDb(vm); if (!verifyImagesStatus(vmImages)) { continue; } vm.setSnapshots(getSnapshotDao().getAllWithConfiguration(vm.getId())); if (!verifySnapshotsStatus(vm.getSnapshots())) { continue; } loadVmData(vm); Long currentDbGeneration = getVmStaticDao().getDbGeneration(vm.getId()); if (currentDbGeneration == null) { log.warnFormat("currentDbGeneration of VM (name: {0}, id: {1}) is null, probably because the VM was deleted during the run of OvfDataUpdater.", vm.getName(), vm.getId()); } else if (vm.getStaticData().getDbGeneration() == currentDbGeneration) { proccessedOvfConfigurationsInfo.add(buildMetadataDictionaryForVm(vm, vmsAndTemplateMetadata, vmImages)); proccessedIdsInfo.add(vm.getId()); proccessedOvfGenerationsInfo.add(vm.getStaticData().getDbGeneration()); proccessDisksDomains(vm.getDiskList()); } } } return vmsAndTemplateMetadata; }

Target:
protected Map<Guid, KeyValuePairCompat<String, List<Guid>>> populateVmsMetadataForOvfUpdate(List<Guid> idsToProcess) { Map<Guid, KeyValuePairCompat<String, List<Guid>>> vmsAndTemplateMetadata = new HashMap<Guid, KeyValuePairCompat<String, List<Guid>>>(); List<VM> vms = getVmDao().getVmsByIds(idsToProcess); for (VM vm : vms) { if (VMStatus.ImageLocked != vm.getStatus()) { updateVmDisksFromDb(vm); if (!verifyImagesStatus(vm.getDiskList())) { continue; } ArrayList<DiskImage> vmImages = getVmImagesFromDb(vm); if (!verifyImagesStatus(vmImages)) { continue; } vm.setSnapshots(getSnapshotDao().getAllWithConfiguration(vm.getId())); if (!verifySnapshotsStatus(vm.getSnapshots())) { continue; } loadVmData(vm); Long currentDbGeneration = getVmStaticDao().getDbGeneration(vm.getId()); if (currentDbGeneration == null) { log.warnFormat("currentDbGeneration of VM (name: {0}, id: {1}) is null, probably because the VM was deleted during the run of OvfDataUpdater.", vm.getName(), vm.getId()); continue; } if (vm.getStaticData().getDbGeneration() == currentDbGeneration) { proccessedOvfConfigurationsInfo.add(buildMetadataDictionaryForVm(vm, vmsAndTemplateMetadata, vmImages)); proccessedIdsInfo.add(vm.getId()); proccessedOvfGenerationsInfo.add(vm.getStaticData().getDbGeneration()); proccessDisksDomains(vm.getDiskList()); } } } return vmsAndTemplateMetadata; }
Source:
public Control render(final SWTGridCell cell, Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption { Control control = controls.get(cell); if (control != null) { return control; } control = renderControl(cell, parent); if (control == null) { return null; } controls.put(cell, control); if (!canHandleControlProcessor()) { defaultHandleControlProcessorForCell(control, cell); } control.addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { if (controls != null) { controls.remove(cell); } } }); return control; }

Target:
public Control render(final SWTGridCell cell, Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption { Control control = controls.get(cell); if (control != null) { return control; } control = renderControl(cell, parent); if (control == null) { return null; } controls.put(cell, control); control.addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { if (controls != null) { controls.remove(cell); } } }); return control; }
Source:
void validateMappingsConfig(MappingsConfig mappingsConfig, StackV4Request stackRequest) { String errorMessage = null; if (stackRequest.getCluster().isRangerRazEnabled()) { if (!mappingsConfig.getActorMappings().containsKey("rangerraz")) { errorMessage = "IDBMMS mappings must contain the RAZ role if RAZ is to be created!"; } } else { if (mappingsConfig.getActorMappings().containsKey("rangerraz")) { errorMessage = "IDBMMS mappings cannot contain the RAZ role if RAZ is not enabled for the cluster!"; } } if (errorMessage != null) { LOGGER.error(errorMessage); throw new IdbmmsOperationException(errorMessage); } }

Target:
void validateMappingsConfig(MappingsConfig mappingsConfig, StackV4Request stackRequest) { if (stackRequest.getCluster().isRangerRazEnabled()) { if (!mappingsConfig.getActorMappings().containsKey("rangerraz")) { LOGGER.error("IDBMMS mappings must contain the RAZ role if RAZ is to be created!"); throw new BadRequestException("IDBMMS mappings must contain the RAZ role if RAZ is to be created!"); } } }
Source:
public static void deletePeopleExceptForFirstPage(int localTableBlogId) { int fetchLimit = PeopleUtils.FETCH_LIMIT; String[] tables = {TEAM_TABLE, FOLLOWERS_TABLE, EMAIL_FOLLOWERS_TABLE}; getWritableDb().beginTransaction(); try { for (String table : tables) { int size = getPeopleCountForLocalBlogId(table, localTableBlogId); if (size > fetchLimit) { int deleteCount = size - fetchLimit; String[] args = new String[] {Integer.toString(localTableBlogId), Integer.toString(deleteCount)}; getWritableDb().delete(table, "local_blog_id=?1 AND person_id IN (SELECT person_id FROM " + table + " WHERE local_blog_id=?1" + orderByString(table) + " DESC LIMIT ?2)", args); } } getWritableDb().setTransactionSuccessful(); } finally { getWritableDb().endTransaction(); } }

Target:
public static void deletePeopleExceptForFirstPage(int localTableBlogId) { int fetchLimit = PeopleUtils.FETCH_LIMIT; String[] tables = {TEAM_TABLE, FOLLOWERS_TABLE, EMAIL_FOLLOWERS_TABLE, VIEWERS_TABLE}; getWritableDb().beginTransaction(); try { for (String table : tables) { int size = getPeopleCountForLocalBlogId(table, localTableBlogId); if (size > fetchLimit) { int deleteCount = size - fetchLimit; String[] args = new String[] {Integer.toString(localTableBlogId), Integer.toString(deleteCount)}; getWritableDb().delete(table, "local_blog_id=?1 AND person_id IN (SELECT person_id FROM " + table + " WHERE local_blog_id=?1" + orderByString(table) + " DESC LIMIT ?2)", args); } } getWritableDb().setTransactionSuccessful(); } finally { getWritableDb().endTransaction(); } }
Source:
public void toExecute(JobExecutionContext context) throws JobExecutionException { Date now = new Date(); PoolFilterBuilder filters = new PoolFilterBuilder(); filters.addAttributeFilter("unmapped_guests_only", "true"); List<Pool> unmappedGuestPools = poolCurator.listByFilter(filters); List<Entitlement> lapsedUnmappedGuestEntitlements = new ArrayList<Entitlement>(); for (Pool p : unmappedGuestPools) { for (Entitlement e : p.getEntitlements()) { if (isLapsed(e, now)) { lapsedUnmappedGuestEntitlements.add(e); } } } for (Entitlement e : lapsedUnmappedGuestEntitlements) { poolManager.revokeEntitlement(e); } if (lapsedUnmappedGuestEntitlements.size() > 0) { log.info("Reaped unmapped guest entitlements due to expiration.", lapsedUnmappedGuestEntitlements.size()); } else { log.debug("No unmapped guest entitlements need reaping."); } }

Target:
public void toExecute(JobExecutionContext context) throws JobExecutionException { Date now = new Date(); List<Entitlement> unmappedGuestEntitlements = entitlementCurator.findByPoolAttribute("unmapped_guests_only", "true"); int total = 0; for (Entitlement e : unmappedGuestEntitlements) { if (isLapsed(e, now)) { poolManager.revokeEntitlement(e); total++; } } if (total > 0) { log.info("Reaped unmapped guest entitlements due to expiration.", total); } else { log.debug("No unmapped guest entitlements need reaping."); } }
Source:
public void customLabelNoOp_NegativeVoteNotBlock() throws Exception { Q.setFunctionName("NoOp"); saveLabelConfig(); PushOneCommit.Result r = createChange(); revision(r).review(new ReviewInput().label(Q.getName(), -1)); ChangeInfo c = get(r.getChangeId()); LabelInfo q = c.labels.get(Q.getName()); assertThat(q.all.size()).isEqualTo(1); assertThat(q.rejected).isNotNull(); assertThat(q.blocking).isNull(); }

Target:
public void customLabelNoOp_NegativeVoteNotBlock() throws Exception { Q.setFunctionName("NoOp"); saveLabelConfig(); PushOneCommit.Result r = createChange(); revision(r).review(new ReviewInput().label(Q.getName(), -1)); ChangeInfo c = get(r.getChangeId()); LabelInfo q = c.labels.get(Q.getName()); assertThat(q.all).hasSize(1); assertThat(q.rejected).isNotNull(); assertThat(q.blocking).isNull(); }
Source:
public String getImageId(String tagName) { String imageId = null; ModelNode tags = get(IMAGESTREAM_STATUS_TAGS); if (tags == null || tags.getType() != ModelType.LIST) return null; List<ModelNode> tagWrappers = tags.asList(); if (tagWrappers != null) { for (ModelNode tagWrapper : tagWrappers) { ModelNode tag = tagWrapper.get(TAG); ModelNode items = tagWrapper.get(ITEMS); if (tag != null && tag.asString().equals(tagName) && items != null) { List<ModelNode> itemWrappers = items.asList(); for (ModelNode itemWrapper : itemWrappers) { ModelNode image = itemWrapper.get(IMAGE); if (image != null) { imageId = image.asString(); break; } } } if (imageId != null) break; } } return imageId; }

Target:
public String getImageId(String tagName) { String imageId = null; ModelNode tags = get(IMAGESTREAM_STATUS_TAGS); if (tags.getType() != ModelType.LIST || tagName == null) return null; List<ModelNode> tagWrappers = tags.asList(); for (ModelNode tagWrapper : tagWrappers) { ModelNode tag = tagWrapper.get(TAG); ModelNode items = tagWrapper.get(ITEMS); if (tag.asString().equals(tagName) && items.getType() == ModelType.LIST) { imageId = getImageId(items.asList()); break; } } return imageId; }
Source:
private String formatProjects( List<MavenProject> projects ) { StringBuilder projectNames = new StringBuilder(); for ( int index = 0, size = projects.size(); index < size; index++ ) { MavenProject project = projects.get( index ); projectNames.append( project.getGroupId() ).append( ":" ).append( project.getArtifactId() ); boolean lastElement = index + 1 == size; if (!lastElement) { projectNames.append( ", " ); } } return projectNames.toString(); }

Target:
private String formatProjects( List<MavenProject> projects ) { StringBuilder projectNames = new StringBuilder(); Iterator<MavenProject> iterator = projects.iterator(); while ( iterator.hasNext() ) { MavenProject project = iterator.next(); projectNames.append( project.getGroupId() ).append( ":" ).append( project.getArtifactId() ); if ( iterator.hasNext() ) { projectNames.append( ", " ); } } return projectNames.toString(); }
Source:
public static void startIfRequired(MaxwellContext context) { MaxwellMetrics.Registries metricsRegistries = getMetricsRegistries(context.getConfig()); MaxwellDiagnosticContext diagnosticContext = getDiagnosticContext(context); if (metricsRegistries != null || diagnosticContext != null) { LOGGER.info("Metrics http server starting"); int port = context.getConfig().monitoringHTTPPort; String pathPrefix = context.getConfig().monitoringHTTPPathPrefix; MaxwellHTTPServerWorker maxwellHTTPServerWorker = new MaxwellHTTPServerWorker(port, pathPrefix, metricsRegistries, diagnosticContext); Thread thread = new Thread(maxwellHTTPServerWorker); context.addTask(maxwellHTTPServerWorker); thread.setUncaughtExceptionHandler((t, e) -> { e.printStackTrace(); System.exit(1); }); thread.setDaemon(true); thread.start(); LOGGER.info("Metrics http server started on port " + port); } }

Target:
public static void startIfRequired(MaxwellContext context) throws IOException { MaxwellMetrics.Registries metricsRegistries = getMetricsRegistries(context); MaxwellDiagnosticContext diagnosticContext = getDiagnosticContext(context); if (metricsRegistries != null || diagnosticContext != null) { LOGGER.info("Maxwell http server starting"); int port = context.getConfig().httpPort; String pathPrefix = context.getConfig().httpPathPrefix; MaxwellHTTPServerWorker maxwellHTTPServerWorker = new MaxwellHTTPServerWorker(port, pathPrefix, metricsRegistries, diagnosticContext); Thread thread = new Thread(maxwellHTTPServerWorker); context.addTask(maxwellHTTPServerWorker); thread.setUncaughtExceptionHandler((t, e) -> { LOGGER.error("Maxwell http server failure", e); context.terminate((Exception) e); }); thread.setDaemon(true); thread.start(); LOGGER.info("Maxwell http server started on port " + port); } }
Source:
private MessageInfo(StoreKey key, long size, boolean deleted, long expirationTimeInMs, Long crc, short accountId, short containerId, long operationTimeMs) { this.key = key; this.size = size; this.isDeleted = deleted; this.expirationTimeInMs = expirationTimeInMs; this.crc = crc; this.accountId = accountId; this.containerId = containerId; this.operationTimeMs = operationTimeMs; }

Target:
public MessageInfo(StoreKey key, long size, boolean deleted, long expirationTimeInMs, Long crc, short accountId, short containerId, long operationTimeMs) { if (operationTimeMs < Utils.Infinite_Time) { throw new IllegalArgumentException("OperationTime cannot be negative " + operationTimeMs); } this.key = key; this.size = size; this.isDeleted = deleted; this.expirationTimeInMs = expirationTimeInMs; this.crc = crc; this.accountId = accountId; this.containerId = containerId; this.operationTimeMs = operationTimeMs; }
Source:
public SslEngineConfiguration(String keyStoreFileName, String keyStoreType, char[] keyStorePassword, char[] keyStoreCertificatePassword, String keyAlias, SSLContext sslContext, String trustStoreFileName, String trustStoreType, char[] trustStorePassword, String protocol) { this.keyStoreFileName = keyStoreFileName; this.keyStoreType = keyStoreType; this.keyStorePassword = keyStorePassword; this.keyStoreCertificatePassword = keyStoreCertificatePassword; this.keyAlias = keyAlias; this.sslContext = sslContext; this.trustStoreFileName = trustStoreFileName; this.trustStoreType = trustStoreType; this.trustStorePassword = trustStorePassword; this.protocol = protocol; }

Target:
SslEngineConfiguration(String keyStoreFileName, String keyStoreType, char[] keyStorePassword, char[] keyStoreCertificatePassword, String keyAlias, SSLContext sslContext, String trustStoreFileName, String trustStoreType, char[] trustStorePassword, String protocol) { this.keyStoreFileName = keyStoreFileName; this.keyStoreType = keyStoreType; this.keyStorePassword = keyStorePassword; this.keyStoreCertificatePassword = keyStoreCertificatePassword; this.keyAlias = keyAlias; this.sslContext = sslContext; this.trustStoreFileName = trustStoreFileName; this.trustStoreType = trustStoreType; this.trustStorePassword = trustStorePassword; this.protocol = protocol; }
Source:
private WhereClauseBuilder constraintClauseBuilder(RelationshipEntityType relationshipEntityType, String relationshipEntityUid) { return new WhereClauseBuilder() .appendKeyStringValue( RelationshipConstraintTableInfo.Columns.RELATIONSHIP_ENTITY, relationshipEntityType) .appendKeyStringValue( RelationshipConstraintTableInfo.Columns.TRACKED_ENTITY_TYPE, relationshipEntityUid); }

Target:
private WhereClauseBuilder constraintClauseBuilder(RelationshipEntityType relationshipEntityType, String relationshipEntityUid) { return new WhereClauseBuilder() .appendKeyStringValue( RelationshipConstraintTableInfo.Columns.RELATIONSHIP_ENTITY, relationshipEntityType) .appendKeyStringValue(getRelationshipEntityColumn(relationshipEntityType), relationshipEntityUid); }
Source:
private void afterDFcollection() { if (globalState == DynamicProcessorState.DONE || globalState == DynamicProcessorState.FAILED) { return; } TupleDomain<Symbol> tupleDomain = dfTupleDomain.get(); if (!tupleDomain.isAll()) { try { final Expression expr = DomainTranslator.toPredicate(tupleDomain); final Optional<RowExpression> rowExpression = converter.expressionToRowExpression(Optional.of(expr)); final RowExpression combinedExpression = call(logicalExpressionSignature(LogicalBinaryExpression.Type.AND), BOOLEAN, rowExpression.get(), staticFilter.get()); resultExpression = Optional.of(combinedExpression); globalState = DynamicProcessorState.DONE; triggerCallback(combinedExpression); } catch (Exception e) { globalState = DynamicProcessorState.FAILED; throw e; } } else { log.debug("DF Processing: Tuple Domain is all"); globalState = DynamicProcessorState.FAILED; } }

Target:
private void afterDFcollection() { if (globalState == DynamicProcessorState.DONE || globalState == DynamicProcessorState.FAILED) { return; } TupleDomain<Symbol> tupleDomain = dfTupleDomain.get(); if (!tupleDomain.isAll()) { try { final Expression expr = DomainTranslator.toPredicate(tupleDomain); final Optional<RowExpression> rowExpression = converter.expressionToRowExpression(Optional.of(expr)); final RowExpression combinedExpression = call(logicalExpressionSignature(LogicalBinaryExpression.Type.AND), BOOLEAN, rowExpression.get(), staticFilter.get()); resultExpression = Optional.of(combinedExpression); globalState = DynamicProcessorState.DONE; triggerCallback(combinedExpression); } catch (Exception e) { globalState = DynamicProcessorState.FAILED; log.warn(e, "Could not convert Tuple Domain from DynamicFilter to Expression"); throw e; } } else { log.debug("DF Processing: Tuple Domain is all"); globalState = DynamicProcessorState.FAILED; } }
Source:
private EventSubscriber<WorkspaceCreatedEvent> subscribeAndGetCreatedSubscriber() { subscribeToEventService(); @SuppressWarnings("unchecked") final EventSubscriber<WorkspaceCreatedEvent> subscriber = (EventSubscriber<WorkspaceCreatedEvent>) createAndChangeEventCaptor.getAllValues().get(1); return subscriber; }

Target:
private EventSubscriber<WorkspaceCreatedEvent> subscribeAndGetCreatedSubscriber() { subscribeToEventService(); return createEventCaptor.getValue(); }
Source:
public void testFireExpressionEditorSelectedEventSelectsParentGridWidget() { final GridData mockParentUiModel = mock(GridData.class); final BaseExpressionGrid mockParentGrid = mock(BaseExpressionGrid.class); doReturn(mockParentUiModel).when(parent).getGridData(); doReturn(mockParentUiModel).when(mockParentGrid).getModel(); doReturn(new HashSet<GridWidget>() {{ add(mockParentGrid); add(grid); }}).when(gridLayer).getGridWidgets(); grid.fireExpressionEditorSelectedEvent(); verify(editorSelectedEvent).fire(expressionEditorSelectedEventCaptor.capture()); final ExpressionEditorSelectedEvent event = expressionEditorSelectedEventCaptor.getValue(); assertThat(event.getEditor()).isPresent(); assertThat(mockParentGrid).isSameAs(event.getEditor().get()); }

Target:
public void testFireExpressionEditorSelectedEventSelectsParentGridWidget() { final GridData mockParentUiModel = mock(GridData.class); final BaseExpressionGrid mockParentGrid = mock(BaseExpressionGrid.class); doReturn(mockParentUiModel).when(parent).getGridData(); doReturn(mockParentUiModel).when(mockParentGrid).getModel(); doReturn(new HashSet<GridWidget>() {{ add(mockParentGrid); add(grid); }}).when(gridLayer).getGridWidgets(); grid.select(); verify(editorSelectedEvent).fire(expressionEditorSelectedEventCaptor.capture()); final ExpressionEditorSelectedEvent event = expressionEditorSelectedEventCaptor.getValue(); assertThat(event.getEditor()).isPresent(); assertThat(mockParentGrid).isSameAs(event.getEditor().get()); }
Source:
public static Slice myanmarFontEncoding(@SqlType(StandardTypes.VARCHAR) Slice slice) { if (detector.getZawgyiProbability(slice.toStringUtf8()) > 0.9) { return utf8Slice("zawgyi"); } else { return utf8Slice("unicode"); } }

Target:
public static Slice myanmarFontEncoding(@SqlType(StandardTypes.VARCHAR) Slice slice) { if (detector.getZawgyiProbability(slice.toStringUtf8()) > ZAWGYI_PROBABILITY_THRESHOLD) { return utf8Slice("zawgyi"); } else { return utf8Slice("unicode"); } }
Source:
public IterableStream<PartitionEvent> receive(String partitionId, int maximumMessageCount, Duration maximumWaitTime) { Objects.requireNonNull(maximumWaitTime, "'maximumWaitTime' cannot be null."); if (maximumMessageCount < 1) { throw logger.logExceptionAsError( new IllegalArgumentException("'maximumMessageCount' cannot be less than 1.")); } else if (maximumWaitTime.isNegative() || maximumWaitTime.isZero()) { throw logger.logExceptionAsError( new IllegalArgumentException("'maximumWaitTime' cannot be zero or less.")); } final Flux<PartitionEvent> events = Flux.create(emitter -> { queueWork(partitionId, maximumMessageCount, maximumWaitTime, emitter); }); final Flux<PartitionEvent> map = events.collectList().map(x -> { logger.info("Number of events received: {}", x.size()); return Flux.fromIterable(x); }).block(); return new IterableStream<>(map); }

Target:
public IterableStream<PartitionEvent> receive(String partitionId, int maximumMessageCount, Duration maximumWaitTime) { Objects.requireNonNull(maximumWaitTime, "'maximumWaitTime' cannot be null."); if (maximumMessageCount < 1) { throw logger.logExceptionAsError( new IllegalArgumentException("'maximumMessageCount' cannot be less than 1.")); } else if (maximumWaitTime.isNegative() || maximumWaitTime.isZero()) { throw logger.logExceptionAsError( new IllegalArgumentException("'maximumWaitTime' cannot be zero or less.")); } final Flux<PartitionEvent> events = Flux.create(emitter -> { queueWork(partitionId, maximumMessageCount, maximumWaitTime, emitter); }); return new IterableStream<>(events); }
Source:
public void testInsertConfigToDB() { String jdbcDriver = "com.mysql.jdbc.Driver"; String mysqlURL = "jdbc:mysql://gargamel.cs.illinois.edu/openeval_db"; String username = "oeroot"; String password = "Fow,10#"; try { Connection conn = DriverManager.getConnection(mysqlURL, username, password); String sql = "SELECT COUNT(*) FROM configurations;"; PreparedStatement stmt = conn.prepareStatement(sql); ResultSet ret = stmt.executeQuery(); ret.first(); int countOfRecordsInitial = ret.getInt(1); FrontEndDBInterface f = new FrontEndDBInterface(); List<String> taskVariants = new ArrayList<>(); taskVariants.add("testTskVar"); f.insertConfigToDB("testDataset", "testTeamName", "testDescription", "testEvaluator", "testTaskType", taskVariants); sql = "SELECT COUNT(*) FROM configurations;"; stmt = conn.prepareStatement(sql); ret = stmt.executeQuery(); ret.first(); int countOfRecordsNew = ret.getInt(1); assertEquals(countOfRecordsInitial + 1, countOfRecordsNew); sql = "DELETE FROM configurations WHERE datasetName = 'testDataset'"; stmt = conn.prepareStatement(sql); stmt.executeUpdate(); conn.close(); } catch (SQLException e) { e.printStackTrace(); } }

Target:
public void testInsertConfigToDB() { String jdbcDriver = "com.mysql.jdbc.Driver"; String mysqlURL = "jdbc:mysql://gargamel.cs.illinois.edu/openeval_db"; String username = "oeroot"; String password = "Fow,10#"; try { Connection conn = DriverManager.getConnection(mysqlURL, username, password); String sql = "SELECT COUNT(*) FROM configurations;"; PreparedStatement stmt = conn.prepareStatement(sql); ResultSet ret = stmt.executeQuery(); ret.first(); int countOfRecordsInitial = ret.getInt(1); FrontEndDBInterface f = new FrontEndDBInterface(); List<String> taskVariants = new ArrayList<>(); taskVariants.add("testTskVar"); f.insertConfigToDB("testDataset", "testTeamName", "testDescription", "testEvaluator", "testTaskType", taskVariants); sql = "SELECT COUNT(*) FROM configurations;"; stmt = conn.prepareStatement(sql); ret = stmt.executeQuery(); ret.first(); int countOfRecordsNew = ret.getInt(1); assertEquals(countOfRecordsInitial + 1, countOfRecordsNew); sql = "DELETE FROM configurations WHERE datasetName = 'testDataset'"; stmt = conn.prepareStatement(sql); stmt.executeUpdate(); conn.close(); } catch (SQLException e) { if (e.getMessage().contains("The driver has not received any packets from the server.")) return; } }
Source:
private void reloadPalette(PaletteManager paletteManager, Diagram gmfDiagram, boolean clean) { TransactionalEditingDomain editingDomain = dDiagramEditorImpl.getEditingDomain(); if (editingDomain != null && gmfDiagram != null && gmfDiagram.getElement() instanceof DDiagram && SessionManager.INSTANCE.getSession(((DSemanticDecorator) gmfDiagram.getElement()).getTarget()) != null) { TransactionImpl t = new TransactionImpl(editingDomain, false, Collections.EMPTY_MAP); try { t.start(); UpdateToolRecordingCommand updateToolRecordingCommand = new UpdateToolRecordingCommand(editingDomain, (DDiagram) gmfDiagram.getElement(), true); if (updateToolRecordingCommand.canExecute()) { updateToolRecordingCommand.execute(); } t.commit(); ToolManagement toolManagement = DiagramPlugin.getDefault().getToolManagement(gmfDiagram); if (toolManagement != null) { if (clean) { toolManagement.notifyToolChangeAfterVSMReload(); } else { toolManagement.notifyToolChange(); } } } catch (RollbackException | InterruptedException e) { DiagramPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, DiagramPlugin.ID, Messages.DDiagramEditorImpl_updateToolFailure, e)); } } }

Target:
private void reloadPalette(PaletteManager paletteManager, Diagram gmfDiagram, boolean clean) { TransactionalEditingDomain editingDomain = dDiagramEditorImpl.getEditingDomain(); if (editingDomain != null && gmfDiagram != null && gmfDiagram.getElement() instanceof DDiagram) { TransactionImpl t = new TransactionImpl(editingDomain, false, Collections.EMPTY_MAP); try { t.start(); UpdateToolRecordingCommand updateToolRecordingCommand = new UpdateToolRecordingCommand(editingDomain, (DDiagram) gmfDiagram.getElement(), true); if (updateToolRecordingCommand.canExecute()) { updateToolRecordingCommand.execute(); } t.commit(); ToolManagement toolManagement = DiagramPlugin.getDefault().getToolManagement(gmfDiagram); if (toolManagement != null) { if (clean) { toolManagement.notifyToolChangeAfterVSMReload(); } else { toolManagement.notifyToolChange(); } } } catch (RollbackException | InterruptedException e) { DiagramPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, DiagramPlugin.ID, Messages.DDiagramEditorImpl_updateToolFailure, e)); } } }
Source:
private void registerSessionManager() { Bundle bundle = FrameworkUtil.getBundle(AttributeSharingHashSessionIdManager.class); if (bundle == null) { LOGGER.error("Error initializing Session Manager"); } else { final BundleContext bundleContext = bundle.getBundleContext(); final SharingSessionInvalidator sm = new SharingSessionInvalidator(this); final Hashtable<String, Object> props = new Hashtable<>(); props.put(Constants.SERVICE_PID, sm.getClass().getName()); props.put(Constants.SERVICE_DESCRIPTION, "Sharing Session Invalidator"); props.put(Constants.SERVICE_VENDOR, "Codice Foundation"); props.put(Constants.SERVICE_RANKING, Integer.MIN_VALUE); bundleContext.registerService(HttpSessionInvalidator.class.getName(), sm, props); } }

Target:
private void registerSessionManager() { Bundle bundle = FrameworkUtil.getBundle(AttributeSharingHashSessionIdManager.class); if (bundle == null) { LOGGER.error("Error initializing Session Manager"); return; } final BundleContext bundleContext = bundle.getBundleContext(); if (bundleContext == null) { LOGGER.error("Error initializing Session Manager"); return; } final SharingSessionInvalidator sm = new SharingSessionInvalidator(this); final Dictionary<String, Object> props = new DictionaryMap<>(); props.put(Constants.SERVICE_PID, sm.getClass().getName()); props.put(Constants.SERVICE_DESCRIPTION, "Sharing Session Invalidator"); props.put(Constants.SERVICE_VENDOR, "Codice Foundation"); props.put(Constants.SERVICE_RANKING, Integer.MIN_VALUE); bundleContext.registerService(HttpSessionInvalidator.class.getName(), sm, props); }
Source:
protected RollCycle getRollCycle(String retentionDuration) { String rollingPeriod = retentionDuration.substring(retentionDuration.length() - 1); RollCycle rollCycle; switch (rollingPeriod) { case SECOND_ROLLING_PERIOD: rollCycle = RollCycles.TEST_SECONDLY; break; case MINUTE_ROLLING_PERIOD: rollCycle = RollCycles.MINUTELY; break; case HOUR_ROLLING_PERIOD: rollCycle = RollCycles.HOURLY; break; case DAY_ROLLING_PERIOD: rollCycle = RollCycles.DAILY; break; default: String msg = "Unknown rolling period: " + rollingPeriod + " for Log: " + name(); log.error(msg); throw new IllegalArgumentException(msg); } return rollCycle; }

Target:
protected RollCycle getRollCycle(String retentionDuration) { String rollingPeriod = retentionDuration.substring(retentionDuration.length() - 1); switch (rollingPeriod) { case SECOND_ROLLING_PERIOD: return RollCycles.TEST_SECONDLY; case MINUTE_ROLLING_PERIOD: return RollCycles.MINUTELY; case HOUR_ROLLING_PERIOD: return RollCycles.HOURLY; case DAY_ROLLING_PERIOD: return RollCycles.DAILY; default: String msg = "Unknown rolling period: " + rollingPeriod + " for Log: " + name(); log.error(msg); throw new IllegalArgumentException(msg); } }
Source:
public List<Variant> create(String fileId, String studyId, String line) throws IllegalArgumentException, NonVariantException, IncompleteInformationException { String[] fields = line.split("\t"); if (fields.length < 8) { throw new IllegalArgumentException("Not enough fields provided (min 8)"); } String[] alternateAlleles = getAlternateAlleles(fields); List<VariantCoreFields> generatedKeyFields = buildVariantCoreFields(fields, alternateAlleles); float quality = getQuality(fields); String filter = getFilter(fields); String info = getInfo(fields); String format = getFormat(fields); List<Variant> variants = new LinkedList<>(); for (int altAlleleIdx = 0; altAlleleIdx < alternateAlleles.length; altAlleleIdx++) { VariantCoreFields keyFields = generatedKeyFields.get(altAlleleIdx); Variant variant = new Variant(keyFields.getChromosome(), keyFields.getStart(), keyFields.getEnd(), keyFields.getReference(), keyFields.getAlternate()); String[] secondaryAlternates = getSecondaryAlternates(altAlleleIdx, alternateAlleles); VariantSourceEntry file = new VariantSourceEntry(fileId, studyId, secondaryAlternates, format); variant.addSourceEntry(file); parseSplitSampleData(file, fields, altAlleleIdx); setOtherFields(variant, fileId, studyId, quality, filter, info, altAlleleIdx, alternateAlleles, line); checkVariantInformation(variant, fileId, studyId); variants.add(variant); } return variants; }

Target:
public List<Variant> create(String fileId, String studyId, String line) throws IllegalArgumentException, NonVariantException, IncompleteInformationException { String[] fields = line.split("\t"); if (fields.length < 8) { throw new IllegalArgumentException("Not enough fields provided (min 8)"); } String chromosome = getChromosomeWithoutPrefix(fields); int position = getPosition(fields); String reference = getReference(fields); String[] alternateAlleles = getAlternateAlleles(fields); float quality = getQuality(fields); String filter = getFilter(fields); String info = getInfo(fields); String format = getFormat(fields); List<VariantCoreFields> generatedKeyFields = buildVariantCoreFields(chromosome, position, reference, alternateAlleles); List<Variant> variants = new LinkedList<>(); for (int altAlleleIdx = 0; altAlleleIdx < alternateAlleles.length; altAlleleIdx++) { VariantCoreFields keyFields = generatedKeyFields.get(altAlleleIdx); Variant variant = new Variant(chromosome, keyFields.getStart(), keyFields.getEnd(), keyFields.getReference(), keyFields.getAlternate()); String[] secondaryAlternates = getSecondaryAlternates(altAlleleIdx, alternateAlleles); VariantSourceEntry file = new VariantSourceEntry(fileId, studyId, secondaryAlternates, format); variant.addSourceEntry(file); parseSplitSampleData(file, fields, altAlleleIdx); setOtherFields(variant, fileId, studyId, quality, filter, info, altAlleleIdx, alternateAlleles, line); checkVariantInformation(variant, fileId, studyId); variants.add(variant); } return variants; }
Source:
public String getScript(String inMoovServiceName) { return String.format((Locale)null,"%s.moveTorso(%.2f,%.2f,%.2f)\n", inMoovServiceName, topStom.getPos(), midStom.getPos(), lowStom.getPos()); }

Target:
public String getScript(String inMoovServiceName) { return String.format(Locale.ENGLISH,"%s.moveTorso(%.2f,%.2f,%.2f)\n", inMoovServiceName, topStom.getPos(), midStom.getPos(), lowStom.getPos()); }
Source:
public void execute(String[] args, ConsoleReader reader) throws Exception { String containerLongId = getContainerLongId(args[1]); if (containerLongId == null) { throw new CliException("Container " + args[1] + " not found"); } JSONObject response; try { response = getResource(StramWebServices.PATH_PHYSICAL_PLAN_CONTAINERS + "/" + args[1] + "/" + StramWebServices.PATH_STACKTRACE, currentApp); } catch (Exception ex) { response = new JSONObject(ex.toString()); } printJson(response); }

Target:
public void execute(String[] args, ConsoleReader reader) throws Exception { String containerLongId = getContainerLongId(args[1]); if (containerLongId == null) { throw new CliException("Container " + args[1] + " not found"); } JSONObject response; try { response = getResource(StramWebServices.PATH_PHYSICAL_PLAN_CONTAINERS + "/" + args[1] + "/" + StramWebServices.PATH_STACKTRACE, currentApp); } catch (Exception ex) { throw new CliException("Webservice call to AppMaster failed.", ex); } printJson(response); }
Source:
byte lookAhead() throws IOException { if(head == READ_NEXT) { if(ensure(1)) head = buffer.getByte(position); } return head; }

Target:
byte lookAhead() throws IOException { if(head == READ_NEXT) { if(ensure(1)) head = buffer.getByte(position); else throw new EOFException(); } return head; }
Source:
public Long getDbGeneration() { return vmStatic.getDbGeneration(); }

Target:
public long getDbGeneration() { return vmStatic.getDbGeneration(); }
Source:
boolean isModified() { return modified; }

Target:
boolean isModified() { readLock.lock(); try { return modified; } finally { readLock.unlock(); } }
Source:
public static void combine(@AggregationState NullableDoubleState state, @AggregationState NullableDoubleState otherState) { if (state.isNull()) { state.setNull(false); state.setDouble(otherState.getDouble()); } else { state.setDouble(state.getDouble() + otherState.getDouble()); } }

Target:
public static void combine(@AggregationState NullableDoubleState state, @AggregationState NullableDoubleState otherState) { if (state.isNull()) { state.setNull(false); state.setDouble(otherState.getDouble()); return; } state.setDouble(state.getDouble() + otherState.getDouble()); }
Source:
void setText (String dateTimeText) { if (dateTimeText != null){ byte dateTimeConverted = Converter.wcsToMbcs (dateTimeText, true); GTK.gtk_entry_set_width_chars (textEntryHandle, dateTimeText.length ()); GTK.gtk_entry_set_text (textEntryHandle, dateTimeConverted); if (popupCalendar != null && calendar != null) { try { Date parse = dateFormat.parse(dateTimeText); Calendar clone = (Calendar) calendar.clone(); clone.setTime(parse); popupCalendar.setDate (clone.get(Calendar.YEAR), clone.get(Calendar.MONTH), clone.get(Calendar.DAY_OF_MONTH)); } catch(Exception e) { } } } }

Target:
void setText (String dateTimeText) { if (dateTimeText != null){ byte dateTimeConverted = Converter.wcsToMbcs (dateTimeText, true); GTK.gtk_entry_set_width_chars (textEntryHandle, dateTimeText.length ()); GTK.gtk_entry_set_text (textEntryHandle, dateTimeConverted); if (popupCalendar != null && calendar != null) { Date parse; try { parse = dateFormat.parse(dateTimeText); } catch(ParseException e) { return; } Calendar clone = (Calendar) calendar.clone(); clone.setTime(parse); try { popupCalendar.setDate (clone.get(Calendar.YEAR), clone.get(Calendar.MONTH), clone.get(Calendar.DAY_OF_MONTH)); } catch(SWTException e) { if (e.code == SWT.ERROR_WIDGET_DISPOSED) { return; } throw e; } } } }
Source:
private ReadBuffer(ByteBuffer byteBuffer, int limit) { this.byteBuffer = byteBuffer; this.origin = byteBuffer.position(); this.limit = origin + limit; if (this.limit > byteBuffer.capacity()) { throw new LimitReachedException(); } }

Target:
private ReadBuffer(ByteBuffer byteBuffer, int limit) { this.byteBuffer = byteBuffer; this.limit = byteBuffer.position() + limit; if (this.limit > byteBuffer.capacity()) { throw new LimitReachedException(); } }
Source:
public @NonNull Iterable<@NonNull ISegmentAspect> getSegmentAspects() { ImmutableList<@NonNull ISegmentAspect> of = ImmutableList.of(new HelloAspect()); assertNotNull(of); return of; }

Target:
public @NonNull Iterable<@NonNull ISegmentAspect> getSegmentAspects() { ImmutableList<@NonNull ISegmentAspect> aspectList = ImmutableList.of(new HelloAspect()); assertNotNull(aspectList); return aspectList; }
Source:
private void handleFinalizingSuccess(final StateContext context) { log.info("Finalizing successful transfer for {}", getTransferDescription()); ImageStatus nextImageStatus; if (stopImageTransferSession(context.entity)) { Guid transferingVdsId = context.entity.getVdsId(); if (getParameters().getTransferType() == TransferType.Download) { nextImageStatus = ImageStatus.OK; updateEntityPhase(ImageTransferPhase.FINISHED_SUCCESS); setAuditLogTypeFromPhase(ImageTransferPhase.FINISHED_SUCCESS); } else if (verifyImage(transferingVdsId)) { setVolumeLegalityInStorage(LEGAL_IMAGE); if (getDiskImage().getVolumeFormat().equals(VolumeFormat.COW)) { setQcowCompat(getDiskImage().getImage(), getStoragePool().getId(), getDiskImage().getId(), getDiskImage().getImageId(), getStorageDomainId(), transferingVdsId); imageDao.update(getDiskImage().getImage()); } nextImageStatus = ImageStatus.OK; updateEntityPhase(ImageTransferPhase.FINISHED_SUCCESS); setAuditLogTypeFromPhase(ImageTransferPhase.FINISHED_SUCCESS); } else { nextImageStatus = ImageStatus.ILLEGAL; updateEntityPhase(ImageTransferPhase.FINALIZING_FAILURE); } tearDownImage(context.entity.getVdsId()); setImageStatus(nextImageStatus); } }

Target:
private void handleFinalizingSuccess(final StateContext context) { log.info("Finalizing successful transfer for {}", getTransferDescription()); ImageStatus nextImageStatus = ImageStatus.OK; if (stopImageTransferSession(context.entity)) { Guid transferingVdsId = context.entity.getVdsId(); if (getParameters().getTransferType() == TransferType.Download) { updateEntityPhase(ImageTransferPhase.FINISHED_SUCCESS); setAuditLogTypeFromPhase(ImageTransferPhase.FINISHED_SUCCESS); } else if (verifyImage(transferingVdsId)) { setVolumeLegalityInStorage(LEGAL_IMAGE); if (getDiskImage().getVolumeFormat().equals(VolumeFormat.COW)) { setQcowCompat(getDiskImage().getImage(), getStoragePool().getId(), getDiskImage().getId(), getDiskImage().getImageId(), getStorageDomainId(), transferingVdsId); imageDao.update(getDiskImage().getImage()); } updateEntityPhase(ImageTransferPhase.FINISHED_SUCCESS); setAuditLogTypeFromPhase(ImageTransferPhase.FINISHED_SUCCESS); } else { nextImageStatus = ImageStatus.ILLEGAL; updateEntityPhase(ImageTransferPhase.FINALIZING_FAILURE); } tearDownImage(context.entity.getVdsId()); setImageStatus(nextImageStatus); } }
Source:
public PageResult<Installation> findInstallationsByVariant(String variantID, Integer page, Integer pageSize) { CriteriaBuilder builder = entityManager.getCriteriaBuilder(); CriteriaQuery<Installation> query = builder.createQuery(Installation.class); Root<Installation> v = query.from(Installation.class); final Join join = v.join("variant"); final Predicate[] predicates = new Predicate[]{builder.equal(join.get("variantID"), variantID)}; query.where(predicates); List<Installation> result = entityManager.createQuery(query) .setFirstResult(page * pageSize).setMaxResults(pageSize).getResultList(); CriteriaQuery<Long> countQuery = builder.createQuery(Long.class); final Join<Object, Object> join1 = countQuery.from(Installation.class).join("variant"); countQuery.where(new Predicate[]{builder.equal(join1.get("variantID"), variantID)}); final Long count = entityManager.createQuery(countQuery.select(builder.count(join1))).getSingleResult(); return new PageResult<Installation>(result, count); }

Target:
public PageResult<Installation> findInstallationsByVariant(String variantID, Integer page, Integer pageSize) { return findInstallationsByVariantForDeveloper(variantID, null, page, pageSize); }
Source:
Builder setFilterSpec(@NonNull FilterSpec filter) { filterSpec = filter; return this; }

Target:
Builder setFilterSpec(@NonNull FilterSpec filter) { filterSpec = requireNonNull(filter); return this; }
Source:
public void setUp() throws Exception { this.conf = new TajoConf(); util = new TajoTestingCluster(); catalog = util.startCatalogCluster().getCatalog(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(TajoConstants.DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); conf.setVar(TajoConf.ConfVars.WORKER_TEMPORAL_DIR, testDir.toString()); Schema schema = new Schema(); schema.addColumn("managerid", Type.INT4); schema.addColumn("empid", Type.INT4); schema.addColumn("deptname", Type.TEXT); TableMeta employeeMeta = CatalogUtil.newTableMeta("CSV"); Path employeePath = new Path(testDir, "employee.csv"); Appender appender = ((FileTablespace) TablespaceManager.getLocalFs()) .getAppender(employeeMeta, schema, employeePath); appender.enableStats(); appender.init(); VTuple tuple = new VTuple(schema.size()); for (int i = 0; i < numTuple; i++) { tuple.put(new Datum[] { DatumFactory.createInt4(rnd.nextInt(50)), DatumFactory.createInt4(rnd.nextInt(100)), DatumFactory.createText("dept_" + i), }); appender.addTuple(tuple); } appender.flush(); appender.close(); if (LOG.isDebugEnabled()) { LOG.debug(appender.getStats().getNumRows() + " rows (" + (appender.getStats().getNumBytes() / 1048576) + " MB)"); } employee = new TableDesc("default.employee", schema, employeeMeta, employeePath.toUri()); catalog.createTable(employee); analyzer = new SQLAnalyzer(); planner = new LogicalPlanner(catalog, TablespaceManager.getInstance()); }

Target:
public void setUp() throws Exception { this.conf = new TajoConf(); util = new TajoTestingCluster(); catalog = util.startCatalogCluster().getCatalog(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(TajoConstants.DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); conf.setVar(TajoConf.ConfVars.WORKER_TEMPORAL_DIR, testDir.toString()); Schema schema = new Schema(); schema.addColumn("managerid", Type.INT4); schema.addColumn("empid", Type.INT4); schema.addColumn("deptname", Type.TEXT); TableMeta employeeMeta = CatalogUtil.newTableMeta("CSV"); Path employeePath = new Path(testDir, "employee.csv"); Appender appender = ((FileTablespace) TablespaceManager.getLocalFs()) .getAppender(employeeMeta, schema, employeePath); appender.enableStats(); appender.init(); VTuple tuple = new VTuple(schema.size()); for (int i = 0; i < numTuple; i++) { tuple.put(new Datum[] { DatumFactory.createInt4(rnd.nextInt(50)), DatumFactory.createInt4(rnd.nextInt(100)), DatumFactory.createText("dept_" + i), }); appender.addTuple(tuple); } appender.flush(); appender.close(); employee = new TableDesc("default.employee", schema, employeeMeta, employeePath.toUri()); catalog.createTable(employee); analyzer = new SQLAnalyzer(); planner = new LogicalPlanner(catalog, TablespaceManager.getInstance()); }
Source:
public boolean modifyHSM(VeluxBridge bridge, boolean enableService) { logger.trace("modifyHSM({}) called.", enableService); ModifyHouseStatusMonitor bcp = bridge.bridgeAPI().modifyHouseStatusMonitor(); bcp.serviceActivation(enableService); if ((bridge.bridgeCommunicate(bcp)) && (bcp.isCommunicationSuccessful())) { logger.debug("modifyHSM() finished successfully."); return true; } else { logger.trace("modifyHSM() finished with failure."); return false; } }

Target:
public boolean modifyHSM(VeluxBridge bridge, boolean enableService) { logger.trace("modifyHSM({}) called.", enableService); ModifyHouseStatusMonitor bcp = bridge.bridgeAPI().modifyHouseStatusMonitor(); bcp.serviceActivation(enableService); if (bridge.bridgeCommunicate(bcp) && bcp.isCommunicationSuccessful()) { logger.debug("modifyHSM() finished successfully."); return true; } else { logger.trace("modifyHSM() finished with failure."); return false; } }
Source:
public Stream<DocumentWriteOperation> splitWriteOperations(InputStream input) throws Exception { if (input == null) { throw new IllegalArgumentException("Input cannot be null"); } return splitWriteOperations(input, null); }

Target:
public Stream<DocumentWriteOperation> splitWriteOperations(InputStream input) throws Exception { return splitWriteOperations(input, null); }