auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private INetworkStackConnector getRemoteConnector() { IBinder connector; try { final long before = System.currentTimeMillis(); while ((connector = ServiceManager.getService(Context.NETWORK_STACK_SERVICE)) == null) { Thread.sleep(20); if (System.currentTimeMillis() - before > NETWORKSTACK_TIMEOUT_MS) { Slog.e(TAG, "Timeout waiting for NetworkStack connector"); return null; } } } catch (InterruptedException e) { Slog.e(TAG, "Error waiting for NetworkStack connector", e); return null; } synchronized (mPendingNetStackRequests) { return INetworkStackConnector.Stub.asInterface(connector); } }

Target:
private INetworkStackConnector getRemoteConnector() { IBinder connector; try { final long before = System.currentTimeMillis(); while ((connector = ServiceManager.getService(Context.NETWORK_STACK_SERVICE)) == null) { Thread.sleep(20); if (System.currentTimeMillis() - before > NETWORKSTACK_TIMEOUT_MS) { Slog.e(TAG, "Timeout waiting for NetworkStack connector"); return null; } } } catch (InterruptedException e) { Slog.e(TAG, "Error waiting for NetworkStack connector", e); return null; } return INetworkStackConnector.Stub.asInterface(connector); }
Source:
private List<ListBlobContainersIncludeType> toIncludeTypes(BlobContainerListDetails blobContainerListDetails) { boolean hasDetails = blobContainerListDetails != null && (blobContainerListDetails.getRetrieveMetadata() || blobContainerListDetails.getRetrieveDeleted()); if (hasDetails) { List<ListBlobContainersIncludeType> flags = new ArrayList<>(2); if (blobContainerListDetails.getRetrieveMetadata()) { flags.add(ListBlobContainersIncludeType.METADATA); } if (blobContainerListDetails.getRetrieveDeleted()) { flags.add(ListBlobContainersIncludeType.DELETED); } return flags; } else { return null; } }

Target:
private List<ListBlobContainersIncludeType> toIncludeTypes(BlobContainerListDetails blobContainerListDetails) { boolean hasDetails = blobContainerListDetails != null && (blobContainerListDetails.getRetrieveMetadata() || blobContainerListDetails.getRetrieveDeleted()); if (hasDetails) { List<ListBlobContainersIncludeType> flags = new ArrayList<>(2); if (blobContainerListDetails.getRetrieveDeleted()) { flags.add(ListBlobContainersIncludeType.DELETED); } if (blobContainerListDetails.getRetrieveMetadata()) { flags.add(ListBlobContainersIncludeType.METADATA); } return flags; } else { return null; } }
Source:
public void onRespondToDataPathRequest(int ndpId, boolean success) { if (VDBG) { Log.v(TAG, "onRespondToDataPathRequest: ndpId=" + ndpId + ", success=" + success); } String networkSpecifier = null; AwareNetworkRequestInformation nnri = null; for (Map.Entry<String, AwareNetworkRequestInformation> entry : mNetworkRequestsCache .entrySet()) { if (entry.getValue().ndpId == ndpId) { networkSpecifier = entry.getKey(); nnri = entry.getValue(); break; } } if (nnri == null) { Log.w(TAG, "onRespondToDataPathRequest: can't find a request with specified ndpId=" + ndpId); if (DBG) { Log.d(TAG, "onRespondToDataPathRequest: network request cache = " + mNetworkRequestsCache); } return; } if (nnri.state != AwareNetworkRequestInformation.STATE_RESPONDER_WAIT_FOR_RESPOND_RESPONSE) { Log.w(TAG, "onRespondToDataPathRequest: request " + networkSpecifier + " is incorrect state=" + nnri.state); mMgr.endDataPath(ndpId); mNetworkRequestsCache.remove(networkSpecifier); return; } nnri.state = AwareNetworkRequestInformation.STATE_RESPONDER_WAIT_FOR_CONFIRM; }

Target:
public void onRespondToDataPathRequest(int ndpId, boolean success) { if (VDBG) { Log.v(TAG, "onRespondToDataPathRequest: ndpId=" + ndpId + ", success=" + success); } String networkSpecifier = null; AwareNetworkRequestInformation nnri = null; for (Map.Entry<String, AwareNetworkRequestInformation> entry : mNetworkRequestsCache .entrySet()) { if (entry.getValue().ndpId == ndpId) { networkSpecifier = entry.getKey(); nnri = entry.getValue(); break; } } if (nnri == null) { Log.w(TAG, "onRespondToDataPathRequest: can't find a request with specified ndpId=" + ndpId); if (DBG) { Log.d(TAG, "onRespondToDataPathRequest: network request cache = " + mNetworkRequestsCache); } return; } if (!success) { Log.w(TAG, "onRespondToDataPathRequest: request " + networkSpecifier + " failed responding"); mMgr.endDataPath(ndpId); mNetworkRequestsCache.remove(networkSpecifier); return; } if (nnri.state != AwareNetworkRequestInformation.STATE_RESPONDER_WAIT_FOR_RESPOND_RESPONSE) { Log.w(TAG, "onRespondToDataPathRequest: request " + networkSpecifier + " is incorrect state=" + nnri.state); mMgr.endDataPath(ndpId); mNetworkRequestsCache.remove(networkSpecifier); return; } nnri.state = AwareNetworkRequestInformation.STATE_RESPONDER_WAIT_FOR_CONFIRM; }
Source:
public void testReplicationQueueMultipleThreads() throws Exception { int numThreads = 5; final int numLoopsPerThread = 2; ExecutorService executor = Executors.newFixedThreadPool(numThreads); for (int i = 0; i < numThreads; i++) { final int i1 = i; executor.execute(new Runnable() { int index = i1; public void run() { for (int j = 0; j < numLoopsPerThread; j++) { cache1.put("key" + index + "_" + j, "value"); } } }); } executor.shutdown(); executor.awaitTermination(10, TimeUnit.SECONDS); eventually(new Condition() { @Override public boolean isSatisfied() throws Exception { return cache2.size() == REPL_QUEUE_MAX_ELEMENTS; } }); ReplicationQueue replicationQueue = TestingUtil.extractComponent(cache1, ReplicationQueue.class); assertEquals(replicationQueue.getElementsCount(), numThreads * numLoopsPerThread - REPL_QUEUE_MAX_ELEMENTS); }

Target:
public void testReplicationQueueMultipleThreads() throws Exception { int numThreads = 5; final int numLoopsPerThread = 2; runConcurrently(new Callable() { AtomicInteger indexOffset = new AtomicInteger(); public Void call() { int index = indexOffset.getAndIncrement(); for (int j = 0; j < numLoopsPerThread; j++) { cache1.put("key" + index + "_" + j, "value"); } return null; } }, numThreads); eventually(new Condition() { @Override public boolean isSatisfied() throws Exception { return cache2.size() == REPL_QUEUE_MAX_ELEMENTS; } }); ReplicationQueue replicationQueue = TestingUtil.extractComponent(cache1, ReplicationQueue.class); assertEquals(replicationQueue.getElementsCount(), numThreads * numLoopsPerThread - REPL_QUEUE_MAX_ELEMENTS); }
Source:
public long getCtime() { return ctime.orElse(metadataStoreCtime.orElse(-1L)); }

Target:
public long getCtime() { return ctime; }
Source:
public void VEDisabledEditorEntryAnonTestsTests_002_MainEditEntry() { ArticlePageObject article = base.openArticleByName(wikiURL, PageContent.articleNamePrefix + base.getTimeStamp()); VisualEditModePageObject ck = article.editArticleInRTEUsingDropdown(); ck.verifyContentLoaded(); ck.clickPublishButton(); }

Target:
public void VEDisabledEditorEntryAnonTestsTests_002_MainEditEntry() { ArticlePageObject article = base.openArticleByName(wikiURL, base.getNameForArticle()); VisualEditModePageObject ck = article.openCKModeWithMainEditButton(); ck.verifyContentLoaded(); ck.clickPublishButton(); }
Source:
public List<Map.Entry<String, RubricRecipientStatistics>> getPerRecipientStatisticsSorted( List<FeedbackResponseAttributes> responses, FeedbackSessionResultsBundle bundle) { Map<String, RubricRecipientStatistics> recipientToRecipientStats = new HashMap<>(); for (FeedbackResponseAttributes response : responses) { if (!recipientToRecipientStats.containsKey(response.recipient)) { String recipient = response.recipient; String recipientTeam = bundle.getTeamNameForEmail(recipient); String recipientName = bundle.getNameForEmail(recipient); RubricRecipientStatistics recipientStats = new RubricRecipientStatistics(recipient, recipientName, recipientTeam); recipientToRecipientStats.put(recipient, recipientStats); } recipientToRecipientStats.get(response.recipient).addResponseToRecipientStats(response); } List<Map.Entry<String, RubricRecipientStatistics>> recipientStatsList = new LinkedList<>(recipientToRecipientStats.entrySet()); recipientStatsList.sort((Map.Entry<String, RubricRecipientStatistics> obj1, Map.Entry<String, RubricRecipientStatistics> obj2) -> { RubricRecipientStatistics a = obj1.getValue(); RubricRecipientStatistics b = obj2.getValue(); if (a.recipientTeam.equalsIgnoreCase(b.recipientTeam)) { return a.recipientName.compareTo(b.recipientName); } else { return a.recipientTeam.compareTo(b.recipientTeam); } }); return recipientStatsList; }

Target:
public List<Map.Entry<String, RubricRecipientStatistics>> getPerRecipientStatisticsSorted( List<FeedbackResponseAttributes> responses, FeedbackSessionResultsBundle bundle) { Map<String, RubricRecipientStatistics> recipientToRecipientStats = new HashMap<>(); for (FeedbackResponseAttributes response : responses) { if (!recipientToRecipientStats.containsKey(response.recipient)) { String recipient = response.recipient; String recipientTeam = bundle.getTeamNameForEmail(recipient); String recipientName = bundle.getNameForEmail(recipient); RubricRecipientStatistics recipientStats = new RubricRecipientStatistics(recipient, recipientName, recipientTeam); recipientToRecipientStats.put(recipient, recipientStats); } recipientToRecipientStats.get(response.recipient).addResponseToRecipientStats(response); } List<Map.Entry<String, RubricRecipientStatistics>> recipientStatsList = new LinkedList<>(recipientToRecipientStats.entrySet()); recipientStatsList.sort(Comparator.comparing((Map.Entry<String, RubricRecipientStatistics> obj) -> obj.getValue().recipientTeam.toLowerCase()) .thenComparing(obj -> obj.getValue().recipientName)); return recipientStatsList; }
Source:
private void sendEmailAlert(AbstractJobAlert jobAlert, String alertLink, String reason, Map<String, String> errors) { String description = jobAlert.description; boolean blankDescription = StringUtils.isBlank(description); String shortDescription = description.split("\n")[0]; if (blankDescription) { shortDescription = errors.keySet().toString(); } String subject = String.format("%s %s - %s", reason, jobAlert.getTypeString(), shortDescription); StringBuilder sb = new StringBuilder(reason + ' ' + jobAlert.getTypeString() + '\n'); sb.append("Alert link : ").append(alertLink).append('\n'); if (!blankDescription) { sb.append("Alert Description : ").append(description).append('\n'); } for (Map.Entry<String, String> entry : errors.entrySet()) { sb.append(emailSummary(spawn.getJob(entry.getKey()))).append('\n'); sb.append("Error Message\n"); sb.append(entry.getValue()); sb.append("\n------------------------------\n"); } if (!EmailUtil.email(jobAlert.email, subject, sb.toString())) { log.error("Unable to send email for alert {}", jobAlert.alertId); } }

Target:
private void sendEmailAlert(AbstractJobAlert jobAlert, String alertLink, String reason, Map<String, String> errors) { String description = jobAlert.description; boolean blankDescription = StringUtils.isBlank(description); final String shortDescription; if (blankDescription) { shortDescription = errors.keySet().toString(); } else { shortDescription = description.split("\n")[0]; } String subject = String.format("%s %s - %s", reason, jobAlert.getTypeString(), shortDescription); StringBuilder sb = new StringBuilder(reason + ' ' + jobAlert.getTypeString() + '\n'); sb.append("Alert link : ").append(alertLink).append('\n'); if (!blankDescription) { sb.append("Alert Description : ").append(description).append('\n'); } for (Map.Entry<String, String> entry : errors.entrySet()) { sb.append(emailSummary(spawn.getJob(entry.getKey()))).append('\n'); sb.append("Error Message\n"); sb.append(entry.getValue()); sb.append("\n------------------------------\n"); } if (!EmailUtil.email(jobAlert.email, subject, sb.toString())) { log.error("Unable to send email for alert {}", jobAlert.alertId); } }
Source:
protected void performPlugCommand(VDSCommandType commandType, Disk disk, VmDevice vmDevice) { if (disk.getDiskStorageType() == DiskStorageType.LUN) { LunDisk lunDisk = (LunDisk) disk; if (commandType == VDSCommandType.HotPlugDisk) { LUNs lun = lunDisk.getLun(); updateLUNConnectionsInfo(lun); Map<StorageType, List<StorageServerConnections>> lunsByStorageType = StorageHelperBase.filterConnectionsByStorageType(lun); for (StorageType storageType : lunsByStorageType.keySet()) { if (!getStorageHelper(storageType).connectStorageToLunByVdsId(null, getVm().getRunOnVds(), lun, getVm().getStoragePoolId())) { throw new VdcBLLException(VdcBllErrors.StorageServerConnectionError); } } } } else if (disk.getDiskStorageType() == DiskStorageType.CINDER) { CinderDisk cinderDisk = (CinderDisk) disk; setStorageDomainId(cinderDisk.getStorageIds().get(0)); try { CinderConnectionInfo connectionInfo = getCinderConnectionInfo(cinderDisk); CinderVolumeDriver cinderVolumeDriver = CinderVolumeDriver.forValue(connectionInfo.getDriverVolumeType()); if (cinderVolumeDriver == null) { addCustomValue("DiskAlias", cinderDisk.getDiskAlias()); auditLogDirector.log(this, AuditLogType.CINDER_DISK_CONNECTION_VOLUME_DRIVER_UNSUPPORTED); } cinderDisk.setCinderConnectionInfo(connectionInfo); } catch (OpenStackResponseException ex) { addCustomValue("DiskAlias", cinderDisk.getDiskAlias()); auditLogDirector.log(this, AuditLogType.CINDER_DISK_CONNECTION_FAILURE); throw ex; } } runVdsCommand(commandType, new HotPlugDiskVDSParameters(getVm().getRunOnVds(), getVm(), disk, vmDevice)); }

Target:
protected void performPlugCommand(VDSCommandType commandType, Disk disk, VmDevice vmDevice) { if (disk.getDiskStorageType() == DiskStorageType.LUN) { LunDisk lunDisk = (LunDisk) disk; if (commandType == VDSCommandType.HotPlugDisk) { LUNs lun = lunDisk.getLun(); updateLUNConnectionsInfo(lun); Map<StorageType, List<StorageServerConnections>> lunsByStorageType = StorageHelperBase.filterConnectionsByStorageType(lun); for (StorageType storageType : lunsByStorageType.keySet()) { if (!getStorageHelper(storageType).connectStorageToLunByVdsId(null, getVm().getRunOnVds(), lun, getVm().getStoragePoolId())) { throw new VdcBLLException(VdcBllErrors.StorageServerConnectionError); } } } } else if (disk.getDiskStorageType() == DiskStorageType.CINDER) { CinderDisk cinderDisk = (CinderDisk) disk; setStorageDomainId(cinderDisk.getStorageIds().get(0)); getCinderBroker().updateConnectionInfoForDisk(cinderDisk); } runVdsCommand(commandType, new HotPlugDiskVDSParameters(getVm().getRunOnVds(), getVm(), disk, vmDevice)); }
Source:
private synchronized Map<PlanNodeId, TaskSource> updateSources(List<TaskSource> sources) { Map<PlanNodeId, TaskSource> updatedUnpartitionedSources = new HashMap<>(); long currentMaxAcknowledgedSplit = this.maxAcknowledgedSplit; sources = sources.stream() .map(source -> new TaskSource( source.getPlanNodeId(), source.getSplits().stream() .filter(scheduledSplit -> scheduledSplit.getSequenceId() > currentMaxAcknowledgedSplit) .collect(Collectors.toSet()), source.getNoMoreSplitsForDriverGroup(), source.isNoMoreSplits())) .collect(toList()); for (TaskSource source : sources) { if (partitionedDriverRunnerFactories.containsKey(source.getPlanNodeId())) { schedulePartitionedSource(source); } else { scheduleUnpartitionedSource(source, updatedUnpartitionedSources); } } for (DriverSplitRunnerFactory driverSplitRunnerFactory : Iterables.concat(partitionedDriverRunnerFactories.values(), unpartitionedAllAtOnceDriverRunnerFactories, unpartitionedGroupedDriverRunnerFactories)) { driverSplitRunnerFactory.closeDriverFactoryIfFullyCreated(); } maxAcknowledgedSplit = sources.stream() .flatMap(source -> source.getSplits().stream()) .mapToLong(ScheduledSplit::getSequenceId) .max() .orElse(maxAcknowledgedSplit); return updatedUnpartitionedSources; }

Target:
private synchronized Map<PlanNodeId, TaskSource> updateSources(List<TaskSource> sources) { Map<PlanNodeId, TaskSource> updatedUnpartitionedSources = new HashMap<>(); long currentMaxAcknowledgedSplit = this.maxAcknowledgedSplit; sources = sources.stream() .map(source -> new TaskSource( source.getPlanNodeId(), source.getSplits().stream() .filter(scheduledSplit -> scheduledSplit.getSequenceId() > currentMaxAcknowledgedSplit) .collect(Collectors.toSet()), source.getNoMoreSplitsForLifespan(), source.isNoMoreSplits())) .collect(toList()); for (TaskSource source : sources) { if (driverRunnerFactoriesWithSplitLifeCycle.containsKey(source.getPlanNodeId())) { schedulePartitionedSource(source); } else { scheduleUnpartitionedSource(source, updatedUnpartitionedSources); } } for (DriverSplitRunnerFactory driverSplitRunnerFactory : Iterables.concat(driverRunnerFactoriesWithSplitLifeCycle.values(), driverRunnerFactoriesWithTaskLifeCycle, driverRunnerFactoriesWithDriverGroupLifeCycle)) { driverSplitRunnerFactory.closeDriverFactoryIfFullyCreated(); } maxAcknowledgedSplit = sources.stream() .flatMap(source -> source.getSplits().stream()) .mapToLong(ScheduledSplit::getSequenceId) .max() .orElse(maxAcknowledgedSplit); return updatedUnpartitionedSources; }
Source:
public boolean cleanupRules() { if (!_canBridgeFirewall) { return false; } final Script cmd = new Script(_securityGroupPath, _timeout.getMillis(), s_logger); cmd.add("cleanup_rules"); final String result = cmd.execute(); if (result != null) { return false; } return true; }

Target:
public boolean cleanupRules() { if (!_canBridgeFirewall) { return false; } final Script cmd = new Script(_securityGroupPath, _timeout, s_logger); cmd.add("cleanup_rules"); final String result = cmd.execute(); if (result != null) { return false; } return true; }
Source:
public void testSignalNewProcessWithAlias() throws Exception { Map<String, Object> params = new HashMap<>(); params.put("nullAccepted", false); Long oldProcessInstanceId = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_SIGNAL_PROCESS, params); assertNotNull(oldProcessInstanceId); assertTrue(oldProcessInstanceId > 0); createExtraContainer(); Long processInstanceId = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_SIGNAL_PROCESS_2, params); assertNotNull(processInstanceId); assertTrue(processInstanceId > 0); List<String> availableSignals = processClient.getAvailableSignals(CONTAINER_ALIAS, processInstanceId); assertNotNull(availableSignals); assertEquals(2, availableSignals.size()); assertTrue(availableSignals.contains("Signal1")); assertTrue(availableSignals.contains("Signal2")); Object person = createPersonInstance(USER_JOHN); processClient.signalProcessInstance(CONTAINER_ALIAS, processInstanceId, "Signal1", person); processClient.signalProcessInstances(CONTAINER_ALIAS, Collections.singletonList(processInstanceId), "Signal2", "My custom string event"); ProcessInstance pi = processClient.getProcessInstance(CONTAINER_ALIAS, processInstanceId); assertNotNull(pi); assertEquals(org.kie.api.runtime.process.ProcessInstance.STATE_COMPLETED, pi.getState().intValue()); pi = processClient.getProcessInstance(CONTAINER_ALIAS, oldProcessInstanceId); assertNotNull(pi); assertEquals(org.kie.api.runtime.process.ProcessInstance.STATE_ACTIVE, pi.getState().intValue()); }

Target:
public void testSignalNewProcessWithAlias() throws Exception { Map<String, Object> params = new HashMap<>(); params.put("nullAccepted", false); Long oldPid = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_SIGNAL_PROCESS, params); assertThat(oldPid).isNotNull().isGreaterThan(0); createExtraContainer(); Long pid = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_SIGNAL_PROCESS_2, params); assertThat(pid).isNotNull().isGreaterThan(0); List<String> availableSignals = processClient.getAvailableSignals(CONTAINER_ALIAS, pid); assertThat(availableSignals).isNotNull().hasSize(2); assertThat(availableSignals).contains("Signal1"); assertThat(availableSignals).contains("Signal2"); Object person = createPersonInstance(USER_JOHN); processClient.signalProcessInstance(CONTAINER_ALIAS, pid, "Signal1", person); processClient.signalProcessInstances(CONTAINER_ALIAS, Collections.singletonList(pid), "Signal2", "My custom string event"); ProcessInstance pi = processClient.getProcessInstance(CONTAINER_ALIAS, pid); assertThat(pi).isNotNull(); assertThat(pi.getState()).isEqualTo(org.kie.api.runtime.process.ProcessInstance.STATE_COMPLETED); pi = processClient.getProcessInstance(CONTAINER_ALIAS, oldPid); assertThat(pi).isNotNull(); assertThat(pi.getState()).isEqualTo(org.kie.api.runtime.process.ProcessInstance.STATE_ACTIVE); }
Source:
public Collection<IAtsWorkPackage> getWorkPackageOptions(IAtsObject object, List<IAtsWorkPackage> workPackageOptions) throws OseeCoreException { if (object instanceof IAtsConfigObject) { IAtsConfigObject configObj = (IAtsConfigObject) object; Artifact artifact = AtsClientService.get().getArtifact(configObj); if (artifact != null) { for (Artifact workPackageArt : artifact.getRelatedArtifacts(AtsRelationTypes.WorkPackage_WorkPackage)) { workPackageOptions.add(new WorkPackageArtifact(workPackageArt)); } } } if (object instanceof IAtsTeamWorkflow) { IAtsTeamWorkflow teamWf = (IAtsTeamWorkflow) object; getWorkPackageOptions(teamWf.getTeamDefinition(), workPackageOptions); for (IAtsActionableItem ai : teamWf.getActionableItems()) { getWorkPackageOptions(ai, workPackageOptions); } } else if (object instanceof IAtsWorkItem) { IAtsWorkItem workItem = (IAtsWorkItem) object; IAtsTeamWorkflow teamWf = workItem.getParentTeamWorkflow(); if (teamWf != null) { getWorkPackageOptions(teamWf, workPackageOptions); } else if (workItem instanceof IAtsAbstractReview) { IAtsAbstractReview review = (IAtsAbstractReview) workItem; for (IAtsActionableItem ai : review.getActionableItems()) { getWorkPackageOptions(ai, workPackageOptions); if (ai.getTeamDefinition() != null) { getWorkPackageOptions(ai.getTeamDefinition(), workPackageOptions); } } } } return workPackageOptions; }

Target:
public Collection<IAtsWorkPackage> getWorkPackageOptions(IAtsObject object, List<IAtsWorkPackage> workPackageOptions) throws OseeCoreException { if (object instanceof IAtsConfigObject) { IAtsConfigObject configObj = (IAtsConfigObject) object; Artifact artifact = AtsClientService.get().getArtifact(configObj); if (artifact != null) { for (Artifact workPackageArt : artifact.getRelatedArtifacts(AtsRelationTypes.WorkPackage_WorkPackage)) { workPackageOptions.add(new WorkPackageArtifact(workPackageArt)); } } } else if (object instanceof IAtsTeamWorkflow) { IAtsTeamWorkflow teamWf = (IAtsTeamWorkflow) object; getWorkPackageOptions(teamWf.getTeamDefinition(), workPackageOptions); for (IAtsActionableItem ai : teamWf.getActionableItems()) { getWorkPackageOptions(ai, workPackageOptions); } } else if (object instanceof IAtsWorkItem) { IAtsWorkItem workItem = (IAtsWorkItem) object; IAtsTeamWorkflow teamWf = workItem.getParentTeamWorkflow(); if (teamWf != null) { getWorkPackageOptions(teamWf, workPackageOptions); } else if (workItem instanceof IAtsAbstractReview) { IAtsAbstractReview review = (IAtsAbstractReview) workItem; for (IAtsActionableItem ai : review.getActionableItems()) { getWorkPackageOptions(ai, workPackageOptions); if (ai.getTeamDefinition() != null) { getWorkPackageOptions(ai.getTeamDefinition(), workPackageOptions); } } } } return workPackageOptions; }
Source:
public boolean canConsumeBandwidth() { if (!isBandwidthRestricted()) { return true; } synchronized (lock) { if (currentBandwidthConsumption >= 0) { return true; } } return false; }

Target:
public boolean canConsumeBandwidth() { if (!isBandwidthRestricted()) { return true; } synchronized (lock) { return currentBandwidthConsumption >= 0; } }
Source:
public static EmailConfiguration getByProps(final Properties props) { EmailConfiguration configuration = new EmailConfiguration(); configuration.setHost(props.getProperty("email.host")); configuration.setPort(Integer.parseInt(props.getOrDefault("email.port", "25").toString())); configuration.setProtocol(props.getOrDefault("email.protocol", "smtp").toString()); configuration.setUsername(props.getProperty("email.username")); configuration.setPassword(props.getProperty("email.password")); configuration.setUseSsl(Boolean.parseBoolean(props.getOrDefault("email.useSsl", "false").toString())); configuration.setSubject(props.getOrDefault("email.subject", "ElasticJob error message").toString()); configuration.setFrom(props.getProperty("email.form")); configuration.setTo(props.getProperty("email.to")); configuration.setCc(props.getProperty("email.cc")); configuration.setBcc(props.getProperty("email.bcc")); configuration.setDebug(Boolean.parseBoolean(props.getOrDefault("email.debug", "false").toString())); return configuration; }

Target:
public static EmailConfiguration getByProps(final Properties props) { EmailConfiguration configuration = new EmailConfiguration(); configuration.setHost(props.getProperty(EmailConstants.EMAIL_HOST)); configuration.setPort(Integer.parseInt(props.getProperty(EmailConstants.EMAIL_PORT))); configuration.setProtocol(props.getProperty(EmailConstants.EMAIL_PROTOCOL)); configuration.setUsername(props.getProperty(EmailConstants.EMAIL_USERNAME)); configuration.setPassword(props.getProperty(EmailConstants.EMAIL_PASSWORD)); configuration.setUseSsl(Boolean.parseBoolean(props.getOrDefault(EmailConstants.EMAIL_USE_SSL, Boolean.FALSE.toString()).toString())); configuration.setSubject(props.getOrDefault(EmailConstants.EMAIL_SUBJECT, EmailConstants.DEFAULT_EMAIL_SUBJECT).toString()); configuration.setFrom(props.getProperty(EmailConstants.EMAIL_FROM)); configuration.setTo(props.getProperty(EmailConstants.EMAIL_TO)); configuration.setCc(props.getProperty(EmailConstants.EMAIL_CC)); configuration.setBcc(props.getProperty(EmailConstants.EMAIL_BCC)); configuration.setDebug(Boolean.parseBoolean(props.getOrDefault(EmailConstants.EMAIL_DEBUG, Boolean.FALSE.toString()).toString())); return configuration; }
Source:
private void serverStopping( FMLServerStoppingEvent event ) { WorldData.onServerAboutToStart(); TickHandler.INSTANCE.shutdown(); }

Target:
private void serverStopping( FMLServerStoppingEvent event ) { WorldData.instance().onServerStopping(); TickHandler.INSTANCE.shutdown(); }
Source:
public void testSrcDstAs() { long value1 = 2147483648L; long value2 = 2147483649L; final BsonDocument bson = getBsonDocument("bgpSourceAsNumber", value1, "bgpDestinationAsNumber", value2); final IpfixFlow flow = new IpfixFlow(bson); Assert.assertTrue(flow.getSrcAs() > 0); Assert.assertEquals(value1, flow.getSrcAs().longValue()); Assert.assertTrue(flow.getDstAs() > 0); Assert.assertEquals(value2, flow.getDstAs().longValue()); }

Target:
public void testSrcDstAs() { long value1 = 2147483648L; long value2 = 2147483649L; final BsonDocument bson = getBsonDocument("bgpSourceAsNumber", value1, "bgpDestinationAsNumber", value2); final IpfixFlow flow = new IpfixFlow(bson); assertThat(flow.getSrcAs(), is(equalTo(value1))); assertThat(flow.getDstAs(), is(equalTo(value2))); }
Source:
public Optional<Collection<VirtualGatewayInterface>> getGatewayInterfaces(VirtualGatewayInstance gateway) { return l3manager.getGatewayInterfaces(gateway); }

Target:
public Collection<VirtualGatewayInterface> getGatewayInterfaces(VirtualGatewayInstance gateway) { return l3manager.getGatewayInterfaces(gateway); }
Source:
public boolean toggleProfile(Boolean enabled) { Map<String,String> params = new HashMap<>(); params.put("active", enabled.toString()); try { String uri = BASE_PROFILE + uriEncode(this._profileName) + "/" + BASE_CLIENTS + "/"; if (_clientId == null) { uri += "-1"; } else { uri += _clientId; } JSONObject response = new JSONObject(doPost(uri, params)); System.out.println("Response is :"+ response.toString()); } catch (Exception e) { System.out.println(e.getMessage()); return false; } return true; }

Target:
public boolean toggleProfile(Boolean enabled) { final Map<String,String> params = new HashMap<>(); params.put("active", enabled.toString()); try { String uri = BASE_PROFILE + uriEncode(this._profileName) + "/" + BASE_CLIENTS + "/"; if (_clientId == null) { uri += "-1"; } else { uri += _clientId; } JSONObject response = new JSONObject(doPost(uri, params)); } catch (Exception e) { return false; } return true; }
Source:
public String getAmbassadorContainerImage() { return String.valueOf(properties.getOrDefault("ambassador.container.image", "richnorth/ambassador:latest")).trim(); }

Target:
public String getAmbassadorContainerImage() { return (String) properties.getOrDefault("ambassador.container.image", "richnorth/ambassador:latest"); }
Source:
public boolean handles(final Object columnElement, final Object rowElement, final INattableModelManager tableManager) { if (super.handles(columnElement, rowElement, tableManager)) { final List<Object> objects = organizeAndResolvedObjects(columnElement, rowElement, null); if (objects.size() == 2) { final EObject object = (EObject) objects.get(0); if (object instanceof Port) { String propertyQualifiedName = (String) objects.get(1); propertyQualifiedName = propertyQualifiedName.substring(Constants.PROPERTY_OF_STEREOTYPE_PREFIX.length(), propertyQualifiedName.length()); return propertyQualifiedName.equals(org.eclipse.papyrus.sysml14.nattable.common.utils.Constants.STEREOTYPE_FLOWPORT_DIRECTION); } } } return false; }

Target:
public boolean handles(final Object columnElement, final Object rowElement, final INattableModelManager tableManager) { if (super.handles(columnElement, rowElement, tableManager)) { final List<Object> objects = organizeAndResolvedObjects(columnElement, rowElement, null); if (2 == objects.size()) { final EObject object = (EObject) objects.get(0); if (object instanceof Port) { final Object propertyQualifiedName = objects.get(1); if (propertyQualifiedName instanceof String) { final String propertyQualifiedNameString = ((String) propertyQualifiedName).substring(Constants.PROPERTY_OF_STEREOTYPE_PREFIX.length(), ((String) propertyQualifiedName).length()); return org.eclipse.papyrus.sysml14.nattable.common.utils.Constants.STEREOTYPE_FLOWPORT_DIRECTION.equals(propertyQualifiedNameString); } } } } return false; }
Source:
public void destroyNode(String id) { VirtualGuest guest = getNode(id); if (guest == null) return; logger.debug(">> awaiting virtualGuest(%s) without active transactions", guest.getId()); checkState(retry(new Predicate<VirtualGuest>() { public boolean apply(VirtualGuest guest) { guest = getNode(guest.getId() + ""); return guest.getActiveTransactionCount() == 0; } }, activeTransactionsDelay).apply(guest), "%s still has active transactions!", guest); logger.debug(">> canceling virtualGuest with globalIdentifier(%s)", id); checkState(api.getVirtualGuestApi().deleteObject(guest.getId()), "server(%s) still there after deleting!?", id); }

Target:
public void destroyNode(String id) { VirtualGuest guest = getNode(id); if (guest == null) return; logger.debug(">> awaiting virtualGuest(%s) without active transactions", guest.getId()); checkState(retry(new Predicate<VirtualGuest>() { public boolean apply(VirtualGuest guest) { return getNode(guest.getId() + "").getActiveTransactionCount() == 0; } }, activeTransactionsDelay).apply(guest), "%s still has active transactions!", guest); logger.debug(">> canceling virtualGuest with globalIdentifier(%s)", id); checkState(api.getVirtualGuestApi().deleteVirtualGuest(guest.getId()), "server(%s) still there after deleting!?", id); }
Source:
public void testMakeWriterForSamExtension() throws IOException { final File tmpFile = File.createTempFile("testMakeWriterForSamExtension", ".sam"); tmpFile.deleteOnExit(); final SAMFileWriter samFileWriter = new SAMFileWriterFactory().makeWriter(new SAMFileHeader(), true, tmpFile, null); samFileWriter.close(); final FileInputStream fis = new FileInputStream(tmpFile); for (byte b:"@HD\tVN:".getBytes()) { Assert.assertEquals((byte)(fis.read() & 0xFF), b); } fis.close(); }

Target:
public void testMakeWriterForSamExtension() throws IOException { final File tmpFile = File.createTempFile("testMakeWriterForSamExtension", "." + SAM_TYPE.fileExtension()); tmpFile.deleteOnExit(); try (SAMFileWriter ignored = new SAMFileWriterFactory().makeWriter(new SAMFileHeader(), true, tmpFile, null)) try (FileInputStream fis = new FileInputStream(tmpFile)) { for (byte b : "@HD\tVN:".getBytes()) { Assert.assertEquals((byte) (fis.read() & 0xFF), b); } } }
Source:
private boolean ownedByDeploymentGroup(final Deployment deployment, final DeploymentGroup deploymentGroup) { if (Objects.equals(deployment.getDeploymentGroupName(), deploymentGroup.getName())) { return true; } if (deploymentGroup.getRolloutOptions().getMigrate() && deployment.getJobId().equals(deploymentGroup.getJobId())) { return true; } return false; }

Target:
private boolean ownedByDeploymentGroup(final Deployment deployment, final DeploymentGroup deploymentGroup) { return Objects.equals(deployment.getDeploymentGroupName(), deploymentGroup.getName()); }
Source:
public QueryResponse executeQuery(SolrQuery query) { QueryResponse response = null; try { response = solrServer.query(query); } catch (SolrServerException e) { throw new SolrSearchExecutionException("Couldn't execute query", e); } return response; }

Target:
public QueryResponse executeQuery(SolrQuery query) { Preconditions.checkNotNull(query); QueryResponse response = null; try { response = solrServer.query(query); } catch (SolrServerException e) { throw new SolrSearchExecutionException("Couldn't execute query", e); } return response; }
Source:
public void shouldTransform() { String transformed = of(42).transform(v -> String.valueOf(v.get())); assertThat(transformed).isEqualTo("42"); }

Target:
public void shouldTransform() { final String transformed = of(1).transform(v -> String.valueOf(v.get())); assertThat(transformed).isEqualTo("1"); }
Source:
public void toJSONString(JSONStringer stringer) throws JSONException { super.toJSONString(stringer); stringer.key("AGGREGATE_COLUMNS") .array(); for (int ii = 0; ii < m_aggregateTypes.size(); ii++) { stringer.object(); stringer.key(Members.AGGREGATE_TYPE.name()).value(m_aggregateTypes.get(ii).name()); boolean isDistinct = m_aggregateDistinct.get(ii); stringer.key(Members.AGGREGATE_DISTINCT.name()).value(isDistinct ? 1 : 0); stringer.key(Members.AGGREGATE_OUTPUT_COLUMN.name()).value(m_aggregateOutputColumns.get(ii)); AbstractExpression.toJSONArray(stringer, Members.AGGREGATE_EXPRESSIONS.name(), m_aggregateExpressions.get(ii)); stringer.endObject(); } stringer.endArray(); AbstractExpression.toJSONArray(stringer, Members.PARTITIONBY_EXPRESSIONS.name(), m_partitionByExpressions); AbstractExpression.toJSONArrayFromSortList(stringer, m_orderByExpressions, null); }

Target:
public void toJSONString(JSONStringer stringer) throws JSONException { super.toJSONString(stringer); stringer.key("AGGREGATE_COLUMNS") .array(); for (int ii = 0; ii < m_aggregateTypes.size(); ii++) { stringer.object(); stringer.keySymbolValuePair(Members.AGGREGATE_TYPE.name(), m_aggregateTypes.get(ii).name()); boolean isDistinct = m_aggregateDistinct.get(ii); stringer.keySymbolValuePair(Members.AGGREGATE_DISTINCT.name(), isDistinct ? 1 : 0); stringer.keySymbolValuePair(Members.AGGREGATE_OUTPUT_COLUMN.name(), m_aggregateOutputColumns.get(ii)); AbstractExpression.toJSONArray(stringer, Members.AGGREGATE_EXPRESSIONS.name(), m_aggregateExpressions.get(ii)); stringer.endObject(); } stringer.endArray(); AbstractExpression.toJSONArray(stringer, Members.PARTITIONBY_EXPRESSIONS.name(), m_partitionByExpressions); AbstractExpression.toJSONArrayFromSortList(stringer, m_orderByExpressions, null); }
Source:
public String getConfigurationValue(String miimonValue){ String extraOption = ""; if (value.equals(BondMode.BOND4.value)) { extraOption = " xmit_hash_policy=" + BOND_XMIT_POLICY_LAYER23; } return MODE + value + " miimon=" + miimonValue + extraOption; }

Target:
public String getConfigurationValue(String miimonValue){ String extraOption; if (value.equals(BondMode.BOND4.value)) { extraOption = " xmit_hash_policy=" + BOND_XMIT_POLICY_LAYER23; } else { extraOption = ""; } return MODE + value + " miimon=" + miimonValue + extraOption; }
Source:
protected static ExecCredential getExecCredentialFromExecConfig(ExecConfig exec, File configFile) throws IOException, InterruptedException { String apiVersion = exec.getApiVersion(); if ("client.authentication.k8s.io/v1alpha1".equals(apiVersion) || "client.authentication.k8s.io/v1beta1".equals(apiVersion)) { List<ExecEnvVar> env = exec.getEnv(); ProcessBuilder pb = new ProcessBuilder(getAuthenticatorCommandFromExecConfig(exec, configFile, Utils.getSystemPathVariable())); pb.redirectErrorStream(true); if (env != null) { Map<String, String> environment = pb.environment(); env.forEach(var -> environment.put(var.getName(), var.getValue())); } Process p = pb.start(); StringBuilder sb = new StringBuilder(); try (BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()))) { String line; while ((line = in.readLine()) != null) { sb.append(line); } } if (p.waitFor() != 0) { LOGGER.warn(sb.toString()); } ExecCredential ec = Serialization.unmarshal(sb.toString(), ExecCredential.class); if (!apiVersion.equals(ec.apiVersion)) { LOGGER.warn("Wrong apiVersion vs. {}", ec.apiVersion, apiVersion); } else { return ec; } } else { LOGGER.warn("Unsupported apiVersion: {}", apiVersion); } return null; }

Target:
protected static ExecCredential getExecCredentialFromExecConfig(ExecConfig exec, File configFile) throws IOException, InterruptedException { String apiVersion = exec.getApiVersion(); if ("client.authentication.k8s.io/v1alpha1".equals(apiVersion) || "client.authentication.k8s.io/v1beta1".equals(apiVersion)) { List<ExecEnvVar> env = exec.getEnv(); ProcessBuilder pb = new ProcessBuilder(getAuthenticatorCommandFromExecConfig(exec, configFile, Utils.getSystemPathVariable())); pb.redirectErrorStream(true); if (env != null) { Map<String, String> environment = pb.environment(); env.forEach(var -> environment.put(var.getName(), var.getValue())); } Process p = pb.start(); String output; try (InputStream is = p.getInputStream()) { output = IOHelpers.readFully(is); } if (p.waitFor() != 0) { LOGGER.warn(output); } ExecCredential ec = Serialization.unmarshal(output, ExecCredential.class); if (!apiVersion.equals(ec.apiVersion)) { LOGGER.warn("Wrong apiVersion vs. {}", ec.apiVersion, apiVersion); } else { return ec; } } else { LOGGER.warn("Unsupported apiVersion: {}", apiVersion); } return null; }
Source:
public void checkIndentation() { final DetailAST firstChild = getMainAst().getFirstChild(); final DetailAST mainAst = getMainAst(); if (isOnStartOfLine(mainAst) && !getMainAst().getParent().getParent().getText().equals(ASSIGNMENT)) { final int columnNo = expandedTabsColumnNo(mainAst); final IndentLevel level = getIndentImpl(); if (columnNo < level.getFirstIndentLevel()) { logError(mainAst, "", columnNo, level); } } if (firstChild != null) { checkExpressionSubtree(firstChild, getIndent(), false, false); } final DetailAST lparen = mainAst.findFirstToken(TokenTypes.LPAREN); checkLeftParen(lparen); }

Target:
public void checkIndentation() { if (isOnStartOfLine(mainAst) && !isNewKeywordFollowedByAssign()) { final int columnNo = expandedTabsColumnNo(mainAst); final IndentLevel level = getIndentImpl(); if (columnNo < level.getFirstIndentLevel()) { logError(mainAst, "", columnNo, level); } } final DetailAST firstChild = mainAst.getFirstChild(); if (firstChild != null) { checkExpressionSubtree(firstChild, getIndent(), false, false); } final DetailAST lparen = mainAst.findFirstToken(TokenTypes.LPAREN); checkLeftParen(lparen); }
Source:
public Iterable<TaskSummary> children(String taskId) { Task<?> t = mgmt().getExecutionManager().getTask(taskId); if (t==null) throw WebResourceUtils.notFound("Cannot find task '%s'", taskId); if (!(t instanceof HasTaskChildren)) return Collections.emptyList(); return Collections2.transform(Lists.<Task<?>>newArrayList( (Iterable<Task<?>>)(Iterable<?>)((HasTaskChildren)t).getChildren() ), TaskTransformer.FROM_TASK); }

Target:
public Iterable<TaskSummary> children(String taskId) { Task<?> t = mgmt().getExecutionManager().getTask(taskId); if (t==null) throw WebResourceUtils.notFound("Cannot find task '%s'", taskId); if (!(t instanceof HasTaskChildren)) return Collections.emptyList(); return Collections2.transform(Lists.newArrayList(((HasTaskChildren)t).getChildren()), TaskTransformer.FROM_TASK); }
Source:
private NonBlockingRouter getNonBlockingRouter() throws IOException { Properties properties = new Properties(); properties.setProperty("router.hostname", "localhost"); properties.setProperty("router.datacenter.name", "DC1"); properties.setProperty("router.max.put.chunk.size.bytes", Integer.toString(chunkSize)); properties.setProperty("router.put.request.parallelism", Integer.toString(requestParallelism)); properties.setProperty("router.put.success.target", Integer.toString(successTarget)); VerifiableProperties vProps = new VerifiableProperties(properties); router = new NonBlockingRouter(new RouterConfig(vProps), new NonBlockingRouterMetrics(new MetricRegistry()), new MockNetworkClientFactory(vProps, mockSelectorState, MAX_PORTS_PLAIN_TEXT, MAX_PORTS_SSL, CHECKOUT_TIMEOUT_MS, mockServerLayout, mockTime), new LoggingNotificationSystem(), mockClusterMap, mockTime); return router; }

Target:
private NonBlockingRouter getNonBlockingRouter() throws IOException { Properties properties = new Properties(); properties.setProperty("router.hostname", "localhost"); properties.setProperty("router.datacenter.name", "DC1"); properties.setProperty("router.max.put.chunk.size.bytes", Integer.toString(chunkSize)); properties.setProperty("router.put.request.parallelism", Integer.toString(requestParallelism)); properties.setProperty("router.put.success.target", Integer.toString(successTarget)); VerifiableProperties vProps = new VerifiableProperties(properties); router = new NonBlockingRouter(new RouterConfig(vProps), new NonBlockingRouterMetrics(mockClusterMap.getMetricRegistry()), new MockNetworkClientFactory(vProps, mockSelectorState, MAX_PORTS_PLAIN_TEXT, MAX_PORTS_SSL, CHECKOUT_TIMEOUT_MS, mockServerLayout, mockTime), new LoggingNotificationSystem(), mockClusterMap, mockTime); return router; }
Source:
public void testGetStrippedVdsUniqueIdWithUnacceptedChars() { RegisterVdsParameters paramsMock = getQueryParameters(); when(paramsMock.getVdsUniqueId()).thenReturn("Test_^123^"); String result = getQuery().getStrippedVdsUniqueId(); assertEquals("Vds id doesn't equal to the expected value", "Test_123", result); }

Target:
public void testGetStrippedVdsUniqueIdWithUnacceptedChars() { String result = this.gerStrippedVdsUniqueId("Test_123"); assertEquals("Vds id doesn't equal to the expected value", "Test_123", result); }
Source:
public void aadAwareClientRepository() { AnnotationConfigApplicationContext context = getContext(); TestPropertySourceUtils.addInlinedPropertiesToEnvironment(context, "azure.activedirectory.authorization.graph.scopes = Calendars.Read"); context.refresh(); AzureClientRegistrationRepository clientRepo = context.getBean(AzureClientRegistrationRepository.class); ClientRegistration azure = clientRepo.findByRegistrationId("azure"); ClientRegistration graph = clientRepo.findByRegistrationId("graph"); assertDefaultScopes( clientRepo.getAzureClient(), "openid", "profile", "offline_access", "<LINK_0>" ); assertEquals(clientRepo.getAzureClient().getClient(), azure); assertFalse(clientRepo.isAuthzClient(azure)); assertTrue(clientRepo.isAuthzClient(graph)); assertFalse(clientRepo.isAuthzClient("azure")); assertTrue(clientRepo.isAuthzClient("graph")); List<ClientRegistration> clients = collectClients(clientRepo); assertEquals(2, clients.size()); assertEquals("graph", clients.get(0).getRegistrationId()); assertEquals("azure", clients.get(1).getRegistrationId()); }

Target:
public void aadAwareClientRepository() { contextRunner .withPropertyValues( "azure.activedirectory.client-id = fake-client-id", "azure.activedirectory.client-secret = fake-client-secret", "azure.activedirectory.tenant-id = fake-tenant-id", "azure.activedirectory.user-group.allowed-groups = group1, group2", "azure.activedirectory.authorization.graph.scopes = Calendars.Read" ) .run(context -> { AzureClientRegistrationRepository clientRepo = context.getBean(AzureClientRegistrationRepository.class); ClientRegistration azure = clientRepo.findByRegistrationId("azure"); ClientRegistration graph = clientRepo.findByRegistrationId("graph"); assertDefaultScopes( clientRepo.getAzureClient(), "openid", "profile", "offline_access", "<LINK_0>" ); assertEquals(clientRepo.getAzureClient().getClient(), azure); assertFalse(clientRepo.isAuthzClient(azure)); assertTrue(clientRepo.isAuthzClient(graph)); assertFalse(clientRepo.isAuthzClient("azure")); assertTrue(clientRepo.isAuthzClient("graph")); List<ClientRegistration> clients = collectClients(clientRepo); assertEquals(2, clients.size()); assertEquals("graph", clients.get(0).getRegistrationId()); assertEquals("azure", clients.get(1).getRegistrationId()); }); }
Source:
public Iterable<Row> evaluate(TransactionContext txnCtx, Input<List<Object>>... args) { return () -> Identifiers.KEYWORDS.stream() .map(keyword -> (Row) new RowN( keyword.getWord().toLowerCase(Locale.ENGLISH), keyword.isReserved() ? "R" : "U", keyword.isReserved() ? "reserved" : "unreserved" )) .iterator(); }

Target:
public Iterable<Row> evaluate(TransactionContext txnCtx, Input<List<Object>>... args) { return () -> Identifiers.KEYWORDS.stream() .map(new Function<Identifiers.Keyword, Row>() { final Object[] columns = new Object[3]; final RowN row = new RowN(columns); @Override public Row apply(Identifiers.Keyword keyword) { columns[0] = keyword.getWord().toLowerCase(Locale.ENGLISH); if (keyword.isReserved()) { columns[1] = "R"; columns[2] = "reserved"; } else { columns[1] = "U"; columns[2] = "unreserved"; } return row; } }).iterator(); }
Source:
private RemoveSnapshotSingleDiskParameters buildRemoveSnapshotSingleDiskLiveParameters(Guid imageId, int completedChildren) { DiskImage dest = getDiskImageDao().getAllSnapshotsForParent(imageId).get(0); RemoveSnapshotSingleDiskParameters parameters = new RemoveSnapshotSingleDiskParameters(imageId, getVmId()); parameters.setDestinationImageId(dest.getImageId()); parameters.setEntityInfo(getParameters().getEntityInfo()); parameters.setParentParameters(getParameters()); parameters.setParentCommand(getActionType()); parameters.setCommandType(VdcActionType.RemoveSnapshotSingleDiskLive); parameters.setVdsId(getVm().getRunOnVds()); parameters.setSessionId(getParameters().getSessionId()); if (getParameters().getChildImageIds() == null) { getParameters().setChildImageIds(Arrays.asList(new Guid[getParameters().getImageIds().size()])); } getParameters().getChildImageIds().set(completedChildren, parameters.getDestinationImageId()); return parameters; }

Target:
private RemoveSnapshotSingleDiskParameters buildRemoveSnapshotSingleDiskLiveParameters(Guid imageId, int completedChildren) { DiskImage dest = getDiskImageDao().getAllSnapshotsForParent(imageId).get(0); RemoveSnapshotSingleDiskParameters parameters = new RemoveSnapshotSingleDiskParameters(imageId, getVmId()); parameters.setDestinationImageId(dest.getImageId()); parameters.setEntityInfo(getParameters().getEntityInfo()); parameters.setParentParameters(getParameters()); parameters.setParentCommand(getActionType()); parameters.setCommandType(VdcActionType.RemoveSnapshotSingleDiskLive); parameters.setVdsId(getVm().getRunOnVds()); parameters.setSessionId(getParameters().getSessionId()); parameters.setEndProcedure(EndProcedure.COMMAND_MANAGED); return parameters; }
Source:
protected Intent getDefaultIntent() { return context.getPackageManager().getLaunchIntentForPackage(context.getPackageName()); }

Target:
Intent getDefaultIntent() { return mContext.getPackageManager().getLaunchIntentForPackage(mContext.getPackageName()); }
Source:
public void testHostWithNul() throws Exception { URL url = new URL("http://host\u0000/"); try { url.openStream(); fail(); } catch (Exception expected) }

Target:
public void testHostWithNul() throws Exception { URL url = new URL("http://host\u0000/"); try { url.openStream(); fail(); } catch (IllegalArgumentException expected) }