auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGameOverSetLives() { levels.add(l); Player p = new Player(po); ArrayList<Player> list = new ArrayList<Player>(); list.add(p); Game game = new Game(levels, list); game.start(); assertTrue(game.isRunning()); p.setLives(0); game.tickGO(); assertFalse(game.isRunning()); }

Target:
public void testGameOverSetLives() { levels.add(level); Player p = new Player(point, map); ArrayList<Player> list = new ArrayList<Player>(); list.add(p); Game game = new Game(levels, list); game.start(); assertTrue(game.isRunning()); p.setLives(0); game.tickGO(); assertFalse(game.isRunning()); }
Source:
public synchronized void bind(ServiceReference<QueryFilterTransformer> reference) { if (reference == null) { return; } List<QName> namespaces = getNamespaces(reference); QueryFilterTransformer transformer = getTransformer(reference); for (QName namespace : namespaces) { queryFilterTransformerMap.put(namespace, transformer); List<String> typeNames = getTypeNames(reference); if (CollectionUtils.isNotEmpty(typeNames)) { for (String typeName : typeNames) { typeNameQNameMap.put(typeName, namespace); } } } }

Target:
public synchronized void bind(ServiceReference<QueryFilterTransformer> reference) { if (reference == null) { return; } List<QName> namespaces = getNamespaces(reference); QueryFilterTransformer transformer = getTransformer(reference); for (QName namespace : namespaces) { queryFilterTransformerMap.put(namespace, transformer); List<String> typeNames = getTypeNames(reference); for (String typeName : typeNames) { typeNameQNameMap.put(typeName, namespace); } } }
Source:
void onCanvasElementSelectedEvent(final @Observes CanvasElementSelectedEvent event) { checkNotNull("event", event); if (checkEventContext(event)) { toolboxControl.show(event.getElementUUID()); } }

Target:
void onCanvasElementSelectedEvent(final @Observes CanvasElementSelectedEvent event) { checkNotNull("event", event); handleCanvasElementSelectedEvent(event); }
Source:
private Optional<TurboIssue> getIssue(String repoId, int issueId) { Optional<Model> modelLookUpResult = models.getModelById(repoId); return Utility.flatMapOptional(modelLookUpResult, (model) -> model.getIssueById(issueId), () -> logger.error("Model " + repoId + " not found in models")); }

Target:
private Optional<TurboIssue> getIssue(String repoId, int issueId) { Optional<Model> modelLookUpResult = models.getModelById(repoId); return Utility.safeFlatMapOptional(modelLookUpResult, (model) -> model.getIssueById(issueId), () -> logger.error("Model " + repoId + " not found in models")); }
Source:
private static boolean checkEvidenceTrusted(final RealmIdentity realmIdentity, final SecurityDomain domain, final Evidence evidence) throws RealmUnavailableException { Assert.checkNotNullParam("evidence", evidence); if (! realmIdentity.exists()) { return false; } if (evidence instanceof SecurityIdentityEvidence) { final SecurityIdentity evidenceIdentity = ((SecurityIdentityEvidence) evidence).getSecurityIdentity(); final RealmInfo evidenceRealmInfo = evidenceIdentity.getRealmInfo(); final SecurityRealm evidenceSecurityRealm = evidenceRealmInfo.getSecurityRealm(); final SecurityDomain evidenceSecurityDomain = evidenceIdentity.getSecurityDomain(); return realmIdentity.createdBySecurityRealm(evidenceSecurityRealm) || domain.trustsDomain(evidenceSecurityDomain); } return false; }

Target:
static boolean checkEvidenceTrusted(final RealmIdentity realmIdentity, final SecurityDomain domain, final Evidence evidence) throws RealmUnavailableException { Assert.checkNotNullParam("evidence", evidence); if (! realmIdentity.exists()) { return false; } if (evidence instanceof SecurityIdentityEvidence) { final SecurityIdentity evidenceIdentity = ((SecurityIdentityEvidence) evidence).getSecurityIdentity(); final RealmInfo evidenceRealmInfo = evidenceIdentity.getRealmInfo(); final SecurityRealm evidenceSecurityRealm = evidenceRealmInfo.getSecurityRealm(); final SecurityDomain evidenceSecurityDomain = evidenceIdentity.getSecurityDomain(); return realmIdentity.createdBySecurityRealm(evidenceSecurityRealm) || domain.trustsDomain(evidenceSecurityDomain); } return false; }
Source:
public Comparator<Path> getComparator() { try { Object obj = comparatorClass.newInstance(); ((LiveFileNameSetter) obj).setName(liveFileName); return (Comparator<Path>) obj; } catch (Exception ex) { throw new RuntimeException("Unknown OnError value " + ex.toString(), ex); } }

Target:
public Comparator<Path> getComparator() { try { Object obj = comparatorClass.newInstance(); ((LiveFileNameSetter) obj).setName(liveFileName); return (Comparator<Path>) obj; } catch (Exception ex) { throw new RuntimeException(Utils.format("Unexpected exception: {}", ex.toString()), ex); } }
Source:
private String getDefaultRemoteName() { String defaultName = ""; boolean onlyOneRemote = syncRepos.size() == 2; if(onlyOneRemote) { defaultName = syncRepos.get(1).getName(); } else { for (SyncRepoEntity repo : syncRepos) { if(repo.getName().equals(DEFAULT_REMOTE_NAME)) { defaultName = DEFAULT_REMOTE_NAME; } } } return defaultName; }

Target:
private String getDefaultRemoteName() { String defaultName = ""; boolean onlyOneRemote = syncRepos.size() == 2; if (onlyOneRemote) { defaultName = syncRepos.get(1).getName(); } else { for (SyncRepoEntity repo : syncRepos) if (repo.getName().equals(DEFAULT_REMOTE_NAME)) return DEFAULT_REMOTE_NAME; } return defaultName; }
Source:
public DataSegment push(File inDir, DataSegment segment) throws IOException { log.info("Uploading segment[%s] to HDFS", segment.getIdentifier()); final String storageDir = DataSegmentPusherUtil.getHdfsStorageDir(segment); Path outFile = new Path(String.format("%s/%s/index.zip", config.getStorageDirectory(), storageDir)); FileSystem fs = outFile.getFileSystem(hadoopConfig); fs.mkdirs(outFile.getParent()); log.info("Compressing files from[%s] to [%s]", inDir, outFile); final long size; try (FSDataOutputStream out = fs.create(outFile)) { size = CompressionUtils.zip(inDir, out); } return createDescriptorFile( segment.withLoadSpec(makeLoadSpec(outFile)) .withSize(size) .withBinaryVersion(SegmentUtils.getVersionFromDir(inDir)), outFile.getParent(), fs ); }

Target:
public DataSegment push(File inDir, DataSegment segment) throws IOException { final String storageDir = DataSegmentPusherUtil.getHdfsStorageDir(segment); log.info( "Copying segment[%s] to HDFS at location[%s/%s]", segment.getIdentifier(), config.getStorageDirectory(), storageDir ); Path outFile = new Path(String.format("%s/%s/index.zip", config.getStorageDirectory(), storageDir)); FileSystem fs = outFile.getFileSystem(hadoopConfig); fs.mkdirs(outFile.getParent()); log.info("Compressing files from[%s] to [%s]", inDir, outFile); final long size; try (FSDataOutputStream out = fs.create(outFile)) { size = CompressionUtils.zip(inDir, out); } return createDescriptorFile( segment.withLoadSpec(makeLoadSpec(outFile)) .withSize(size) .withBinaryVersion(SegmentUtils.getVersionFromDir(inDir)), outFile.getParent(), fs ); }
Source:
public static Set<BlacklistedPartition> getBlacklistedPartitions() { String query = "SELECT keyspace_name, columnfamily_name, partition_key FROM %s.%s"; UntypedResultSet results; try { results = QueryProcessor.execute(format(query, SchemaConstants.DISTRIBUTED_KEYSPACE_NAME, BLACKLISTED_PARTITIONS), ConsistencyLevel.ONE); } catch (Exception e) { logger.error("Error querying blacklisted partitions"); return Collections.emptySet(); } Set<BlacklistedPartition> blacklistedPartitions = new HashSet<>(); for (UntypedResultSet.Row row : results) { try { blacklistedPartitions.add(new BlacklistedPartition(row.getString("keyspace_name"), row.getString("columnfamily_name"), row.getString("partition_key"))); } catch (IllegalArgumentException ex) { logger.warn("Exception parsing blacklisted partition. {}", ex.getMessage()); } } return blacklistedPartitions; }

Target:
public static UntypedResultSet getBlacklistedPartitions() { String query = "SELECT keyspace_name, columnfamily_name, partition_key FROM %s.%s"; try { return QueryProcessor.execute(format(query, SchemaConstants.DISTRIBUTED_KEYSPACE_NAME, BLACKLISTED_PARTITIONS), ConsistencyLevel.ONE); } catch (Exception e) { logger.error("Error querying blacklisted partitions", e); return null; } }
Source:
public void testCustomCodeRunner() throws Exception { System.out.println("START " + _clusterName + " at " + new Date(System.currentTimeMillis())); int nodeNb = 5; int startPort = 12918; TestHelper.setupCluster(_clusterName, ZK_ADDR, startPort, "localhost", "TestDB", 1, 5, nodeNb, nodeNb, "MasterSlave", true); ClusterControllerManager controller = new ClusterControllerManager(ZK_ADDR, _clusterName, "controller_0"); controller.syncStart(); MockParticipantManager[] participants = new MockParticipantManager[5]; for (int i = 0; i < nodeNb; i++) { String instanceName = "localhost_" + (startPort + i); participants[i] = new MockParticipantManager(ZK_ADDR, _clusterName, instanceName); registerCustomCodeRunner(participants[i]); participants[i].syncStart(); } boolean result = ClusterStateVerifier.verifyByPolling( new ClusterStateVerifier.BestPossAndExtViewZkVerifier(ZK_ADDR, _clusterName)); Assert.assertTrue(result); Thread.sleep(1000); Assert.assertTrue(_callback._isCallbackInvoked); _callback._isCallbackInvoked = false; int[] newLiveInstance = new int[]{1000}; setupInstances(_clusterName, newLiveInstance); setupLiveInstances(_clusterName, newLiveInstance); Thread.sleep(1000); Assert.assertTrue(_callback._isCallbackInvoked); controller.syncStop(); for (int i = 0; i < nodeNb; i++) { participants[i].syncStop(); } HelixDataAccessor accessor = new ZKHelixDataAccessor(_clusterName, new ZkBaseDataAccessor<>(_gZkClient)); Builder keyBuilder = accessor.keyBuilder(); accessor.removeProperty(keyBuilder.liveInstance("localhost_1000")); TestHelper.dropCluster(_clusterName, _gZkClient); System.out.println("END " + _clusterName + " at " + new Date(System.currentTimeMillis())); }

Target:
public void testCustomCodeRunner() throws Exception { System.out.println("START " + _clusterName + " at " + new Date(System.currentTimeMillis())); int nodeNb = 5; int startPort = 12918; TestHelper.setupCluster(_clusterName, ZK_ADDR, startPort, "localhost", "TestDB", 1, 5, nodeNb, nodeNb, "MasterSlave", true); ClusterControllerManager controller = new ClusterControllerManager(ZK_ADDR, _clusterName, "controller_0"); controller.syncStart(); MockParticipantManager[] participants = new MockParticipantManager[5]; for (int i = 0; i < nodeNb; i++) { String instanceName = "localhost_" + (startPort + i); participants[i] = new MockParticipantManager(ZK_ADDR, _clusterName, instanceName); registerCustomCodeRunner(participants[i]); participants[i].syncStart(); } boolean result = ClusterStateVerifier.verifyByPolling( new ClusterStateVerifier.BestPossAndExtViewZkVerifier(ZK_ADDR, _clusterName)); Assert.assertTrue(result); Thread.sleep(1000); Assert.assertTrue(_callback._isCallbackInvoked); _callback._isCallbackInvoked = false; int[] newLiveInstance = new int[]{1000}; setupInstances(_clusterName, newLiveInstance); setupLiveInstances(_clusterName, newLiveInstance); Thread.sleep(1000); Assert.assertTrue(_callback._isCallbackInvoked); controller.syncStop(); for (int i = 0; i < nodeNb; i++) { participants[i].syncStop(); } deleteLiveInstances(_clusterName); deleteCluster(_clusterName); System.out.println("END " + _clusterName + " at " + new Date(System.currentTimeMillis())); }
Source:
private static void updateNetwrokDetailsInInterface(VDS vds, Map<String, Integer> currVlans, Map<String, Integer> networkVlans, Map<String, Object> network, network net, String ifaceName) { VdsNetworkInterface iface = null; for (VdsNetworkInterface tempInterface : vds.getInterfaces()) { if (tempInterface.getName().equals(ifaceName)) { iface = tempInterface; break; } } if (iface != null) { iface.setNetworkName(net.getname()); if (currVlans.containsKey(iface.getName())) { networkVlans.put(net.getname(), currVlans.get(iface.getName())); } iface.setAddress(net.getaddr()); boolean bridged = false; if (network.get("bridged") != null) { bridged = Boolean.parseBoolean(network.get("bridged").toString()); } if (DbFacade.getInstance() .getVdsGroupDAO() .get(vds.getvds_group_id()) .getcompatibility_version() .compareTo(Version.v3_0) > 0) { iface.setBridged(bridged); } else { iface.setBridged(true); } if (StringHelper.EqOp(iface.getNetworkName(), NetworkUtils.getEngineNetwork())) { iface.setType(iface.getType() | VdsInterfaceType.Management.getValue()); } iface.setSubnet(net.getsubnet()); iface.setGateway(net.getgateway()); Map<String, Object> networkConfigAsMap = (Map<String, Object>) ((network.get("cfg") instanceof Map) ? network.get("cfg") : null); XmlRpcStruct networkConfig = networkConfigAsMap == null ? null : new XmlRpcStruct( networkConfigAsMap); AddBootProtocol(networkConfig, iface); } }

Target:
private static void updateNetwrokDetailsInInterface(VDS vds, Map<String, Integer> currVlans, Map<String, Integer> networkVlans, Map<String, Object> network, network net, String ifaceName) { VdsNetworkInterface iface = null; for (VdsNetworkInterface tempInterface : vds.getInterfaces()) { if (tempInterface.getName().equals(ifaceName)) { iface = tempInterface; break; } } if (iface != null) { iface.setNetworkName(net.getname()); if (currVlans.containsKey(iface.getName())) { networkVlans.put(net.getname(), currVlans.get(iface.getName())); } iface.setAddress(net.getaddr()); if (network.get("bridged") == null) { iface.setBridged(true); } else { iface.setBridged(Boolean.parseBoolean(network.get("bridged").toString())); } if (StringHelper.EqOp(iface.getNetworkName(), NetworkUtils.getEngineNetwork())) { iface.setType(iface.getType() | VdsInterfaceType.Management.getValue()); } iface.setSubnet(net.getsubnet()); iface.setGateway(net.getgateway()); Map<String, Object> networkConfigAsMap = (Map<String, Object>) ((network.get("cfg") instanceof Map) ? network.get("cfg") : null); XmlRpcStruct networkConfig = networkConfigAsMap == null ? null : new XmlRpcStruct( networkConfigAsMap); AddBootProtocol(networkConfig, iface); } }
Source:
private Optional<PlanNodeStatsEstimate> estimateLogicalAnd(Expression left, Expression right) { Optional<PlanNodeStatsEstimate> leftEstimate = process(left); if (leftEstimate.isPresent()) { Optional<PlanNodeStatsEstimate> logicalAndEstimate = new FilterExpressionStatsCalculatingVisitor(leftEstimate.get(), session, types).process(right); if (logicalAndEstimate.isPresent()) { return logicalAndEstimate; } return leftEstimate.map(FilterStatsCalculator::filterStatsForUnknownExpression); } Optional<PlanNodeStatsEstimate> rightEstimate = process(right); return rightEstimate.map(FilterStatsCalculator::filterStatsForUnknownExpression); }

Target:
private PlanNodeStatsEstimate estimateLogicalAnd(Expression left, Expression right) { PlanNodeStatsEstimate leftEstimate = process(left); if (!leftEstimate.isOutputRowCountUnknown()) { PlanNodeStatsEstimate logicalAndEstimate = new FilterExpressionStatsCalculatingVisitor(leftEstimate, session, types).process(right); if (!logicalAndEstimate.isOutputRowCountUnknown()) { return logicalAndEstimate; } } PlanNodeStatsEstimate rightEstimate = process(right); PlanNodeStatsEstimate smallestKnownEstimate; if (leftEstimate.isOutputRowCountUnknown()) { smallestKnownEstimate = rightEstimate; } else if (rightEstimate.isOutputRowCountUnknown()) { smallestKnownEstimate = leftEstimate; } else { smallestKnownEstimate = leftEstimate.getOutputRowCount() <= rightEstimate.getOutputRowCount() ? leftEstimate : rightEstimate; } if (smallestKnownEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } return normalizer.normalize(smallestKnownEstimate.mapOutputRowCount(rowCount -> rowCount * UNKNOWN_FILTER_COEFFICIENT), types); }
Source:
protected void disconnectSource(RestClient client) { try (AeshTestConnection terminal = new AeshTestConnection()) { CLI.main(new AeshDelegatingShell(terminal), new String[]{}); terminal.readln("connect"); terminal.assertContains(" terminal.clear(); terminal.readln("migrate disconnect --cache=" + CACHE_NAME); } }

Target:
protected void disconnectSource(RestClient client) { try (AeshTestConnection terminal = new AeshTestConnection()) { CLI.main(new AeshDelegatingShell(terminal), new String[]{}); terminal.readln("connect"); terminal.assertContains(" terminal.clear(); terminal.readln("migrate cluster disconnect --cache=" + CACHE_NAME); } }
Source:
public boolean matches(Pattern pattern) { if(pattern.matcher(getName()).find()) { return true; } if(pattern.matcher(Integer.toString(fThreadId)).find()) { return true; } if(pattern.matcher(Integer.toString(fParentThreadId)).find()) { return true; } if ( pattern.matcher(Utils.formatTime(getStartTime(), TimeFormat.CALENDAR, Resolution.NANOSEC)).find()) { return true; } if ( pattern.matcher(fTrace.getName()).find()) { return true; } return pattern.matcher(Integer.toString(fThreadQuark)).find(); }

Target:
public boolean matches(Pattern pattern) { if (pattern.matcher(getName()).find()) { return true; } if (pattern.matcher(Integer.toString(fThreadId)).find()) { return true; } if (pattern.matcher(Integer.toString(fParentThreadId)).find()) { return true; } if (pattern.matcher(Integer.toString(fThreadQuark)).find()) { return true; } if (pattern.matcher(fTrace.getName()).find()) { return true; } return pattern.matcher(Utils.formatTime(getStartTime(), TimeFormat.CALENDAR, Resolution.NANOSEC)).find(); }
Source:
public void doCreateAccount() { new AMCreateAccountInfoTask() { @Override public void onCatch(Throwable caught) { L.e(caught); } @Override public void onFinish(AMCreateAccountInfoResult result) { if (result.getEnabled()) { L.i("Creating account with AuthManager"); captchaHandler.handleCaptcha(new CaptchaResult(result.getCaptchaId()), true); } else { L.i("Creating account with legacy API"); doLegacyCreateAccount(); } } }.execute(); }

Target:
public void doCreateAccount() { new AMCreateAccountInfoTask() { @Override public void onCatch(Throwable caught) { handleError(caught.getMessage()); L.e(caught); } @Override public void onFinish(AMCreateAccountInfoResult result) { if (result.getEnabled()) { L.i("Creating account with AuthManager"); captchaHandler.handleCaptcha(new CaptchaResult(result.getCaptchaId()), true); } else { L.i("Creating account with legacy API"); doLegacyCreateAccount(); } } }.execute(); }
Source:
public void stop() { giant.lock(); try { if (isLeader()) { leadershipListener.stopBeingLeader(); } overlordLeaderSelector.unregisterListener(); } finally { giant.unlock(); } }

Target:
public void stop() { giant.lock(); try { gracefulStopLeaderLifecycle(); overlordLeaderSelector.unregisterListener(); } finally { giant.unlock(); } }
Source:
boolean verifyEvidence(final Evidence evidence) throws RealmUnavailableException { return checkEvidenceTrusted(realmIdentity, domain, evidence) ? true : realmIdentity.verifyEvidence(evidence); }

Target:
boolean verifyEvidence(final Evidence evidence) throws RealmUnavailableException { return checkEvidenceTrusted(realmIdentity, getSecurityDomain(), evidence) || realmIdentity.verifyEvidence(evidence); }
Source:
public Link discoverUnique(String rel) throws Exception { List<Link> discover = discover(rel); assertThat(discover, hasSize(1)); return discover.get(0); }

Target:
public Link discoverUnique(String rel) throws Exception { List<Link> discover = discover(rel); assertThat(discover).hasSize(1); return discover.get(0); }
Source:
public AuditLogType getAuditLogTypeValue() { return getSucceeded() ? AuditLogType.USER_REMOVE_VM_POOL : AuditLogType.USER_REMOVE_VM_POOL_FAILED; }

Target:
public AuditLogType getAuditLogTypeValue() { if (getActionState() == CommandActionState.EXECUTE) { return AuditLogType.USER_REMOVE_VM_POOL_INITIATED; } else { return getSucceeded() ? AuditLogType.USER_REMOVE_VM_POOL : AuditLogType.USER_REMOVE_VM_POOL_FAILED; } }
Source:
public boolean initialized() { return initialized.get() && config.featureStore.initialized(); }

Target:
public boolean initialized() { return initialized.get(); }
Source:
void search(ProgressMonitor monitor, ObjectToPack[] toSearch, int off, int cnt) throws IOException { try { for (int end = off + cnt; off < end; off++) { res = window[resSlot]; if (0 < maxMemory) { clear(res); int tail = next(resSlot); final long need = estimateSize(toSearch[off]); while (maxMemory < loaded + need && tail != resSlot) { clear(window[tail]); tail = next(tail); } } res.set(toSearch[off]); if (res.object.isEdge() || !res.object.isAttemptDelta()) { keepInWindow(); } else { monitor.update(1); search(); } } } finally { if (deflater != null) deflater.end(); } }

Target:
void search(ProgressMonitor monitor, ObjectToPack[] toSearch, int off, int cnt) throws IOException { try { for (int end = off + cnt; off < end; off++) { res = window[resSlot]; if (0 < maxMemory) { clear(res); int tail = next(resSlot); final long need = estimateSize(toSearch[off]); while (maxMemory < loaded + need && tail != resSlot) { clear(window[tail]); tail = next(tail); } } res.set(toSearch[off]); if (res.object.isEdge() || res.object.doNotAttemptDelta()) { keepInWindow(); } else { monitor.update(1); search(); } } } finally { if (deflater != null) deflater.end(); } }
Source:
public Request apply(RequestTemplate in) { in.insert(0, url()); List<Object> creds = ListCredentials.asList(credentials.get()); in.body(format(SOAP_TEMPLATE, creds.get(0).toString(), creds.get(1).toString(), new String(in.body()))); in.header("Host", URI.create(in.url()).getHost()); in.header("Content-Type", "application/xml"); return in.request(); }

Target:
public Request apply(RequestTemplate in) { in.insert(0, url()); List<Object> creds = ListCredentials.asList(credentials.get()); in.body(format(SOAP_TEMPLATE, creds.get(0).toString(), creds.get(1).toString(), new String(in.body(), UTF_8))); in.header("Host", URI.create(in.url()).getHost()); in.header("Content-Type", "application/xml"); return in.request(); }
Source:
void put(String key, V value) { CacheEntry<V> entry = new CacheEntry<V>(key, value); final int hashCode = key.hashCode(); final int firstIndex = firstIndex(hashCode); final V firstValue = value(firstIndex, key); if (firstValue == null) { entries[firstIndex] = entry; } else { entries[secondIndex(hashCode)] = entry; } }

Target:
void put(String key, V value) { CacheEntry<V> entry = new CacheEntry<V>(key, value); final int hashCode = key.hashCode(); final int firstIndex = firstIndex(hashCode); final V firstValue = value(firstIndex, key); if (firstValue == null) { entries[firstIndex] = entry; } else { int secondIndex = secondIndex(hashCode); if (entries[secondIndex] != null && PlatformDependent.threadLocalRandom().nextBoolean()) { entries[firstIndex] = entry; } else { entries[secondIndex] = entry; } } }
Source:
public static EC2HardwareBuilder m3_medium() { return new EC2HardwareBuilder(InstanceType.M3_MEDIUM) .ram(3840) .processors(ImmutableList.of(new Processor(1.0, 3.0))) .volumes( ImmutableList.<Volume> of(new VolumeImpl(10.0f, "/dev/sda1", true, false), new VolumeImpl(4.0f, "/dev/sdb", false, false))); }

Target:
public static EC2HardwareBuilder m3_medium() { return new EC2HardwareBuilder(InstanceType.M3_MEDIUM) .ram(3840) .processors(ImmutableList.of(new Processor(1.0, 3.0))) .volumes(ImmutableList.<Volume> of( new VolumeBuilder().type(LOCAL).size(10.0f).device("/dev/sda1").bootDevice(true).durable(false).build(), new VolumeBuilder().type(LOCAL).size(4.0f).device("/dev/sdb").bootDevice(false).durable(false).build())); }
Source:
public int isApplicable(VElement vElement, ViewModelContext viewModelContext) { if (!VControl.class.isInstance(vElement)) { return NOT_APPLICABLE; } final VControl control = (VControl) vElement; IValueProperty valueProperty; try { valueProperty = Activator.getDefault().getEMFFormsDatabinding() .getValueProperty(control.getDomainModelReference(), viewModelContext.getDomainModel()); } catch (final DatabindingFailedException ex) { Activator.getDefault().getReportService().report(new DatabindingFailedReport(ex)); return NOT_APPLICABLE; } catch (final IllegalArgumentException ex) { Activator.getDefault().getReportService().report(new AbstractReport(ex)); return NOT_APPLICABLE; } return isApplicable((EStructuralFeature) valueProperty.getValueType()); }

Target:
public int isApplicable(VElement vElement, ViewModelContext viewModelContext) { if (!VControl.class.isInstance(vElement)) { return NOT_APPLICABLE; } final VControl control = (VControl) vElement; if (control.getDomainModelReference() == null) { return NOT_APPLICABLE; } IValueProperty valueProperty; try { valueProperty = Activator.getDefault().getEMFFormsDatabinding() .getValueProperty(control.getDomainModelReference(), viewModelContext.getDomainModel()); } catch (final DatabindingFailedException ex) { Activator.getDefault().getReportService().report(new DatabindingFailedReport(ex)); return NOT_APPLICABLE; } catch (final IllegalArgumentException ex) { Activator.getDefault().getReportService().report(new AbstractReport(ex)); return NOT_APPLICABLE; } return isApplicable((EStructuralFeature) valueProperty.getValueType()); }
Source:
protected void doExecute() { final DDiagram diagram = getParentDiagram(); RefreshIdsHolder factory = RefreshIdsHolder.getOrCreateHolder(diagram); AbstractDNodeCandidate nodeCandidate = new AbstractDNodeCandidate(this.mapping, semantic, container, factory); Session session = SessionManager.INSTANCE.getSession(((DSemanticDiagram) diagram).getTarget()); DiagramMappingsManager mappingManager = DiagramMappingsManagerRegistry.INSTANCE.getDiagramMappingsManager(session, diagram); final DDiagramSynchronizer diagramSync = new DDiagramSynchronizer(interpreter, diagram.getDescription(), accessor); diagramSync.setDiagram((DSemanticDiagram) diagram); final DDiagramElementSynchronizer elementSync = diagramSync.getElementSynchronizer(); if (nodeCandidate != null) { elementSync.createNewNode(mappingManager, nodeCandidate, isBorder()); } else if (edgeCandidate != null) { final Map<EdgeMapping, Collection<MappingBasedDecoration>> edgeToMappingBasedDecoration = new HashMap<EdgeMapping, Collection<MappingBasedDecoration>>(); final Map<String, Collection<SemanticBasedDecoration>> edgeToSemanticBasedDecoration = new HashMap<String, Collection<SemanticBasedDecoration>>(); final Map<DiagramElementMapping, Collection<EdgeTarget>> mappingsToEdgeTargets = elementSync.computeMappingsToEdgeTargets(session.getSelectedViewpoints(false)); diagramSync.computeDecorations(mappingsToEdgeTargets, edgeToSemanticBasedDecoration, edgeToMappingBasedDecoration); elementSync.createNewEdge(mappingManager, edgeCandidate, mappingsToEdgeTargets, edgeToMappingBasedDecoration, edgeToSemanticBasedDecoration); } }

Target:
protected void doExecute() { final DDiagram diagram = getParentDiagram(); Session session = SessionManager.INSTANCE.getSession(((DSemanticDiagram) diagram).getTarget()); DiagramMappingsManager mappingManager = DiagramMappingsManagerRegistry.INSTANCE.getDiagramMappingsManager(session, diagram); final DDiagramSynchronizer diagramSync = new DDiagramSynchronizer(interpreter, diagram.getDescription(), accessor); diagramSync.setDiagram((DSemanticDiagram) diagram); final DDiagramElementSynchronizer elementSync = diagramSync.getElementSynchronizer(); if (nodeCandidate != null) { elementSync.createNewNode(mappingManager, nodeCandidate, isBorder()); } else if (edgeCandidate != null) { final Map<EdgeMapping, Collection<MappingBasedDecoration>> edgeToMappingBasedDecoration = new HashMap<EdgeMapping, Collection<MappingBasedDecoration>>(); final Map<String, Collection<SemanticBasedDecoration>> edgeToSemanticBasedDecoration = new HashMap<String, Collection<SemanticBasedDecoration>>(); final Map<DiagramElementMapping, Collection<EdgeTarget>> mappingsToEdgeTargets = elementSync.computeMappingsToEdgeTargets(session.getSelectedViewpoints(false)); diagramSync.computeDecorations(mappingsToEdgeTargets, edgeToSemanticBasedDecoration, edgeToMappingBasedDecoration); elementSync.createNewEdge(mappingManager, edgeCandidate, mappingsToEdgeTargets, edgeToMappingBasedDecoration, edgeToSemanticBasedDecoration); } }
Source:
public void addQueueAndAssignPermission(String queueName, QueueRolePermission[] queueRolePermissionsDTO) throws BrokerManagerAdminException { QueueManagerService queueManagerService = AndesBrokerManagerAdminServiceDSHolder.getInstance() .getQueueManagerService(); org.wso2.carbon.andes.core.types.QueueRolePermission[] rolePermissions; try { if (queueRolePermissionsDTO != null && queueRolePermissionsDTO.length > 0) { rolePermissions = new org.wso2.carbon.andes.core.types.QueueRolePermission[queueRolePermissionsDTO.length]; for (int i=0; i < queueRolePermissionsDTO.length; i++) { rolePermissions[i] = queueRolePermissionsDTO[i].convertToAndesCoreRole(); } queueManagerService.addQueueAndAssignPermission(queueName, rolePermissions); } } catch (QueueManagerException e) { log.error("Unable to update permission of the queue.", e); throw new BrokerManagerAdminException("Unable to update permission of the queue.", e); } }

Target:
public void addQueueAndAssignPermission(String queueName, QueueRolePermission[] queueRolePermissionsDTO) throws BrokerManagerAdminException { QueueManagerService queueManagerService = AndesBrokerManagerAdminServiceDSHolder.getInstance() .getQueueManagerService(); org.wso2.carbon.andes.core.types.QueueRolePermission[] rolePermissions; try { if (null != queueRolePermissionsDTO && queueRolePermissionsDTO.length > 0) { rolePermissions = new org.wso2.carbon.andes.core.types.QueueRolePermission[queueRolePermissionsDTO.length]; for (int i = 0; i < queueRolePermissionsDTO.length; i++) { rolePermissions[i] = queueRolePermissionsDTO[i].convert(); } queueManagerService.addQueueAndAssignPermission(queueName, rolePermissions); } } catch (QueueManagerException e) { log.error("Unable to update permission of the queue.", e); throw new BrokerManagerAdminException("Unable to update permission of the queue.", e); } }
Source:
protected boolean getPermissionToJoin() throws Exception { boolean gotPermission; if (distributionManager.isJoinComplete()) { throw new IllegalStateException("Join on " + getMyAddress() + " cannot be complete without rehash to finishing"); } chOld = retrieveOldConsistentHash(); gotPermission = true; if (chOld.getCaches().contains(self)) chNew = chOld; else chNew = createConsistentHash(configuration, chOld.getCaches(), distributionManager.getTopologyInfo(), self); return gotPermission; }

Target:
protected void getPermissionToJoin() throws Exception { if (distributionManager.isJoinComplete()) { throw new IllegalStateException("Join on " + getMyAddress() + " cannot be complete without rehash to finishing"); } chOld = retrieveOldConsistentHash(); if (chOld.getCaches().contains(self)) chNew = chOld; else chNew = createConsistentHash(configuration, chOld.getCaches(), distributionManager.getTopologyInfo(), self); }
Source:
public List<JobWorkerHealth> getAllWorkerHealth() throws IOException { return retryRPC(new RpcCallable<List<JobWorkerHealth>>() { public List<JobWorkerHealth> call() throws StatusRuntimeException { List<alluxio.grpc.JobWorkerHealth> workerHealthsList = mClient .getAllWorkerHealth(GetAllWorkerHealthPRequest.newBuilder().build()) .getWorkerHealthsList(); ArrayList<JobWorkerHealth> result = Lists.newArrayList(); for (alluxio.grpc.JobWorkerHealth workerHealth : workerHealthsList) { result.add(new JobWorkerHealth(workerHealth)); } return result; } }); }

Target:
public List<JobWorkerHealth> getAllWorkerHealth() throws IOException { return retryRPC(new RpcCallable<List<JobWorkerHealth>>() { public List<JobWorkerHealth> call() throws StatusRuntimeException { List<alluxio.grpc.JobWorkerHealth> workerHealthsList = mClient .getAllWorkerHealth(GetAllWorkerHealthPRequest.newBuilder().build()) .getWorkerHealthsList(); return workerHealthsList.stream().map(JobWorkerHealth::new).collect(Collectors.toList()); } }); }
Source:
public IStatus validate(final IProject project, final String path) { CTFTrace temp; IStatus validStatus; try { temp = new CTFTrace(path); } catch (CTFReaderException e) { validStatus = new Status(IStatus.ERROR, "CTF", e.toString()); return validStatus; } catch (NullPointerException e){ validStatus = new Status(IStatus.ERROR, "CTF", e.toString()); return validStatus; } String dom = temp.getEnvironment().get("domain"); temp.dispose(); if (dom != null && dom.equals("\"kernel\"")) { return Status.OK_STATUS; } validStatus = new Status(IStatus.ERROR, "CTF", "Domain mismatch, make sure the environment is 'kernel'"); return validStatus; }

Target:
public IStatus validate(final IProject project, final String path) { CTFTrace temp; IStatus validStatus; try { temp = new CTFTrace(path); } catch (CTFReaderException e) { validStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e); return validStatus; } catch (NullPointerException e){ validStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e); return validStatus; } String dom = temp.getEnvironment().get("domain"); temp.dispose(); if (dom != null && dom.equals("\"kernel\"")) { return Status.OK_STATUS; } validStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfKernelTrace_DomainError); return validStatus; }
Source:
public <KIn, VIn, KOut, VOut> Set<KOut> mapAndCombineForDistributedReduction( MapCombineCommand<KIn, VIn, KOut, VOut> mcc) throws InterruptedException { Set<KIn> keys = mcc.getKeys(); final boolean inputKeysSpecified = keys != null && !keys.isEmpty(); if (!inputKeysSpecified) { try { return mapAndCombine(mcc); } catch (Exception e) { throw new CacheException(e); } } else { CollectableCollector<KOut, VOut> collector = map(mcc); try { return combine(mcc, collector); } catch (Exception e) { throw new CacheException(e); } } }

Target:
public <KIn, VIn, KOut, VOut> Set<KOut> mapAndCombineForDistributedReduction( MapCombineCommand<KIn, VIn, KOut, VOut> mcc) throws InterruptedException { try { return mapAndCombine(mcc); } catch (Exception e) { throw new CacheException(e); } }
Source:
private RateCalculation parseInflation( XmlElement legEl, XmlElement calcEl, XmlElement inflationEl, PeriodicSchedule accrualSchedule, FpmlDocument document) { document.validateNotPresent(inflationEl, "spreadSchedule"); document.validateNotPresent(inflationEl, "rateTreatment"); document.validateNotPresent(inflationEl, "capRateSchedule"); document.validateNotPresent(inflationEl, "floorRateSchedule"); document.validateNotPresent(legEl, "stubCalculationPeriodAmount"); InflationRateCalculation.Builder builder = InflationRateCalculation.builder(); builder.index(document.parsePriceIndex(inflationEl)); builder.lag(document.parsePeriod(inflationEl.getChild("inflationLag"))); String interpStr = inflationEl.getChild("interpolationMethod").getContent(); builder.interpolated(interpStr.toLowerCase(Locale.ENGLISH).contains("linear") ? true : false); inflationEl.findChild("floatingRateMultiplierSchedule").ifPresent(el -> { builder.gearing(parseSchedule(el, document)); }); return builder.build(); }

Target:
private RateCalculation parseInflation( XmlElement legEl, XmlElement calcEl, XmlElement inflationEl, PeriodicSchedule accrualSchedule, FpmlDocument document) { document.validateNotPresent(inflationEl, "spreadSchedule"); document.validateNotPresent(inflationEl, "rateTreatment"); document.validateNotPresent(inflationEl, "capRateSchedule"); document.validateNotPresent(inflationEl, "floorRateSchedule"); document.validateNotPresent(legEl, "stubCalculationPeriodAmount"); InflationRateCalculation.Builder builder = InflationRateCalculation.builder(); builder.index(document.parsePriceIndex(inflationEl)); builder.lag(document.parsePeriod(inflationEl.getChild("inflationLag"))); String interpStr = inflationEl.getChild("interpolationMethod").getContent(); builder.interpolated(interpStr.toLowerCase(Locale.ENGLISH).contains("linear")); inflationEl.findChild("floatingRateMultiplierSchedule").ifPresent(el -> { builder.gearing(parseSchedule(el, document)); }); return builder.build(); }
Source:
private boolean isWeldProxy(Class<?> type) { try{ Class<?> weldProxyClass = Class.forName("org.jboss.weld.bean.proxy.ProxyObject"); return weldProxyClass.isAssignableFrom(type); }catch(ClassNotFoundException e){ logger.debug("Weld not found, cannot determine if class is a proxy or not.", type); } return false; }

Target:
private boolean isWeldProxy(Class<?> type) { if(weldProxyClass != null){ return weldProxyClass.isAssignableFrom(type); }else{ logger.debug("Weld not found, cannot determine if class is a proxy or not.", type); return false; } }
Source:
public void testProfileFilesExist() { profileListCommand.doExecute(applicationService, featuresService, bundleService); assertThat(out.toString().contains("standard"), is(true)); assertThat(out.toString().contains("devProfile"), is(true)); assertThat(out.toString().contains("profileWithDuplicates"), is(true)); assertThat(out.toString().contains(".json"), is(false)); }

Target:
public void testProfileFilesExist() { profileListCommand.doExecute(applicationService, featuresService, bundleService); assertThat(out.toString().contains("standard"), is(true)); assertThat(out.toString().contains("devProfile"), is(true)); assertThat(out.toString().contains("profileWithDuplicates"), is(true)); assertThat(out.toString().contains(PROFILE_EXTENSION), is(false)); }
Source:
public <T> BeanMetaData<T> getBeanMetaData(Class<T> beanClass) { Contracts.assertNotNull( beanClass, MESSAGES.beanTypeCannotBeNull() ); BeanMetaData<T> beanMetaData = (BeanMetaData<T>) beanMetaDataCache.get( beanClass ); if ( beanMetaData != null ) { return beanMetaData; } beanMetaData = (BeanMetaData<T>) beanMetaDataCache.computeIfAbsent( beanClass, bc -> createBeanMetaData( bc ) ); return beanMetaData; }

Target:
public <T> BeanMetaData<T> getBeanMetaData(Class<T> beanClass) { Contracts.assertNotNull( beanClass, MESSAGES.beanTypeCannotBeNull() ); BeanMetaData<T> beanMetaData = (BeanMetaData<T>) beanMetaDataCache.get( beanClass ); if ( beanMetaData != null ) { return beanMetaData; } beanMetaData = createBeanMetaData( beanClass ); BeanMetaData<T> previousBeanMetaData = (BeanMetaData<T>) beanMetaDataCache.putIfAbsent( beanClass, beanMetaData ); if ( previousBeanMetaData != null ) { return previousBeanMetaData; } return beanMetaData; }
Source:
private void testTransformers_1_3_0(ModelTestControllerVersion controllerVersion) throws Exception { KernelServicesBuilder builder = createKernelServicesBuilder(DEFAULT_ADDITIONAL_INITIALIZATION) .setSubsystemXmlResource("remoting-with-expressions-and-good-legacy-protocol.xml"); ModelVersion oldVersion = controllerVersion.getSubsystemModelVersion(getMainSubsystemName()); builder.createLegacyKernelServicesBuilder(null, controllerVersion) .addMavenResourceURL( String.format("%s:%s%s:%s", controllerVersion.getCoreMavenGroupId(), controllerVersion.getArtifactIdPrefix(),"remoting", controllerVersion.getMavenGavVersion())) .skipReverseControllerCheck(); KernelServices mainServices = builder.build(); assertTrue(mainServices.isSuccessfulBoot()); KernelServices legacyServices = mainServices.getLegacyServices(oldVersion); assertNotNull(legacyServices); assertTrue(legacyServices.isSuccessfulBoot()); checkSubsystemModelTransformation(mainServices, oldVersion, null, false); checkRejectOutboundConnectionProtocolNotRemote(mainServices, oldVersion, CommonAttributes.REMOTE_OUTBOUND_CONNECTION, "remote-conn1"); checkRejectHttpConnector(mainServices, oldVersion); checkRejectEndpointConfiguration(mainServices, oldVersion); }

Target:
private void testTransformers_1_3_0(ModelTestControllerVersion controllerVersion) throws Exception { KernelServicesBuilder builder = createKernelServicesBuilder(DEFAULT_ADDITIONAL_INITIALIZATION) .setSubsystemXmlResource("remoting-transformers.xml"); ModelVersion oldVersion = controllerVersion.getSubsystemModelVersion(getMainSubsystemName()); builder.createLegacyKernelServicesBuilder(null, controllerVersion) .addMavenResourceURL(controllerVersion.getMavenGav("remoting", true)) .skipReverseControllerCheck(); KernelServices mainServices = builder.build(); assertTrue(mainServices.isSuccessfulBoot()); KernelServices legacyServices = mainServices.getLegacyServices(oldVersion); assertNotNull(legacyServices); assertTrue(legacyServices.isSuccessfulBoot()); checkSubsystemModelTransformation(mainServices, oldVersion, null, false); checkRejectOutboundConnectionProtocolNotRemote(mainServices, oldVersion, CommonAttributes.REMOTE_OUTBOUND_CONNECTION, "remote-conn1"); checkRejectHttpConnector(mainServices, oldVersion); checkRejectEndpointConfiguration(mainServices, oldVersion); }
Source:
private void markJobStarted(Job job, String correlationId) { statusIcon.addStyleName(PatternflyConstants.PF_SPINNER); statusIcon.addStyleName(PatternflyConstants.PF_SPINNER_XS); statusIcon.addStyleName(PatternflyConstants.PF_SPINNER_INLINE); jobProgress.setActive(true); jobProgress.setType(ProgressType.STRIPED); jobProgressBar.setPercent(100); String startTime = job.getStartTime() == null ? constants.notAvailableLabel() : DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_MEDIUM).format(job.getStartTime()); jobProgressBar.setText(constants.startedTask() + ": " + startTime); if (job.getSteps().isEmpty()) { model.updateSingleTask(correlationId); } else { job.getSteps().forEach(step -> { container.add(createStep(step)); }); } }

Target:
private void markJobStarted(Job job, String correlationId) { statusIcon.addStyleName(PatternflyConstants.PF_SPINNER); statusIcon.addStyleName(PatternflyConstants.PF_SPINNER_XS); statusIcon.addStyleName(PatternflyConstants.PF_SPINNER_INLINE); jobProgress.setActive(true); jobProgress.setType(ProgressType.STRIPED); jobProgressBar.setPercent(100); String startTime = formatDatetoString(job.getStartTime()); jobProgressBar.setText(constants.startedTask() + ": " + startTime); if (job.getSteps().isEmpty()) { model.updateSingleTask(correlationId); } else { job.getSteps().forEach(step -> { container.add(createStep(step)); }); } }
Source:
public Widget getWidget(Sitemap sitemap, String id) { if (id.length() > 0) { Widget w = getWidget(id); if (w == null) { w = getDefaultWidget(null, id); } if (w != null) { w.setItem(id); } else { try { w = sitemap.getChildren().get(Integer.valueOf(id.substring(0, 2))); for (int i = 2; i < id.length(); i += 2) { w = ((LinkableWidget) w).getChildren().get(Integer.valueOf(id.substring(i, i + 2))); } } catch (NumberFormatException e) { } } if (w instanceof Default) { w = resolveDefault(w, null); } return w; } logger.warn("Cannot find page for id '{}'.", id); return null; }

Target:
public Widget getWidget(Sitemap sitemap, String id) { if (id.length() > 0) { Widget w = getWidget(id); if (w == null) { w = getDefaultWidget(null, id); } if (w != null) { w.setItem(id); } else { try { w = sitemap.getChildren().get(Integer.valueOf(id.substring(0, 2))); for (int i = 2; i < id.length(); i += 2) { w = ((LinkableWidget) w).getChildren().get(Integer.valueOf(id.substring(i, i + 2))); } } catch (NumberFormatException e) { } } return resolveDefault(w); } logger.warn("Cannot find page for id '{}'.", id); return null; }
Source:
private void removeSegment(final Sink sink, final File target) { if (target.exists()) { try { log.info("Deleting Index File[%s]", target); FileUtils.deleteDirectory(target); } catch (Exception e) { log.makeAlert(e, "Unable to remove merged segment for dataSource[%s]", schema.getDataSource()) .addData("interval", sink.getInterval()) .emit(); } } }

Target:
private void removeSegment(final Sink sink, final File target) { if (target.exists()) { try { log.info("Deleting Index File[%s]", target); FileUtils.deleteDirectory(target); } catch (Exception e) { log.makeAlert(e, "Unable to remove file for dataSource[%s]", schema.getDataSource()) .addData("file", target) .addData("interval", sink.getInterval()) .emit(); } } }
Source:
private static void assertCorrectGetAllResult(List<VM> result) { assertNotNull(result); assertFalse(result.isEmpty()); assertEquals(VM_COUNT, result.size()); for (VM vm : result) { assertTrue("Vm db generation wasn't loaded as expected", vm.getDbGeneration() == 1); } }

Target:
private static void assertCorrectGetAllResult(List<VM> result) { assertNotNull(result); assertFalse(result.isEmpty()); assertEquals(VM_COUNT, result.size()); for (VM vm : result) { assertEquals("Vm db generation wasn't loaded as expected", 1, vm.getDbGeneration()); } }
Source:
public void testObservableInMap() { HashMap<String, IObservableValue<String>> hashMap = new HashMap<>(); WritableValue<String> writableValue = new WritableValue<>(); writableValue.setValue("Simon"); hashMap.put("Simon", writableValue); ISideEffect.create(() -> { IObservableValue<String> observableValue = hashMap.get("Simon"); System.out.println(observableValue.getValue()); sideEffectInvocations++; }); assertEquals(1, sideEffectInvocations); writableValue.setValue("Stefan"); runAsync(); assertEquals(2, sideEffectInvocations); }

Target:
public void testObservableInMap() { HashMap<String, IObservableValue<String>> hashMap = new HashMap<>(); IObservableValue<String> observableValue = new WritableValue<>(); observableValue.setValue("Simon"); hashMap.put("Simon", observableValue); ISideEffect.create(() -> { IObservableValue<String> observable = hashMap.get("Simon"); observable.getValue(); sideEffectInvocations++; }); assertEquals(1, sideEffectInvocations); observableValue.setValue("Stefan"); runAsync(); assertEquals(2, sideEffectInvocations); }
Source:
public void processTerminateEventWithParallelTasks() { ProcessInstance process = processBaseRuntime.startProcessWithProcessDefinitionKey(TASK_PROCESS_TERMINATE_EVENT); List<Task> taskList = taskBaseRuntime.getTasksByProcessInstanceId(process.getId()); assertThat(taskList).isNotEmpty(); assertThat(taskList.size()).isEqualTo(2); Task task1 = taskList.get(0); taskBaseRuntime.completeTask(task1.getId()); List<Task> taskAfterCompleted = taskBaseRuntime.getTasksByProcessInstanceId(process.getId()); assertThat(taskAfterCompleted).isEmpty(); assertThat(taskAfterCompleted.size()).isEqualTo(0); }

Target:
public void processTerminateEventWithParallelTasks() { ProcessInstance process = processBaseRuntime.startProcessWithProcessDefinitionKey(TASK_PROCESS_TERMINATE_EVENT); List<Task> taskList = taskBaseRuntime.getTasksByProcessInstanceId(process.getId()); assertThat(taskList).isNotEmpty(); assertThat(taskList).hasSize(2); Task task1 = taskList.get(0); taskBaseRuntime.completeTask(task1.getId()); List<Task> taskAfterCompleted = taskBaseRuntime.getTasksByProcessInstanceId(process.getId()); assertThat(taskAfterCompleted).hasSize(0); }
Source:
public File getMediaFilesFromFormManagerOrig(String fileLink) { File file = null; RestTemplate restTemplate = new RestTemplate(); try { file = restTemplate.getForObject(fileLink, File.class); } catch (Exception e) { System.out.println(e.getMessage()); } return file; }

Target:
public File getMediaFilesFromFormManagerOrig(String fileLink) { File file = null; RestTemplate restTemplate = new RestTemplate(); try { file = restTemplate.getForObject(fileLink, File.class); } catch (Exception e) { logger.info(e.getMessage()); } return file; }
Source:
public void onAttach(Context activity) { super.onAttach(activity); mActivity = (Activity) activity; setHasOptionsMenu(true); LocalBroadcastManager.getInstance(mActivity).registerReceiver(mClearSelectionReceiver, new IntentFilter("recent-list-clear-selection")); LocalBroadcastManager.getInstance(mActivity).registerReceiver(mRemoveSelectedReceiver, new IntentFilter("recent-list-remove-selected")); }

Target:
public void onAttach(Context activity) { super.onAttach(activity); mActivity = (Activity) activity; setHasOptionsMenu(true); LocalBroadcastManager.getInstance(mActivity).registerReceiver(mClearSelectionReceiver, new IntentFilter(RecentListActionModeUtil.ACTION_CLEAR_SELECTION)); LocalBroadcastManager.getInstance(mActivity).registerReceiver(mRemoveSelectedReceiver, new IntentFilter(RecentListActionModeUtil.ACTION_REMOVE_SELECTED)); }