auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateEscalationEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_INCOME_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertEscalationEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, ""); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }

Target:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateEscalationEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_INCOME_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertEscalationEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
public RiemannOutputPlugin( @JsonProperty("flushInterval") Optional<Long> flushInterval, @JsonProperty("protocol") ProtocolFactory protocol, @JsonProperty("retry") RetryPolicy retry, @JsonProperty("filter") Optional<Filter> filter ) { super("", filter, flushInterval.isPresent() ? flushInterval : Optional.of(DEFAULT_FLUSH_INTERVAL)); this.protocol = Optional .ofNullable(protocol) .orElseGet(ProtocolFactory.defaultFor()) .protocol(DEFAULT_PROTOCOL, DEFAULT_PORT); this.protocolClient = parseProtocolClient(); this.retry = Optional.ofNullable(retry).orElseGet(RetryPolicy.Exponential::new); }

Target:
public RiemannOutputPlugin( @JsonProperty("flushInterval") Optional<Long> flushInterval, @JsonProperty("protocol") ProtocolFactory protocol, @JsonProperty("retry") RetryPolicy retry, @JsonProperty("filter") Optional<Filter> filter ) { super(filter, flushInterval); this.protocol = Optional .ofNullable(protocol) .orElseGet(ProtocolFactory.defaultFor()) .protocol(DEFAULT_PROTOCOL, DEFAULT_PORT); this.protocolClient = parseProtocolClient(); this.retry = Optional.ofNullable(retry).orElseGet(RetryPolicy.Exponential::new); }
Source:
private boolean isIgnoringSomething() { return ignoreBadRelationships | ignoreDuplicateNodes | ignoreExtraColumns; }

Target:
private boolean isIgnoringSomething() { return ignoreBadRelationships || ignoreDuplicateNodes || ignoreExtraColumns; }
Source:
public static boolean textContains(String actual, String text, boolean ignoreCase) { return ignoreCase ? StringUtils.containsIgnoreCase(actual, text) : StringUtils.contains(actual, text); }

Target:
private boolean textContains(String actual, String text, boolean ignoreCase) { return ignoreCase ? StringUtils.containsIgnoreCase(actual, text) : StringUtils.contains(actual, text); }
Source:
public Event complianceCreated(Consumer consumer, Set<Entitlement> entitlements, ComplianceStatus compliance) { return new Event(Event.Type.CREATED, Event.Target.COMPLIANCE, consumer.getName(), principalProvider.get(), consumer.getOwner().getId(), consumer.getUuid(), consumer.getId(), null, buildComplianceDataJson(consumer, entitlements, compliance), null, null); }

Target:
public Event complianceCreated(Consumer consumer, Set<Entitlement> entitlements, ComplianceStatus compliance) { return new Event(Event.Type.CREATED, Event.Target.COMPLIANCE, consumer.getName(), principalProvider.get(), consumer.getOwner().getId(), consumer.getUuid(), consumer.getUuid(), null, buildComplianceDataJson(consumer, entitlements, compliance), null, null); }
Source:
public void modifyJob() throws IOException, SignatureException, XmlProcessingException, URISyntaxException { final String bucketName = "test_modify_job"; try { client.putBucket(new PutBucketRequest(bucketName)); List<Ds3Object> objects = new ArrayList<>(); final File objFile = ResourceUtils.loadFileResource("books/beowulf.txt"); final Ds3Object obj = new Ds3Object("beowulf.txt", objFile.length()); objects.add(obj); WriteJobOptions jobOptions = WriteJobOptions.create().withPriority(Priority.LOW); Ds3ClientHelpers.Job job = com.spectralogic.ds3client.helpers.Ds3ClientHelpers .wrap(client).startWriteJob(bucketName, objects, jobOptions); client.modifyJob(new ModifyJobRequest(job.getJobId()).withPriority(Priority.HIGH)); GetJobResponse response = client.getJob(new GetJobRequest(job.getJobId())); assertThat(response.getMasterObjectList().getPriority(), is(Priority.HIGH)); } finally { Util.deleteAllContents(client, bucketName); } }

Target:
public void modifyJob() throws IOException, SignatureException, XmlProcessingException, URISyntaxException { final String bucketName = "test_modify_job"; try { client.putBucket(new PutBucketRequest(bucketName)); final List<Ds3Object> objects = new ArrayList<>(); final Ds3Object obj = new Ds3Object("test", 2); objects.add(obj); final WriteJobOptions jobOptions = WriteJobOptions.create().withPriority(Priority.LOW); final Ds3ClientHelpers.Job job = com.spectralogic.ds3client.helpers.Ds3ClientHelpers .wrap(client).startWriteJob(bucketName, objects, jobOptions); client.modifyJob(new ModifyJobRequest(job.getJobId()).withPriority(Priority.HIGH)); final GetJobResponse response = client.getJob(new GetJobRequest(job.getJobId())); assertThat(response.getMasterObjectList().getPriority(), is(Priority.HIGH)); } finally { Util.deleteAllContents(client, bucketName); } }
Source:
public Result configuration(String configuration_id) { RecipeViewModel viewModel = new RecipeViewModel(); FrontEndDatabase f = new FrontEndDatabase(); String[] configInfo = f.getConfigInformation(Integer.parseInt(configuration_id)); models.Configuration conf = new models.Configuration(configInfo[0], configInfo[1], configInfo[2], configInfo[3], configInfo[4], configInfo[5]); List<Record> records = new ArrayList<>(); records.add(new Record("date", "comment", "repo", "author",95.1)); records.add(new Record("date2", "comment", "repo", "author",36.1)); records.add(new Record("date3", "comment", "repo", "author",97.1)); conf.records = records; viewModel.configuration = conf; viewModel.history = "history B"; return ok(recipe.render(viewModel)); }

Target:
public Result configuration(String configuration_id) { RecipeViewModel viewModel = new RecipeViewModel(); FrontEndDatabase f = new FrontEndDatabase(); models.Configuration conf = f.getConfigInformation(Integer.parseInt(configuration_id)); List<Record> records = new ArrayList<>(); records.add(new Record("date", "comment", "repo", "author",95.1)); records.add(new Record("date2", "comment", "repo", "author",36.1)); records.add(new Record("date3", "comment", "repo", "author",97.1)); conf.records = records; viewModel.configuration = conf; viewModel.history = "history B"; return ok(recipe.render(viewModel)); }
Source:
protected BatchInsert newBatchInsert(PluginTask task, Optional<MergeConfig> mergeConfig) throws IOException, SQLException { if (mergeConfig.isPresent()) { throw new UnsupportedOperationException("Redshift output plugin doesn't support 'merge_direct' mode. Use 'merge' mode instead."); } RedshiftPluginTask t = (RedshiftPluginTask) task; setAWSCredentialsBackwardCompatibility(t); return new RedshiftCopyBatchInsert(getConnector(task, true), getAWSCredentialsProvider(t), t.getS3Bucket(), t.getS3KeyPrefix(), t.getIamUserName(), t.getDeleteS3TempFile(), t.getCopyIamRoleName().or(""), t.getCopyAwsAccountId().or("")); }

Target:
protected BatchInsert newBatchInsert(PluginTask task, Optional<MergeConfig> mergeConfig) throws IOException, SQLException { if (mergeConfig.isPresent()) { throw new UnsupportedOperationException("Redshift output plugin doesn't support 'merge_direct' mode. Use 'merge' mode instead."); } RedshiftPluginTask t = (RedshiftPluginTask) task; setAWSCredentialsBackwardCompatibility(t); return new RedshiftCopyBatchInsert(getConnector(task, true), getAWSCredentialsProvider(t), t.getS3Bucket(), t.getS3KeyPrefix(), t.getIamUserName(), t.getDeleteS3TempFile(), t.getCopyIamRoleName().orNull(), t.getCopyAwsAccountId().orNull()); }
Source:
public void setUp() { generator = new LargeCommitWarningGenerator(repositoriesApi); when(commit.getRepository()).thenReturn(configurable); when(commit.getRepository().getRepositoryName()).thenReturn(REPOSITORY_NAME); when(commit.getCommitId()).thenReturn(COMMIT_ID); when(commit.isMerge()).thenReturn(false); when(abstractCommitWarningGenerator.getRepository(commit)).thenReturn(repositoryApi); when(abstractCommitWarningGenerator.getGitCommit(commit)).thenReturn(commitApi); when(repositoriesApi.getRepository(REPOSITORY_NAME)).thenReturn(repositoryApi); when(repositoryApi.getCommit(COMMIT_ID)).thenReturn(commitApi); when(commitApi.diff()).thenReturn(diffModel); when(diffModel.getDiffs()).thenReturn(diffs); when(diffs.stream()).thenReturn(stream); when(stream.filter(anyObject())).thenReturn(stream); when(stream.flatMap(anyObject())).thenReturn(objectStream); when(objectStream.flatMap(anyObject())).thenReturn(objectStream); when(objectStream.filter(anyObject())).thenReturn(objectStream); LargeCommitWarning warning = new LargeCommitWarning(); warning.setCommit(commit); testEquals = Sets.newHashSet(warning); }

Target:
public void setUp() throws IOException { generator = new LargeCommitWarningGenerator(repositoriesApi); repository = new PrivateRepository(); repository.setRepositoryName(REPOSITORY_NAME); commit = new Commit(); commit.setRepository(repository); commit.setCommitId(COMMIT_ID); commit.setParents(Lists.newArrayList()); diffModel = new DiffModel(); when(repositoriesApi.getRepository(anyString())).thenReturn(repositoryApi); when(repositoryApi.getCommit(anyString())).thenReturn(commitApi); when(commitApi.diff()).thenReturn(diffModel); ObjectMapper mapper = new ObjectMapper(); diffFile = mapper.readValue( LargeCommitWarningGeneratorTest.class.getResourceAsStream("/test-diff.json"), AbstractDiffModel.DiffFile.class ); diffModel.setDiffs(Lists.newArrayList(diffFile)); LargeCommitWarning warning = new LargeCommitWarning(); warning.setCommit(commit); testEquals = Sets.newHashSet(warning); }
Source:
public KnoxShellTable url(String url) throws IOException { int rowIndex = 0; KnoxShellTable table = null; URL urlToCsv = new URL(url); URLConnection connection = urlToCsv.openConnection(); try (BufferedReader csvReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8));) { table = new KnoxShellTable(); if (title != null) { table.title(title); } table.id(id); String row = null; while ((row = csvReader.readLine()) != null) { boolean addingHeaders = (withHeaders && rowIndex == 0); if (!addingHeaders) { table.row(); } String[] data = row.split(","); for (String value : data) { if (addingHeaders) { table.header(value); } else { table.value(value); } } rowIndex++; } } return table; }

Target:
public KnoxShellTable url(String url) throws IOException { int rowIndex = 0; KnoxShellTable table = null; URL urlToCsv = new URL(url); URLConnection connection = urlToCsv.openConnection(); try (Reader urlConnectionStreamReader = new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8); BufferedReader csvReader = new BufferedReader(urlConnectionStreamReader);) { table = new KnoxShellTable(); if (title != null) { table.title(title); } table.id(id); String row = null; while ((row = csvReader.readLine()) != null) { boolean addingHeaders = (withHeaders && rowIndex == 0); if (!addingHeaders) { table.row(); } String[] data = row.split(","); for (String value : data) { if (addingHeaders) { table.header(value); } else { table.value(value); } } rowIndex++; } } return table; }
Source:
private void verifyThemeDirectoryExistence() throws ExecutionFailedException { File themesDir = new File (frontendDirectory, APP_THEMES_FOLDER_NAME); File customThemeDir = new File (themesDir, theme.getName()); if (!customThemeDir.exists()) { String errorMessage = "Discovered @Theme(\"%s\") annotation but " + "no \"%s/%s/%s/\" directory present in the " + "project or available or inside a jar dependency for the " + "app. Check if you forgot to create the folder or have " + "typo in the theme or folder name \"%s\"."; throw new ExecutionFailedException(String.format(errorMessage, theme.getName(), frontendDirectory.getName(), APP_THEMES_FOLDER_NAME, theme.getName(), theme.getName())); } }

Target:
private void verifyThemeDirectoryExistence() throws ExecutionFailedException { String themeName = theme.getName(); String themePath = String.join("/", APPLICATION_THEME_ROOT, themeName); List<String> appThemePossiblePaths = getAppThemePossiblePaths( themePath); List<File> existingAppThemeDirectories = appThemePossiblePaths.stream() .map(path -> new File(npmFolder, path)) .filter(File::exists) .collect(Collectors.toList()); if (existingAppThemeDirectories.isEmpty()) { String errorMessage = "Discovered @Theme annotation with theme " + "name '%s', but could not find the theme directory " + "in the project or available as a jar dependency. " + "Check if you forgot to create the folder under '%s' " + "or have mistyped the theme or folder name for '%s'."; throw new ExecutionFailedException( String.format(errorMessage, themeName, new File(frontendDirectory, APPLICATION_THEME_ROOT) .getPath(), themeName)); } if (existingAppThemeDirectories.size() >= 2) { boolean themeFoundInJar = existingAppThemeDirectories .stream().map(File::getPath) .anyMatch(path -> path .contains(FrontendUtils.FLOW_NPM_PACKAGE_NAME)); if (themeFoundInJar) { String errorMessage = "Theme '%s' should not exist inside a " + "jar and in the project at the same time.%n" + "Extending another theme is possible by adding " + "{ \"parent\": \"your-parent-theme\" } entry to the " + "'theme.json' file inside your theme folder."; throw new ExecutionFailedException( String.format(errorMessage, themeName)); } else { String errorMessage = "Discovered Theme folder for theme '%s' " + "in more than one place in the project. Please " + "make sure there is only one theme folder with name " + "'%s' exists in the your project. " + "The recommended place to put the theme folder " + "inside the project is '%s'"; throw new ExecutionFailedException(String.format(errorMessage, themeName, themeName, new File(frontendDirectory, APPLICATION_THEME_ROOT) .getPath())); } } }
Source:
public void copyColumnsFrom(QueryModel other) { clearColumnMapStructs(); this.aliasToColumnMap.putAll(other.aliasToColumnMap); ObjList<CharSequence> columnNames = other.bottomUpColumnNames; this.bottomUpColumnNames.addAll(columnNames); for (int i = 0, n = columnNames.size(); i < n; i++) { final CharSequence name = columnNames.getQuick(i); this.aliasToColumnNameMap.put(Chars.toLowerCase(name), Chars.toLowerCase(name)); } }

Target:
public void copyColumnsFrom(QueryModel other) { clearColumnMapStructs(); this.aliasToColumnMap.putAll(other.aliasToColumnMap); ObjList<CharSequence> columnNames = other.bottomUpColumnNames; this.bottomUpColumnNames.addAll(columnNames); for (int i = 0, n = columnNames.size(); i < n; i++) { final CharSequence name = columnNames.getQuick(i); this.aliasToColumnNameMap.put(name, name); } }
Source:
protected boolean canDoAction() { if (getVmTemplate() != null) { setDescription(getVmTemplateName()); } if (!VmTemplateHandler.verifyVmTemplateStatusForUse(getVmTemplateId(), false)) { getReturnValue().getCanDoActionMessages() .add(VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED.toString()); } StorageDomainValidator storageDomainValidator = new StorageDomainValidator(getStorageDomain()); boolean retVal = storageDomainValidator.isDomainExistAndActive(getReturnValue().getCanDoActionMessages()); if (retVal) { if (getStorageDomain().getstorage_domain_type() != StorageDomainType.ImportExport) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_SPECIFY_DOMAIN_IS_NOT_EXPORT_DOMAIN); retVal = false; } } retVal = retVal && super.canDoAction(); if (retVal && !getParameters().getForceOverride()) { retVal = !ExportVmCommand.CheckTemplateInStorageDomain(getVmTemplate().getstorage_pool_id().getValue(), getParameters().getStorageDomainId(), getVmTemplateId()); if (!retVal) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NAME_ALREADY_EXISTS); } } return retVal; }

Target:
protected boolean canDoAction() { if (getVmTemplate() != null) { setDescription(getVmTemplateName()); } if (!VmTemplateHandler.isTemplateStatusIsNotLocked(getVmTemplateId())) { getReturnValue().getCanDoActionMessages() .add(VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED.toString()); } StorageDomainValidator storageDomainValidator = new StorageDomainValidator(getStorageDomain()); boolean retVal = storageDomainValidator.isDomainExistAndActive(getReturnValue().getCanDoActionMessages()); if (retVal) { if (getStorageDomain().getstorage_domain_type() != StorageDomainType.ImportExport) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_SPECIFY_DOMAIN_IS_NOT_EXPORT_DOMAIN); retVal = false; } } retVal = retVal && super.canDoAction(); if (retVal && !getParameters().getForceOverride()) { retVal = !ExportVmCommand.CheckTemplateInStorageDomain(getVmTemplate().getstorage_pool_id().getValue(), getParameters().getStorageDomainId(), getVmTemplateId()); if (!retVal) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NAME_ALREADY_EXISTS); } } return retVal; }
Source:
public List<String> buildDirtyList(Map<String, String> pathVars, HttpServletRequest request, String id) { List<String> dirtyList = new ArrayList<>(); String sectionKey = getSectionKey(pathVars); String sectionClassName = getClassNameForSection(sectionKey); List<SectionCrumb> sectionCrumbs = getSectionCrumbs(request, sectionKey, id); PersistencePackageRequest ppr = getSectionPersistencePackageRequest(sectionClassName, sectionCrumbs, pathVars); ClassMetadata cmd = null; Entity entity = null; try { cmd = service.getClassMetadata(ppr).getDynamicResultSet().getClassMetaData(); entity = service.getRecord(ppr, id, cmd, false).getDynamicResultSet().getRecords()[0]; } catch (ServiceException e) { return null; } for (Property p: entity.getProperties()) { if (p.getIsDirty()) { dirtyList.add(p.getName()); } } return dirtyList; }

Target:
public List<String> buildDirtyList(Map<String, String> pathVars, HttpServletRequest request, String id) throws ServiceException { List<String> dirtyList = new ArrayList<>(); String sectionKey = getSectionKey(pathVars); String sectionClassName = getClassNameForSection(sectionKey); List<SectionCrumb> sectionCrumbs = getSectionCrumbs(request, sectionKey, id); PersistencePackageRequest ppr = getSectionPersistencePackageRequest(sectionClassName, sectionCrumbs, pathVars); ClassMetadata cmd = null; Entity entity = null; cmd = service.getClassMetadata(ppr).getDynamicResultSet().getClassMetaData(); entity = service.getRecord(ppr, id, cmd, false).getDynamicResultSet().getRecords()[0]; for (Property p: entity.getProperties()) { if (p.getIsDirty()) { dirtyList.add(p.getName()); } } return dirtyList; }
Source:
public void add(Expression expression) { if (fExpressions == null) fExpressions= new ArrayList<Expression>(2); fExpressions.add(expression); }

Target:
public void add(Expression expression) { if (fExpressions == null) fExpressions= new ArrayList<>(2); fExpressions.add(expression); }
Source:
public static boolean isAlreadyPresent(ArrayList<Order> ordersPlaced, Order newOrder) { for (Order order : ordersPlaced) { if (((order instanceof BuyOrder) && (newOrder instanceof BuyOrder)) || ((order instanceof SellOrder) && (newOrder instanceof SellOrder))) { if (order.getStockSymbol().equals( newOrder.getStockSymbol())) { return true; } } } return false; }

Target:
public static boolean isAlreadyPresent(ArrayList<Order> ordersPlaced, Order newOrder) { for (Order order : ordersPlaced) { if (((order instanceof BuyOrder) && (newOrder instanceof BuyOrder)) or if ((order instanceof SellOrder) && (newOrder instanceof SellOrder))) { if (order.getStockSymbol().equals( newOrder.getStockSymbol())) { return true; } } } return false; }
Source:
public boolean filterParse(String text) { try { return classify(text); } catch (IOException e) { LOG.error("Error occured while classifying:: " + text); } return false; }

Target:
public boolean filterParse(String text) { try { return classify(text); } catch (IOException e) { LOG.error("Error occured while classifying:: " + text); e.printStackTrace(); } return false; }
Source:
public void zeroDepthObjects() throws Exception { generator = new GraphQlGenerator(getHtml("zeroDepthObjects.graphql"), null, param); String query = generator.generateFull(GraphQlGenerator.RequestType.QUERY); query = query.replaceAll("\\s+", " ").trim(); String expectedQuery = "{ gymName dumbbell { fixedWeight weight } treadmill { maxSpeed manufacturer } }"; assertEquals(query, expectedQuery); }

Target:
public void zeroDepthObjects() throws Exception { generator = new GraphQlGenerator(getHtml("zeroDepthObjects.graphql"), null, param); String query = generator.generateFull(GraphQlGenerator.RequestType.QUERY); String expectedQuery = "{ gymName dumbbell { fixedWeight weight } treadmill { maxSpeed manufacturer } } "; assertEquals(query, expectedQuery); }
Source:
public Hardware apply(final MachineTypeInZone input) { Location location = checkNotNull(getOnlyElement(filter(locations.get().values(), new Predicate<Location>() { @Override public boolean apply(Location l) { return l.getId().equals(input.getMachineType().getZone()); } })), "location for %s", input.getMachineType().getZone()); return new HardwareBuilder() .id(SlashEncodedIds.fromTwoIds(input.getMachineType().getZone(), input.getMachineType().getName()).slashEncode()) .location(location) .name(input.getMachineType().getName()) .hypervisor("kvm") .processor(new Processor(input.getMachineType().getGuestCpus(), 1.0)) .providerId(input.getMachineType().getId()) .ram(input.getMachineType().getMemoryMb()) .uri(input.getMachineType().getSelfLink()) .userMetadata(ImmutableMap.of("imageSpaceGb", Integer.toString(input.getMachineType().getImageSpaceGb()))) .volumes(collectVolumes(input.getMachineType())) .build(); }

Target:
public Hardware apply(final MachineTypeInZone input) { Iterable<? extends Location> zonesForMachineType = filter(locations.get().values(), new Predicate<Location>() { @Override public boolean apply(Location l) { return l.getId().equals(input.getMachineType().getZone()); } }); Location location = checkNotNull(getOnlyElement(zonesForMachineType), "location for %s", input.getMachineType().getZone()); return new HardwareBuilder() .id(SlashEncodedIds.fromTwoIds(input.getMachineType().getZone(), input.getMachineType().getName()).slashEncode()) .location(location) .name(input.getMachineType().getName()) .hypervisor("kvm") .processor(new Processor(input.getMachineType().getGuestCpus(), 1.0)) .providerId(input.getMachineType().getId()) .ram(input.getMachineType().getMemoryMb()) .uri(input.getMachineType().getSelfLink()) .userMetadata(ImmutableMap.of("imageSpaceGb", Integer.toString(input.getMachineType().getImageSpaceGb()))) .volumes(collectVolumes(input.getMachineType())) .supportsImage(input.getMachineType().getImageSpaceGb() > 0 ? Predicates.<Image>alwaysTrue() : Predicates.<Image>alwaysFalse()) .build(); }
Source:
public Object handleInvocationResult(final EJBClientInvocationContext context) throws Exception { final Object result; try { result = context.getResult(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } final EJBLocator<?> locator = context.getLocator(); if (locator.isStateful() && locator.getAffinity() instanceof ClusterAffinity && context.getWeakAffinity() == Affinity.NONE) { final Affinity targetAffinity = context.getTargetAffinity(); if (targetAffinity != null) { if (Logs.INVOCATION.isDebugEnabled()) { Logs.INVOCATION.debugf("DiscoveryEJBClientInterceptor: calling handleInvocationResult - staeful, clustered case, setting weakAffinity to targetAffinty = %s", targetAffinity); } context.setWeakAffinity(targetAffinity); } else { final URI destination = context.getDestination(); if (destination != null) { if (Logs.INVOCATION.isDebugEnabled()) { Logs.INVOCATION.debugf("DiscoveryEJBClientInterceptor: calling handleInvocationResult - stateful, clustered case, setting weakAffinity to URIAffintiy = %s", URIAffinity.forUri(destination)); } context.setWeakAffinity(URIAffinity.forUri(destination)); } } } return result; }

Target:
public Object handleInvocationResult(final EJBClientInvocationContext context) throws Exception { final Object result; try { result = context.getResult(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } final EJBLocator<?> locator = context.getLocator(); if (locator.isStateful() && locator.getAffinity() instanceof ClusterAffinity && context.getWeakAffinity() == Affinity.NONE) { final Affinity targetAffinity = context.getTargetAffinity(); if (targetAffinity != null) { if (Logs.INVOCATION.isDebugEnabled()) { Logs.INVOCATION.debugf("DiscoveryEJBClientInterceptor: calling handleInvocationResult - stateful, clustered case, setting weakAffinity to targetAffinty = %s", targetAffinity); } context.setWeakAffinity(targetAffinity); } else { final URI destination = context.getDestination(); if (destination != null) { if (Logs.INVOCATION.isDebugEnabled()) { Logs.INVOCATION.debugf("DiscoveryEJBClientInterceptor: calling handleInvocationResult - stateful, clustered case, setting weakAffinity to URIAffintiy = %s", URIAffinity.forUri(destination)); } context.setWeakAffinity(URIAffinity.forUri(destination)); } } } return result; }
Source:
public static void main(String[] args) { final MyMessageProcessor myMessageProcessor = new MyMessageProcessor(); ServiceBusMultiSessionProcessorClient multiSessionProcessorClient = new ServiceBusClientBuilder() .connectionString("connectionString") .multiSessionProcessor() .processMessage((receivedMessage, sessionManager) -> myMessageProcessor.onMessage(receivedMessage, sessionManager)) .processError(serviceBusErrorContext -> myMessageProcessor.onError(serviceBusErrorContext)) .receiveMode(ReceiveMode.PEEK_LOCK) .queueName("<<queue-name>>") .buildMultiSessionProcessorClient(); System.out.println("Starting message processor"); multiSessionProcessorClient.start(); System.out.println("Stopping message processor"); multiSessionProcessorClient.stop(); System.out.println("Exiting process"); }

Target:
public static void main(String[] args) { final MyStorageMessageProcessor myMessageProcessor = new MyStorageMessageProcessor(); String connectionString = System.getenv("AZURE_SERVICEBUS_CONNECTION_STRING"); String queueName = System.getenv("AZURE_SERVICEBUS_QUEUE_NAME"); ServiceBusReceiverAsyncClient multiSessionReceiverAsyncClient = new ServiceBusClientBuilder() .connectionString(connectionString) .receiver() .receiveMode(ReceiveMode.RECEIVE_AND_DELETE) .queueName(queueName) .maxConcurrentSessions(1) .buildAsyncClient(); final ReceiveAsyncOptions options = new ReceiveAsyncOptions() .setEnableAutoComplete(false) .setMaxAutoRenewDuration(Duration.ofSeconds(20)); Disposable subscription = multiSessionReceiverAsyncClient.receiveMultiSession(options) .flatMap(receivedMessage -> { System.out.println("!!! Received Message seq no "+ receivedMessage.getSequenceNumber() +" SessionId " + receivedMessage.getSessionId() + " Data : " + new String (receivedMessage.getBody())); if (receivedMessage.isSessionError()) { System.out.println("!!! Error Message session id" + receivedMessage.getServiceBusErrorContext().getSessionId()); return Mono.empty(); } return Mono.empty(); }).subscribe(); System.out.println(" Waiting for message to arrive .. "); try { Thread.sleep(Duration.ofSeconds(3 * 60).toMillis()); } catch (InterruptedException ignored) { } System.out.println(" !!! Test DONE !!! "); subscription.dispose(); multiSessionReceiverAsyncClient.close(); }
Source:
protected void internalInit(WebContext context) { CommonHelper.assertNotNull("ticketValidator", this.ticketValidator); if (this.ticketValidator instanceof InitializableObject) { ((InitializableObject) this.ticketValidator).init(); } }

Target:
protected void internalInit(WebContext context) { CommonHelper.assertNotNull("ticketValidator", this.ticketValidator); }
Source:
public FileInStream openFile(AlluxioURI path, OpenFilePOptions options) throws FileDoesNotExistException, OpenDirectoryException, FileIncompleteException, IOException, AlluxioException { checkUri(path); URIStatus status = getStatus(path, options); return openFileInStream(path, status, options); }

Target:
public FileInStream openFile(AlluxioURI path, OpenFilePOptions options) throws FileDoesNotExistException, OpenDirectoryException, FileIncompleteException, IOException, AlluxioException { checkUri(path); AlluxioConfiguration conf = mFsContext.getPathConf(path); URIStatus status = getStatus(path, FileSystemOptions.getStatusDefaults(conf).toBuilder() .setAccessMode(Bits.READ) .setUpdateTimestamps(options.getUpdateLastAccessTime()) .build()); if (status.isFolder()) { throw new OpenDirectoryException(path); } if (!status.isCompleted()) { throw new FileIncompleteException(path); } OpenFilePOptions mergedOptions = FileSystemOptions.openFileDefaults(conf) .toBuilder().mergeFrom(options).build(); InStreamOptions inStreamOptions = new InStreamOptions(status, mergedOptions, conf); return new FileInStream(status, inStreamOptions, mFsContext); }
Source:
public void processPacketAESCM(ByteArrayBuffer pkt) { int ssrc = RawPacket.getSSRC(pkt); int seqNo = RawPacket.getSequenceNumber(pkt); long index = (((long) guessedROC) << 16) | seqNo; ivStore[0] = saltKey[0]; ivStore[1] = saltKey[1]; ivStore[2] = saltKey[2]; ivStore[3] = saltKey[3]; int i; for (i = 4; i < 8; i++) { ivStore[i] = (byte) ( (0xFF & (ssrc >> ((7 - i) * 8))) ^ saltKey[i] ); } for (i = 8; i < 14; i++) { ivStore[i] = (byte) ( (0xFF & (byte) (index >> ((13 - i) * 8))) ^ saltKey[i] ); } ivStore[14] = ivStore[15] = 0; int payloadOffset = RawPacket.getHeaderLength(pkt.getBuffer(), pkt.getOffset(), pkt.getLength()); int payloadLength = pkt.getLength() - payloadOffset; cipherCtr.process( pkt.getBuffer(), pkt.getOffset() + payloadOffset, payloadLength, ivStore); }

Target:
public void processPacketAESCM(ByteArrayBuffer pkt) { int ssrc = RawPacket.getSSRC(pkt); int seqNo = RawPacket.getSequenceNumber(pkt); long index = (((long) guessedROC) << 16) | seqNo; ivStore[0] = saltKey[0]; ivStore[1] = saltKey[1]; ivStore[2] = saltKey[2]; ivStore[3] = saltKey[3]; int i; for (i = 4; i < 8; i++) { ivStore[i] = (byte) ( (0xFF & (ssrc >> ((7 - i) * 8))) ^ saltKey[i] ); } for (i = 8; i < 14; i++) { ivStore[i] = (byte) ( (0xFF & (byte) (index >> ((13 - i) * 8))) ^ saltKey[i] ); } ivStore[14] = ivStore[15] = 0; int rtpHeaderLength = RawPacket.getHeaderLength( pkt.getBuffer(), pkt.getOffset(), pkt.getLength()); cipherCtr.process( pkt.getBuffer(), pkt.getOffset() + rtpHeaderLength, pkt.getLength() - rtpHeaderLength, ivStore); }
Source:
private void decodeRowType6() throws IOException { if(optionByteAligned) resetBuffer(); decode2D(); }

Target:
private void decodeRowType6() throws IOException { if (optionByteAligned) { resetBuffer(); } decode2D(); }
Source:
public static void scheduleEvent(String thingUID, AstroThingHandler astroHandler, Calendar eventAt, List<String> events, String channelId, boolean configAlreadyApplied) { boolean thingNull = checkNull(thingUID, "Thing UID is null"); boolean astroHandlerNull = checkNull(astroHandler, "AstroThingHandler is null"); boolean eventAtNull = checkNull(eventAt, "Scheduled Instant is null"); boolean eventsNull = checkNull(events, "Events list is null"); boolean channelIdNull = checkNull(channelId, "Channel ID is null"); if (thingNull || astroHandlerNull || eventAtNull || eventsNull || channelIdNull || events.isEmpty()) { return; } Calendar instant = eventAt; if (!configAlreadyApplied) { AstroChannelConfig config = astroHandler.getThing().getChannel(channelId).getConfiguration() .as(AstroChannelConfig.class); instant = applyConfig(eventAt, config); } List<Job> jobs = events.stream().map(e -> new EventJob(thingUID, channelId, e)).collect(toList()); schedule(thingUID, astroHandler, new CompositeJob(thingUID, jobs), instant); }

Target:
public static void scheduleEvent(String thingUID, AstroThingHandler astroHandler, Calendar eventAt, List<String> events, String channelId, boolean configAlreadyApplied) { boolean thingNull = checkNull(thingUID, "Thing UID is null"); boolean astroHandlerNull = checkNull(astroHandler, "AstroThingHandler is null"); boolean eventAtNull = checkNull(eventAt, "Scheduled Instant is null"); boolean eventsNull = checkNull(events, "Events list is null"); boolean channelIdNull = checkNull(channelId, "Channel ID is null"); if (thingNull || astroHandlerNull || eventAtNull || eventsNull || channelIdNull || events.isEmpty()) { return; } final Calendar instant; if (!configAlreadyApplied) { AstroChannelConfig config = astroHandler.getThing().getChannel(channelId).getConfiguration() .as(AstroChannelConfig.class); instant = applyConfig(eventAt, config); } else { instant = eventAt; } List<Job> jobs = events.stream().map(e -> new EventJob(thingUID, channelId, e)).collect(toList()); schedule(thingUID, astroHandler, new CompositeJob(thingUID, jobs), instant); }
Source:
private RegisteredProject doImportInternally( String wsPath, SourceStorage sourceStorage, BiConsumer<String, String> jsonRpcConsumer) throws ServerException, ForbiddenException, UnauthorizedException, ConflictException, NotFoundException { String type = sourceStorage.getType(); ProjectImporter importer = projectImporterRegistry.getOrNull(type); fsManager.createDir(wsPath); try { importer.doImport(sourceStorage, wsPath, jsonRpcConsumer(wsPath, jsonRpcConsumer)); } catch (IOException e) { throw new ServerException(e); } if (projectSynchronizer .getAll() .stream() .anyMatch(it -> Objects.equals(it.getPath(), wsPath))) { Set<ProjectConfig> newProjectConfigs = projectSynchronizer .getAll() .stream() .filter(it -> wsPath.startsWith(it.getPath())) .collect(toSet()); for (ProjectConfig newProjectConfig : newProjectConfigs) { projectConfigRegistry.put(newProjectConfig, true, false); } return Optional.ofNullable(projectConfigRegistry.getOrNull(wsPath)) .orElseThrow(() -> new ServerException("Unexpected error")); } String name = wsPath.substring(wsPath.lastIndexOf(separator)); NewProjectConfigImpl newProjectConfig = new NewProjectConfigImpl(wsPath, name, BaseProjectType.ID, sourceStorage); RegisteredProject registeredProject = projectConfigRegistry.put(newProjectConfig, true, false); projectSynchronizer.synchronize(); return registeredProject; }

Target:
private RegisteredProject doImportInternally( String wsPath, SourceStorage sourceStorage, BiConsumer<String, String> jsonRpcConsumer) throws ServerException, ForbiddenException, UnauthorizedException, ConflictException, NotFoundException { String type = sourceStorage.getType(); ProjectImporter importer = projectImporterRegistry.getOrNull(type); fsManager.createDir(wsPath); try { importer.doImport(sourceStorage, wsPath, jsonRpcConsumer(wsPath, jsonRpcConsumer)); } catch (IOException e) { throw new ServerException(e); } if (projectSynchronizer .getAll() .stream() .anyMatch(it -> Objects.equals(it.getPath(), wsPath))) { Set<ProjectConfig> newProjectConfigs = projectSynchronizer .getAll() .stream() .filter(it -> wsPath.startsWith(it.getPath())) .collect(toSet()); for (ProjectConfig newProjectConfig : newProjectConfigs) { projectConfigRegistry.put(newProjectConfig, true, false); } return projectConfigRegistry .get(wsPath) .orElseThrow(() -> new ServerException("Unexpected error")); } String name = wsPath.substring(wsPath.lastIndexOf(separator)); NewProjectConfigImpl newProjectConfig = new NewProjectConfigImpl(wsPath, name, BaseProjectType.ID, sourceStorage); RegisteredProject registeredProject = projectConfigRegistry.put(newProjectConfig, true, false); projectSynchronizer.synchronize(); return registeredProject; }
Source:
public void dispose() { if (getTarget() != null) { getTarget().removeResourceSetListener(this); } dTreeViewer = null; }

Target:
public void dispose() { if (getTarget() != null) { getTarget().removeResourceSetListener(this); } dTreeViewer = null; toExpand = null; toCollapse = null; toRefreshInViewer = null; toUpdateInViewer = null; }
Source:
public Element build(final CallbackProperties properties) throws SAMLAssertionBuilderException { LOG.debug("SamlCallbackHandler.createHOKSAMLAssertion20()"); Element signedAssertion = null; try { Assertion assertion; assertion = OpenSAML2ComponentBuilder.getInstance().createAssertion(); final String aID = createAssertionId(); LOG.debug("Assertion ID: {}", aID); assertion.setID(aID); final DateTime issueInstant = new DateTime(); assertion.setIssueInstant(issueInstant); assertion.setIssuer(createIssuer(properties)); final X509Certificate certificate = certificateManager.getDefaultCertificate(); final PublicKey publicKey = certificateManager.getDefaultPublicKey(); final Subject subject = createSubject(properties, certificate, publicKey); assertion.setSubject(subject); final Subject evidenceSubject = createEvidenceSubject(properties, certificate, publicKey); assertion.getStatements().addAll(createAttributeStatements(properties, evidenceSubject)); final PrivateKey privateKey = certificateManager.getDefaultPrivateKey(); signedAssertion = sign(assertion, certificate, privateKey, publicKey); } catch (final SAMLComponentBuilderException ex) { LOG.error("Unable to create HOK Assertion: {}", ex.getLocalizedMessage()); throw new SAMLAssertionBuilderException(ex.getLocalizedMessage(), ex); } catch (final CertificateManagerException ex) { LOG.error("Unable to create HOK Assertion: {}", ex.getLocalizedMessage()); throw new SAMLAssertionBuilderException(ex.getLocalizedMessage(), ex); } LOG.debug("SamlCallbackHandler.createHOKSAMLAssertion20() -- End"); return signedAssertion; }

Target:
public Element build(final CallbackProperties properties) throws SAMLAssertionBuilderException { LOG.debug("SamlCallbackHandler.createHOKSAMLAssertion20()"); Element signedAssertion = null; try { Assertion assertion; assertion = OpenSAML2ComponentBuilder.getInstance().createAssertion(); final String aID = createAssertionId(); LOG.debug("Assertion ID: {}", aID); assertion.setID(aID); final DateTime issueInstant = new DateTime(); assertion.setIssueInstant(issueInstant); assertion.setIssuer(createIssuer(properties)); final X509Certificate certificate = certificateManager.getDefaultCertificate(); final PublicKey publicKey = certificateManager.getDefaultPublicKey(); final Subject subject = createSubject(properties, certificate, publicKey); assertion.setSubject(subject); final Subject evidenceSubject = createEvidenceSubject(properties, certificate, publicKey); assertion.getStatements().addAll(createAttributeStatements(properties, evidenceSubject)); final PrivateKey privateKey = certificateManager.getDefaultPrivateKey(); signedAssertion = sign(assertion, certificate, privateKey, publicKey); } catch (final SAMLComponentBuilderException | CertificateManagerException ex) { LOG.error("Unable to create HOK Assertion: {}", ex.getLocalizedMessage()); throw new SAMLAssertionBuilderException(ex.getLocalizedMessage(), ex); } LOG.debug("SamlCallbackHandler.createHOKSAMLAssertion20() -- End"); return signedAssertion; }
Source:
private static boolean isInputFormatSupported(Properties schema) { String inputFormat = getInputFormatName(schema); if (!SUPPORTED_INPUT_FORMATS.contains(inputFormat)) { return false; } return true; }

Target:
private static boolean isInputFormatSupported(Properties schema) { String inputFormat = getInputFormatName(schema); return SUPPORTED_INPUT_FORMATS.contains(inputFormat); }
Source:
private String buildEditAttachmentPanelContext(VelocityPortlet portlet, Context context, RunData data, SessionState state) { logger.debug("buildEditAttachmentPanelContext()"); ParameterParser params = data.getParameters(); state.removeAttribute("sakaiproject.filepicker.addAttachments"); try { CitationCollection collection = getCitationCollection(state, true); Citation citation = extractCitationFromRunData(data); if(citation!=null) { state.setAttribute(CitationHelper.CITATION_EDIT_ITEM, citation); state.setAttribute(CitationHelper.CITATION_EDIT_ID,citation.getId()); state.setAttribute(STATE_CITATION_COLLECTION, collection); buildEditPanelContext(portlet, context, data, state); } }catch(Exception e){ } return TEMPLATE_EDIT; }

Target:
private String buildEditAttachmentPanelContext(VelocityPortlet portlet, Context context, RunData data, SessionState state) { logger.debug("buildEditAttachmentPanelContext()"); if( state.getAttribute(FilePickerHelper.FILE_PICKER_CANCEL) != null) { if(Boolean.valueOf(state.getAttribute(FilePickerHelper.FILE_PICKER_CANCEL).toString())) { buildNewResourcePanelContext(portlet, context, data, state); return TEMPLATE_NEW_RESOURCE; } } CitationCollection collection = getCitationCollection(state, true); Citation citation = extractCitationFromRunData(data); if(citation!=null) { state.setAttribute(CitationHelper.CITATION_EDIT_ITEM, citation); state.setAttribute(CitationHelper.CITATION_EDIT_ID,citation.getId()); state.setAttribute(STATE_CITATION_COLLECTION, collection); buildEditPanelContext(portlet, context, data, state); } return TEMPLATE_EDIT; }
Source:
public synchronized void updateRSGroupConfig(String groupName, Map<String, String> configuration) throws IOException { RSGroupInfo rsGroupInfo = getRSGroupInfo(groupName); rsGroupInfo.setConfiguration(configuration); flushConfig(); }

Target:
public synchronized void updateRSGroupConfig(String groupName, Map<String, String> configuration) throws IOException { RSGroupInfo rsGroupInfo = getRSGroupInfo(groupName); rsGroupInfo.getConfiguration().forEach((k, v) -> rsGroupInfo.removeConfiguration(k)); configuration.forEach((k, v) -> rsGroupInfo.setConfiguration(k, v)); flushConfig(); }
Source:
public DeleteRepresentationAction(Collection<DRepresentation> representations) { super("Delete", AbstractUIPlugin.imageDescriptorFromPlugin(SiriusEditPlugin.ID, "/icons/full/others/delete.gif")); this.selectedRepresentations = Collections2.filter(representations, new Predicate<DRepresentation>() { @Override public boolean apply(DRepresentation input) { EObject container = input.eContainer(); if (container instanceof DRepresentationContainer) { IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(container); if (permissionAuthority != null && !permissionAuthority.canDeleteInstance(container)) { return false; } } return true; } }); if (this.selectedRepresentations.isEmpty()) { this.setEnabled(false); } }

Target:
public DeleteRepresentationAction(Collection<DRepresentation> representations) { super("Delete", AbstractUIPlugin.imageDescriptorFromPlugin(SiriusEditPlugin.ID, "/icons/full/others/delete.gif")); this.selectedRepresentations = Collections2.filter(representations, new Predicate<DRepresentation>() { @Override public boolean apply(DRepresentation input) { EObject container = input.eContainer(); if (container instanceof DRepresentationContainer) { IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(container); if (permissionAuthority != null && !permissionAuthority.canDeleteInstance(input)) { return false; } } return true; } }); if (this.selectedRepresentations.isEmpty()) { this.setEnabled(false); } }
Source:
@Override public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException, RunnerAbortedException { Map<String,String> overrides = new HashMap<String, String>(); for (MultiBinding<?> binding : bindings) { MultiBinding.MultiEnvironment environment = binding.bind(build, null, null, null); for (String envKey : environment.getValues().keySet()) { if (!environment.getValues().get(envKey).isEmpty()) { overrides.put(envKey, environment.getValues().get(envKey)); } } } if (!overrides.isEmpty()) { return new BindingStep.Filter(overrides.values(), build.getCharset().name()).decorateLogger(build, logger); } else { return logger; } }

Target:
@Override public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException, RunnerAbortedException { Map<String,String> overrides = new HashMap<String, String>(); for (MultiBinding<?> binding : bindings) { MultiBinding.MultiEnvironment environment = binding.bind(build, null, null, null); build.addAction(new SharedMultiEnvAction(environment)); for (String envKey : environment.getValues().keySet()) { if (!environment.getValues().get(envKey).isEmpty()) { overrides.put(envKey, environment.getValues().get(envKey)); } } } if (!overrides.isEmpty()) { return new BindingStep.Filter(overrides.values(), build.getCharset().name()).decorateLogger(build, logger); } else { return logger; } }
Source:
private String initDomain(MBeanServer mBeanServer) { GlobalJmxStatisticsConfiguration globalJmxConfig = globalConfig.globalJmxStatistics(); if (globalJmxConfig.allowDuplicateDomains()) { return JmxUtil.buildJmxDomain(globalJmxConfig.domain(), mBeanServer, groupName); } else { return globalJmxConfig.domain(); } }

Target:
private String initDomain(MBeanServer mBeanServer) { GlobalJmxStatisticsConfiguration globalJmxConfig = globalConfig.globalJmxStatistics(); String jmxDomain = JmxUtil.buildJmxDomain(globalJmxConfig.domain(), mBeanServer, groupName); if (!globalJmxConfig.allowDuplicateDomains() && !jmxDomain.equals(globalJmxConfig.domain())) { throw CONTAINER.jmxMBeanAlreadyRegistered(groupName, globalJmxConfig.domain()); } return jmxDomain; }
Source:
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CONDITIONAL_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); StartConditionalEvent emptyTop = getStartNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, StartConditionalEvent.class); assertGeneralSet(emptyTop.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertConditionalEventExecutionSet(emptyTop.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, INTERRUPTING, ""); }

Target:
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CONDITIONAL_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); StartConditionalEvent emptyTop = getStartNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, StartConditionalEvent.class); assertGeneralSet(emptyTop.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertConditionalEventExecutionSet(emptyTop.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, INTERRUPTING, EMPTY_VALUE); }
Source:
protected void executeCommand() { if (getDiskImages().isEmpty()) { setSucceeded(true); return; } SealDisksVDSCommandParameters parameters = new SealDisksVDSCommandParameters(); parameters.setVmId(getParameters().getVmTemplateId()); parameters.setJobId(getParameters().getHostJobId()); parameters.setStoragePoolId(getDiskImages().get(0).getStoragePoolId()); getDiskImages().forEach(parameters::addImage); VDSReturnValue vdsReturnValue = VdsCommandsHelper.runVdsCommandWithFailover( VDSCommandType.SealDisks, parameters, getDiskImages().get(0).getStoragePoolId(), this); if (!vdsReturnValue.getSucceeded()) { setCommandStatus(CommandStatus.FAILED); } setSucceeded(vdsReturnValue.getSucceeded()); }

Target:
protected void executeCommand() { if (getDiskImages().isEmpty()) { setSucceeded(true); return; } VDSReturnValue vdsReturnValue = VdsCommandsHelper.runVdsCommandWithFailover( VDSCommandType.SealDisks, buildSealDisksVDSCommandParameters(), getDiskImages().get(0).getStoragePoolId(), this); if (!vdsReturnValue.getSucceeded()) { setCommandStatus(CommandStatus.FAILED); } setSucceeded(vdsReturnValue.getSucceeded()); }