auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void setUpTestData(SystemTestData testData) throws Exception { testData.setUpSecurity(); System.setProperty("DefaultCatalogStore", "org.geoserver.csw.store.simple.GeoServerSimpleCatalogStore"); System.setProperty("ALLOW_ENV_PARAMETRIZATION", "true"); File root = testData.getDataDirectoryRoot(); File catalog = new File(root, "catalog"); File records = new File("./src/test/resources/org/geoserver/csw/records"); FileUtils.copyDirectory(records, catalog); }

Target:
protected void setUpTestData(SystemTestData testData) throws Exception { testData.setUpSecurity(); System.setProperty("DefaultCatalogStore", "org.geoserver.csw.store.simple.GeoServerSimpleCatalogStore"); File root = testData.getDataDirectoryRoot(); File catalog = new File(root, "catalog"); File records = new File("./src/test/resources/org/geoserver/csw/records"); FileUtils.copyDirectory(records, catalog); }
Source:
public void setSubscriptions(List<String> subscriptions) { this.subscriptions.clear(); for(String currentSubscription: subscriptions) { if (this.getNotifierName().equals(AlertService.SupportedNotifier.GUS.getName())) { if (currentSubscription.length() < 10) throw new IllegalArgumentException("GUS subjectId is incorrect."); } else if (this.getNotifierName().equals(AlertService.SupportedNotifier.EMAIL.getName())) { if (!currentSubscription.matches("[a-zA-Z0-9\\-\\_\\.]+@[a-zA-Z0-9\\-\\_\\.]+\\.[a-zA-Z0-9]{3}")) throw new IllegalArgumentException("Email Address is incorrect."); } } if (subscriptions != null && !subscriptions.isEmpty()) { this.subscriptions.addAll(subscriptions); } }

Target:
public void setSubscriptions(List<String> subscriptions) { this.subscriptions.clear(); if(subscriptions == null) return; for(String currentSubscription: subscriptions) { if (this.getNotifierName().equals(AlertService.SupportedNotifier.GUS.getName())) { if (currentSubscription.length() < 10) throw new IllegalArgumentException("GUS subjectId is incorrect."); } else if (this.getNotifierName().equals(AlertService.SupportedNotifier.EMAIL.getName())) { if (!currentSubscription.matches("[a-zA-Z0-9\\-\\_\\.]+@[a-zA-Z0-9\\-\\_\\.]+\\.[a-zA-Z0-9]{3}")) throw new IllegalArgumentException("Email Address is incorrect."); } } if (subscriptions != null && !subscriptions.isEmpty()) { this.subscriptions.addAll(subscriptions); } }
Source:
private String etag(SourceFile srcmd, SourceFile navmd) { byte[] b = new byte[Constants.OBJECT_ID_LENGTH]; Hasher h = Hashing.sha1().newHasher(); h.putInt(ETAG_GEN); h.putBytes(renderer.getTemplateHash(SOY_FILE).asBytes()); if (navmd != null) { navmd.id.copyRawTo(b, 0); h.putBytes(b); } srcmd.id.copyRawTo(b, 0); h.putBytes(b); return h.hash().toString(); }

Target:
private String etag(SourceFile srcmd, SourceFile navmd) { byte[] b = new byte[Constants.OBJECT_ID_LENGTH]; Hasher h = Hashing.sha1().newHasher(); h.putInt(ETAG_GEN); renderer.getTemplateHash(SOY_FILE).writeBytesTo(b, 0, b.length); h.putBytes(b); if (navmd != null) { navmd.id.copyRawTo(b, 0); h.putBytes(b); } srcmd.id.copyRawTo(b, 0); h.putBytes(b); return h.hash().toString(); }
Source:
public FrameIterator frameIterator() { return new FrameIterator(startFrame); }

Target:
public ForwardFrameIterator frameIterator() { return new ForwardFrameIterator(startFrame); }
Source:
public void changeStatusToClosed(long issueID, int resolution, String bugNote, Date closeDate) { IIssue issue = getIssue(issueID); int oldStatus = issue.getStatusValue(); IQueryValueSet valueSet = new MySQLQuerySet(); valueSet.addTableName("mantis_bug_table"); valueSet.addInsertValue("status", Integer.toString(ITSEnum.CLOSED_STATUS)); valueSet.addInsertValue("resolution", Integer.toString(resolution)); valueSet.addEqualCondition("id", Long.toString(issueID)); String query = valueSet.getUpdateQuery(); getControl().execute(query); HistoryObject history = new HistoryObject( issue.getIssueID(), issue.getIssueType(), HistoryObject.TYPE_STATUS, String.valueOf(oldStatus), String.valueOf(ITSEnum.CLOSED_STATUS), System.currentTimeMillis()); history.save(); if (bugNote != null && !bugNote.equals("")) { issue.addIssueNote(bugNote); updateBugNote(issue); } }

Target:
public void changeStatusToClosed(long issueID, int resolution, String bugNote, Date closeDate) { IIssue issue = getIssue(issueID); int oldStatus = issue.getStatusValue(); IQueryValueSet valueSet = new MySQLQuerySet(); valueSet.addTableName("mantis_bug_table"); valueSet.addInsertValue("status", Integer.toString(ITSEnum.CLOSED_STATUS)); valueSet.addInsertValue("resolution", Integer.toString(resolution)); valueSet.addEqualCondition("id", Long.toString(issueID)); String query = valueSet.getUpdateQuery(); getControl().execute(query); HistoryObject statusHistory = new HistoryObject( issue.getIssueID(), issue.getIssueType(), HistoryObject.TYPE_STATUS, String.valueOf(oldStatus), String.valueOf(ITSEnum.CLOSED_STATUS), System.currentTimeMillis()); statusHistory.save(); if (bugNote != null && !bugNote.equals("")) { issue.addIssueNote(bugNote); updateBugNote(issue); } }
Source:
public void logFrame(StompFrame request, boolean in) { if (ActiveMQStompProtocolLogger.LOGGER.isDebugEnabled()) { StringBuilder message = new StringBuilder() .append("STOMP(") .append(getRemoteAddress()) .append(", ") .append(this.getID()) .append("):"); if (in) { message.append(" IN << "); } else { message.append("OUT >> "); } message.append(request); ActiveMQStompProtocolLogger.LOGGER.debug(message.toString()); } }

Target:
public void logFrame(StompFrame request, boolean in) { if (logger.isDebugEnabled()) { StringBuilder message = new StringBuilder() .append("STOMP(") .append(getRemoteAddress()) .append(", ") .append(this.getID()) .append("):"); if (in) { message.append(" IN << "); } else { message.append("OUT >> "); } message.append(request); logger.debug(message.toString()); } }
Source:
public Iterable<NetworkClient.InFlightRequest> clearAll(String node) { Deque<NetworkClient.InFlightRequest> reqs = requests.get(node); if (reqs == null) { return Collections.emptyList(); } else { final Deque<NetworkClient.InFlightRequest> clearedRequests = requests.remove(node); inFlightRequestCount.addAndGet(-clearedRequests.size()); return () -> clearedRequests.descendingIterator(); } }

Target:
public Iterable<NetworkClient.InFlightRequest> clearAll(String node) { Deque<NetworkClient.InFlightRequest> reqs = requests.get(node); if (reqs == null) { return Collections.emptyList(); } else { final Deque<NetworkClient.InFlightRequest> clearedRequests = requests.remove(node); inFlightRequestCount.getAndAdd(-clearedRequests.size()); return () -> clearedRequests.descendingIterator(); } }
Source:
public void testWhereWithOrForLargeValueList() throws Exception { Cache cache = POLICY.cache(); QueryService queryService = cache.getQueryService(); Query query = queryService.newQuery("select state as state from /zips"); SelectResults results = (SelectResults) query.execute(); Set<String> stateList = new LinkedHashSet<>(); Iterator iterator = results.iterator(); while (iterator.hasNext()) { StructImpl struct = (StructImpl) iterator.next(); stateList.add((String) struct.get("state")); } List<String> statePredicateList = new ArrayList<>(); stateList.forEach(state -> statePredicateList.add("state = '" + state + "'")); String stateListPredicate = String.join(" OR ", statePredicateList); String stateListStr = "'" + String.join("', '", stateList) + "'"; String queryToBeExecuted = "SELECT state as state FROM view WHERE " + stateListPredicate; String expectedQuery = "SELECT state AS state FROM /zips WHERE state " + "IN SET(" + stateListStr + ")"; calciteAssert() .query(queryToBeExecuted) .returnsCount(149) .queryContains( GeodeAssertions.query(expectedQuery)); }

Target:
public void testWhereWithOrForLargeValueList() throws Exception { Cache cache = POLICY.cache(); QueryService queryService = cache.getQueryService(); Query query = queryService.newQuery("select state as state from /zips"); SelectResults results = (SelectResults) query.execute(); Set<String> stateList = (Set<String>) results.stream().map(s -> { StructImpl struct = (StructImpl) s; return struct.get("state"); }) .collect(Collectors.toCollection(LinkedHashSet::new)); String stateListPredicate = stateList.stream() .map(s -> String.format(Locale.ROOT, "state = '%s'", s)) .collect(Collectors.joining(" OR ")); String stateListStr = "'" + String.join("', '", stateList) + "'"; String queryToBeExecuted = "SELECT state as state FROM view WHERE " + stateListPredicate; String expectedQuery = "SELECT state AS state FROM /zips WHERE state " + "IN SET(" + stateListStr + ")"; calciteAssert() .query(queryToBeExecuted) .returnsCount(149) .queryContains( GeodeAssertions.query(expectedQuery)); }
Source:
public ElideDynamicEntityCompiler buildElideDynamicEntityCompiler(ElideConfigProperties settings) { ElideDynamicEntityCompiler compiler = null; if (settings.getDynamicConfig().isEnabled()) { compiler = new ElideDynamicEntityCompiler(settings.getDynamicConfig().getPath()); try { compiler.compile(settings.getDynamicConfig().getPath()); } catch (Exception e) { e.printStackTrace(); } } return compiler; }

Target:
public ElideDynamicEntityCompiler buildElideDynamicEntityCompiler(ElideConfigProperties settings) throws Exception { ElideDynamicEntityCompiler compiler = null; if (settings.getDynamicConfig().isEnabled()) { compiler = new ElideDynamicEntityCompiler(settings.getDynamicConfig().getPath()); } return compiler; }
Source:
public boolean shouldUseNativeIO(VM vm, DiskImage diskImage, VmDevice device) { StorageType storageType = diskImage.getStorageTypes().get(0); String diskType = getDiskType(vm, diskImage, device); boolean isNativeIO = !"file".equals(diskType) || (storageType == StorageType.GLUSTERFS && FeatureSupported.useNativeIOForGluster(vm.getCompatibilityVersion())); if ("file".equals(diskType) && device.getSnapshotId() != null) { isNativeIO = false; } return isNativeIO; }

Target:
public boolean shouldUseNativeIO(VM vm, DiskImage diskImage, VmDevice device) { StorageType storageType = diskImage.getStorageTypes().get(0); String diskType = getDiskType(vm, diskImage, device); boolean isNativeIO = !"file".equals(diskType) || (storageType == StorageType.GLUSTERFS && FeatureSupported.useNativeIOForGluster(vm.getCompatibilityVersion())); if (device.getSnapshotId() != null) { isNativeIO = false; } return isNativeIO; }
Source:
public List<Credential> fromRequest(final HttpServletRequest request, final MultiValueMap<String, String> requestBody) { if (requestBody == null || requestBody.isEmpty()) { LOGGER.debug("Skipping because the requestBody is null or empty", this); return new ArrayList<>(0); } final String username = requestBody.getFirst(USERNAME); final String password = requestBody.getFirst(PASSWORD); if (username == null || password == null) { LOGGER.debug("Invalid payload. 'username' and 'password' form fields are required."); return new ArrayList<>(0); } final Credential c = new UsernamePasswordCredential(username, password); return CollectionUtils.wrap(c); }

Target:
public List<Credential> fromRequest(final HttpServletRequest request, final MultiValueMap<String, String> requestBody) { if (requestBody == null || requestBody.isEmpty()) { LOGGER.debug("Skipping because the requestBody is null or empty", getClass().getSimpleName()); return new ArrayList<>(0); } final String username = requestBody.getFirst(USERNAME); final String password = requestBody.getFirst(PASSWORD); if (username == null || password == null) { LOGGER.debug("Invalid payload. 'username' and 'password' form fields are required."); return new ArrayList<>(0); } final Credential c = new UsernamePasswordCredential(username, password); return CollectionUtils.wrap(c); }
Source:
public @Nullable String getSelectedItemName() { String value = null; RegistrationOption selected = (RegistrationOption)getSelectedItem(); if (selected != null) { value = selected.getName(); } return value; }

Target:
public String getSelectedItemName() { String value = null; final RegistrationOption selected = (RegistrationOption) getSelectedItem(); if (selected != null) { value = selected.getName(); } return value; }
Source:
public static void error (int code, Throwable throwable) { error (code, throwable, " [Application is out of heap memory]"); }

Target:
public static void error (int code, Throwable throwable) { error (code, throwable, null); }
Source:
public boolean receive(CarbonMessage carbonMessage, CarbonCallback carbonCallback) { if (microservicesRegistry == null) { microservicesRegistry = DataHolder.getInstance().getMicroservicesRegistries().get(carbonMessage.getProperty("ID")); } Request request = new Request(carbonMessage); request.setSessionManager(microservicesRegistry.getSessionManager()); Response response = new Response(carbonCallback, request); try { dispatchMethod(request, response); } catch (HandlerException e) { handleHandlerException(e, carbonCallback); } catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof HandlerException) { handleHandlerException((HandlerException) targetException, carbonCallback); } else { handleThrowable(targetException, carbonCallback, request); } } catch (InterceptorException e) { log.warn("Interceptors threw an exception", e); carbonCallback.done(HttpUtil .createTextResponse(javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), HttpUtil.EMPTY_BODY)); } catch (Throwable t) { handleThrowable(t, carbonCallback, request); } finally { carbonMessage.release(); } return true; }

Target:
public boolean receive(CarbonMessage carbonMessage, CarbonCallback carbonCallback) { currentMicroservicesRegistry = DataHolder.getInstance().getMicroservicesRegistries() .get(carbonMessage.getProperty(MSF4JConstants.CHANNEL_ID)); Request request = new Request(carbonMessage); request.setSessionManager(currentMicroservicesRegistry.getSessionManager()); Response response = new Response(carbonCallback, request); try { dispatchMethod(request, response); } catch (HandlerException e) { handleHandlerException(e, carbonCallback); } catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof HandlerException) { handleHandlerException((HandlerException) targetException, carbonCallback); } else { handleThrowable(targetException, carbonCallback, request); } } catch (InterceptorException e) { log.warn("Interceptors threw an exception", e); carbonCallback.done(HttpUtil .createTextResponse(javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), HttpUtil.EMPTY_BODY)); } catch (Throwable t) { handleThrowable(t, carbonCallback, request); } finally { carbonMessage.release(); } return true; }
Source:
public Scheduler cleanupJobScheduler() throws SchedulerException { return this.constructScheduler(AbstractSchedulingConfigBuilder.newBuilder() .withJobClass(ResponseDataCleanupJob.class).withThreadCountKey(KEY_CLEANUP_JOB_THREAD_COUNT) .withCronExpressionKey(KEY_CLEANUP_JOB_CRON_EXPRESSION).withJobStoreDbUrl(this.getDatabaseUrl()) .withJobStoreDbUsername(this.databaseUsername).withJobStoreDbPassword(this.databasePassword) .withJobStoreDbDriver(this.databaseDriver).build()); }

Target:
public Scheduler cleanupJobScheduler() throws SchedulerException { AbstractSchedulingConfigBuilder abstractSchedulingConfig = AbstractSchedulingConfigBuilder.newBuilder() .withJobClass(ResponseDataCleanupJob.class).withThreadCountKey(KEY_CLEANUP_JOB_THREAD_COUNT) .withCronExpressionKey(KEY_CLEANUP_JOB_CRON_EXPRESSION).withJobStoreDbUrl(this.getDatabaseUrl()) .withJobStoreDbUsername(this.databaseUsername).withJobStoreDbPassword(this.databasePassword) .withJobStoreDbDriver(this.databaseDriver).build(); return this.constructScheduler(abstractSchedulingConfig); }
Source:
private void doInit(InstallerDao installerDao, Installer i) throws InstallerException { String installerKey = InstallerFqn.of(i).toKey(); try { Version.validate(i.getVersion()); } catch (IllegalArgumentException e) { throw new InstallerException(format("Illegal version format '%s' for installer '%s'", i.getVersion(), installerKey)); } try { installerDao.create(new InstallerImpl(i)); LOG.info(format("Installer '%s' added to the registry.", installerKey)); } catch (InstallerAlreadyExistsException e) { LOG.info(format("Installer '%s' already exists in the registry.", installerKey)); } }

Target:
private void doInit(InstallerDao installerDao, Installer i) throws InstallerException { String installerKey = InstallerFqn.of(i).toKey(); installerValidator.validate(i); try { installerDao.create(new InstallerImpl(i)); LOG.info(format("Installer '%s' added to the registry.", installerKey)); } catch (InstallerAlreadyExistsException e) { LOG.info(format("Installer '%s' already exists in the registry.", installerKey)); } }
Source:
public void stop() { refreshThread.stop = true; try { refreshThread.join(); } catch (InterruptedException e) { log.warn("error stopping refresh thread", e); } openIndex.close(); closedIndex.close(); }

Target:
public void stop() { refreshThread.halt(); openIndex.close(); closedIndex.close(); }
Source:
private BucketDataNode createBucketDataNode(long groupId, Block block, int position) { long valueOnlyRawHash = TypeUtils.hashPosition(type, block, position); long valueRawHash = getHashPosition(groupId, valueOnlyRawHash); int bucketId = (int) (valueRawHash & mask); int nodePointer; int probeCount = 1; int originalBucketId = bucketId; boolean isEmpty; while (true) { nodePointer = buckets.get(bucketId); if (nodePointer == EMPTY_BUCKET) { isEmpty = true; break; } int valuePosition = valuePositions.get(nodePointer); if (groupAndValueMatches(groupId, block, position, nodePointer, valuePosition)) { isEmpty = false; break; } int probe = nextProbe(probeCount); bucketId = nextBucketId(originalBucketId, mask, probe); probeCount++; } int nodePointerToUse = isEmpty ? nextNodePointer : nodePointer; return new BucketDataNode(bucketId, createValueNode(nodePointerToUse), valueRawHash, valueOnlyRawHash, nodePointerToUse, isEmpty); }

Target:
private BucketDataNode createBucketDataNode(long groupId, Block block, int position) { long valueHash = murmurHash3(TypeUtils.hashPosition(type, block, position)); long groupIdHash = murmurHash3(groupId); long valueAndGroupHash = combineGroupAndValueHash(groupIdHash, valueHash); int bucketId = (int) (valueAndGroupHash & mask); int nodePointer; int probeCount = 1; int originalBucketId = bucketId; while (true) { nodePointer = buckets.get(bucketId); if (nodePointer == EMPTY_BUCKET) { return new BucketDataNode(bucketId, new ValueNode(nextNodePointer), valueHash, valueAndGroupHash, nextNodePointer, true); } else if (groupAndValueMatches(groupId, block, position, nodePointer, valuePositions.get(nodePointer))) { return new BucketDataNode(bucketId, new ValueNode(nodePointer), valueHash, valueAndGroupHash, nodePointer, false); } else { int probe = nextProbe(probeCount); bucketId = nextBucketId(originalBucketId, mask, probe); probeCount++; } } }
Source:
public static long encryptedToRaw(final byte[] key, final byte[] encryptedMotionData) throws NoSuchPaddingException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IllegalBlockSizeException, BadPaddingException, InvalidKeyException, IOException { final byte[] nonce = Arrays.copyOfRange(encryptedMotionData, 0, 8); final byte[] encryptedRawMotion = Arrays.copyOfRange(encryptedMotionData, 8, encryptedMotionData.length); final byte[] decryptedRawMotion = counterModeDecrypt(key, nonce, encryptedRawMotion); final LittleEndianDataInputStream littleEndianDataInputStream = new LittleEndianDataInputStream(new ByteArrayInputStream(decryptedRawMotion)); long motionAmplitude = littleEndianDataInputStream.readInt(); if(motionAmplitude < 0){ motionAmplitude += 0xFFFFFFFF; } littleEndianDataInputStream.close(); return motionAmplitude; }

Target:
public static long encryptedToRaw(final byte[] key, final byte[] encryptedMotionData) throws IllegalArgumentException { final byte[] nonce = Arrays.copyOfRange(encryptedMotionData, 0, 8); final byte[] encryptedRawMotion = Arrays.copyOfRange(encryptedMotionData, 8, encryptedMotionData.length); final byte[] decryptedRawMotion = counterModeDecrypt(key, nonce, encryptedRawMotion); final LittleEndianDataInputStream littleEndianDataInputStream = new LittleEndianDataInputStream(new ByteArrayInputStream(decryptedRawMotion)); Exception exception = null; long motionAmplitude = -1; try { motionAmplitude = UnsignedInts.toLong(littleEndianDataInputStream.readInt()); }catch (IOException ioe){ exception = ioe; }finally { try { littleEndianDataInputStream.close(); }catch (IOException ioe){ exception = ioe; } } if(exception != null){ throw new IllegalArgumentException(exception); } return motionAmplitude; }
Source:
private boolean elementsContains(Object someObject) { if (elements == null) { return false; } if (elementsAndAdapters == null) { elementsAndAdapters = new ArrayList(elements.length); for (Object element : elements) { elementsAndAdapters.add(element); if (affectedObjectsClass != null && !affectedObjectsClass.isInstance(element)) { Object adapter = Adapters.adapt(element, affectedObjectsClass); if (adapter != null) { elementsAndAdapters.add(adapter); } } } } for (Object elementsAndAdapter : elementsAndAdapters) { if (elementsAndAdapter.equals(someObject)) { return true; } } return false; }

Target:
private boolean elementsContains(Object someObject) { if (elements == null) { return false; } if (elementsAndAdapters == null) { elementsAndAdapters = new ArrayList(elements.length); for (Object element : elements) { elementsAndAdapters.add(element); if (affectedObjectsClass != null && !affectedObjectsClass.isInstance(element)) { Object adapter = Adapters.adapt(element, affectedObjectsClass); if (adapter != null) { elementsAndAdapters.add(adapter); } } } } for (Object elementOrAdapter : elementsAndAdapters) { if (elementOrAdapter.equals(someObject)) { return true; } } return false; }
Source:
private void disconnectStorageByType(StorageType storageType, List<StorageServerConnections> connections) { List<String> heIds = storageDomainDao.getHostedEngineStorageDomainIds().stream() .map(storageDomainDao::get) .map(StorageDomain::getStorageStaticData) .map(StorageDomainStatic::getStorage) .collect(Collectors.toList()); connections = connections.stream() .filter(c -> heIds.stream().noneMatch(heId -> c.getId().equals(heId))) .collect(Collectors.toList()); storageHelperDirector.getItem(storageType).prepareDisconnectHostFromStoragePoolServers(getParameters(), connections); VDSReturnValue vdsReturnValue = runVdsCommand( VDSCommandType.DisconnectStorageServer, new StorageServerConnectionManagementVDSParameters(getVds().getId(), getStoragePool().getId(), storageType, connections)); setSucceeded(vdsReturnValue.getSucceeded()); if (!vdsReturnValue.getSucceeded()) { storageHelperDirector.getItem(storageType) .isConnectSucceeded((HashMap<String, String>) vdsReturnValue.getReturnValue(), connections); } }

Target:
private void disconnectStorageByType(StorageType storageType, List<StorageServerConnections> connections) { Set<String> heIds = storageDomainDao.getHostedEngineStorageDomainIds().stream() .map(storageDomainDao::get) .map(StorageDomain::getStorageStaticData) .map(StorageDomainStatic::getStorage) .collect(Collectors.toSet()); connections = connections.stream() .filter(c -> !heIds.contains(c.getId())) .collect(Collectors.toList()); storageHelperDirector.getItem(storageType).prepareDisconnectHostFromStoragePoolServers(getParameters(), connections); VDSReturnValue vdsReturnValue = runVdsCommand( VDSCommandType.DisconnectStorageServer, new StorageServerConnectionManagementVDSParameters(getVds().getId(), getStoragePool().getId(), storageType, connections)); setSucceeded(vdsReturnValue.getSucceeded()); if (!vdsReturnValue.getSucceeded()) { storageHelperDirector.getItem(storageType) .isConnectSucceeded((HashMap<String, String>) vdsReturnValue.getReturnValue(), connections); } }
Source:
public void consistentFullBatchesGravitatesTowardsMinimumPause() { for (int i = 0; i < 20; i++) { delay.getNextPause(SUCCESS_TOO_SLOW); } assertThat(delay.getNextPause(SUCCESS_TOO_FAST)).isGreaterThanOrEqualTo((long) (MIN_PAUSE_MILLIS * 1.05)); }

Target:
public void consistentFullBatchesGravitatesTowardsMinimumPause() { sweepTwentyIterationsWithResult(SUCCESS_TOO_SLOW); assertThat(delay.getNextPause(SUCCESS_TOO_SLOW)).isGreaterThanOrEqualTo((long) (MIN_PAUSE_MILLIS * 1.05)); }
Source:
public void deleteSecretCodeSnippets() throws InterruptedException { SecretClient secretClient = getSecretClient(); Poller<DeletedSecret, Void> poller = secretClient.beginDeleteSecret("secretName"); poller.getObserver() .map(pollResponse -> { System.out.println("Current status: " + pollResponse.getStatus()); if (pollResponse.getStatus() != PollResponse.OperationStatus.NOT_STARTED) { DeletedSecret deletedSecret = pollResponse.getValue(); System.out.println("Deleted date: " + deletedSecret.getDeletedOn().toString()); System.out.printf("Deleted Secret's Recovery id: %s%n", deletedSecret.getRecoveryId()); } return pollResponse.getStatus(); }) .blockLast(); System.out.println("Final status: " + poller.getStatus()); System.out.println("Final response: " + poller.getLastPollResponse()); END: com.azure.security.keyvault.secretclient.deleteSecret#string }

Target:
public void deleteSecretCodeSnippets() throws InterruptedException { SecretClient secretClient = getSecretClient(); Poller<DeletedSecret, Void> deletedSecretPoller = secretClient.beginDeleteSecret("secretName"); while (deletedSecretPoller.getStatus() != PollResponse.OperationStatus.IN_PROGRESS && !deletedSecretPoller.isComplete()) { System.out.println(deletedSecretPoller.getStatus().toString()); Thread.sleep(2000); } DeletedSecret deletedSecret = deletedSecretPoller.getLastPollResponse().getValue(); System.out.println("Deleted Date: " + deletedSecret.getDeletedOn().toString()); System.out.printf("Deleted Secret's Recovery Id %s", deletedSecret.getRecoveryId()); while (!deletedSecretPoller.isComplete()) { System.out.println(deletedSecretPoller.getStatus().toString()); Thread.sleep(2000); } END: com.azure.security.keyvault.secretclient.deleteSecret#string }
Source:
Builder() { this.startTime = 0; this.druidCluster = null; this.databaseRuleManager = null; this.segmentReplicantLookup = null; this.dataSources = Sets.newHashSet(); this.availableSegments = Sets.newTreeSet(Comparators.inverse(DataSegment.bucketMonthComparator())); this.loadManagementPeons = Maps.newHashMap(); this.replicationManager = null; this.emitter = null; this.stats = new MasterStats(); this.dynamicConfigs = new DynamicConfigs(null,null,null,null); this.balancerReferenceTimestamp = null; }

Target:
Builder() { this.startTime = 0; this.druidCluster = null; this.databaseRuleManager = null; this.segmentReplicantLookup = null; this.dataSources = Sets.newHashSet(); this.availableSegments = Sets.newTreeSet(Comparators.inverse(DataSegment.bucketMonthComparator())); this.loadManagementPeons = Maps.newHashMap(); this.replicationManager = null; this.emitter = null; this.stats = new MasterStats(); this.masterSegmentSettings = new MasterSegmentSettings.Builder().build(); this.balancerReferenceTimestamp = null; }
Source:
public String[] getCountries() { return new String[]{"DZ"}; }

Target:
public String[] getCountries() { return new String[]{"", "AE", "BH", "EG", "IN", "IQ", "JQ", "JO", "KW", "LB", "LY", "MA", "OM", "QA", "SA", "SD", "SY", "TN", "YE"}; }
Source:
public void testDataSyncToPassiveCustomGets() throws Exception { System.setProperty(ClusterTierActiveEntity.SYNC_DATA_GETS_PROP, "2"); try { prepareAndRunActiveEntityForPassiveSync((activeEntity, concurrencyKey) -> { @SuppressWarnings("unchecked") PassiveSynchronizationChannel<EhcacheEntityMessage> syncChannel = mock(PassiveSynchronizationChannel.class); activeEntity.synchronizeKeyToPassive(syncChannel, concurrencyKey); verify(syncChannel, atLeast(1)).synchronizeToPassive(any(EhcacheDataSyncMessage.class)); }); } finally { System.clearProperty(ClusterTierActiveEntity.SYNC_DATA_GETS_PROP); } }

Target:
public void testDataSyncToPassiveCustomGets() throws Exception { System.setProperty(ClusterTierActiveEntity.SYNC_DATA_GETS_PROP, "2"); try { prepareAndRunActiveEntityForPassiveSync((activeEntity, concurrencyKey) -> { @SuppressWarnings("unchecked") PassiveSynchronizationChannel<EhcacheEntityMessage> syncChannel = mock(PassiveSynchronizationChannel.class); activeEntity.synchronizeKeyToPassive(syncChannel, concurrencyKey); verify(syncChannel, atLeast(2)).synchronizeToPassive(any(EhcacheDataSyncMessage.class)); }); } finally { System.clearProperty(ClusterTierActiveEntity.SYNC_DATA_GETS_PROP); } }
Source:
private void volumeType_SelectedItemChanged() { if (getVolumeType().getSelectedItem() == null || getDataCenter().getSelectedItem() == null) { return; } VolumeType volumeType = (VolumeType) getVolumeType().getSelectedItem(); StorageType storageType = ((StorageDomain) getStorageDomain().getSelectedItem()).getStorageType(); updateVolumeFormat(volumeType, storageType); updateShareable(volumeType, storageType); }

Target:
private void volumeType_SelectedItemChanged() { if (getVolumeType().getSelectedItem() == null || getDataCenter().getSelectedItem() == null || getStorageDomain().getSelectedItem() == null) { return; } VolumeType volumeType = (VolumeType) getVolumeType().getSelectedItem(); StorageType storageType = ((StorageDomain) getStorageDomain().getSelectedItem()).getStorageType(); updateVolumeFormat(volumeType, storageType); updateShareable(volumeType, storageType); }
Source:
private TestSplit(int id, OptionalInt bucketNumber) { super( "path", 0, 100, 100, ImmutableList.of(new InternalHiveBlock(0, 100, ImmutableList.of())), bucketNumber, bucketNumber, true, false, false, new HiveSplitPartitionInfo(properties("id", String.valueOf(id)), ImmutableList.of(), "partition-name", ImmutableMap.of(), Optional.empty())); }

Target:
private TestSplit(int id, OptionalInt bucketNumber) { super( "path", 0, 100, 100, ImmutableList.of(new InternalHiveBlock(100, ImmutableList.of())), bucketNumber, bucketNumber, true, false, false, new HiveSplitPartitionInfo(properties("id", String.valueOf(id)), new Path("path").toUri(), ImmutableList.of(), "partition-name", ImmutableMap.of(), Optional.empty())); }
Source:
public OutputStream createOutput(final String blobName) throws IOException { deleteBlob(blobName); final PipedInputStream in = new PipedInputStream(); final Thread transport = new Thread(new Runnable(){ public void run(){ blobStore.swift().getObject(buildKey(blobName)).uploadObject(in); } }); transport.start(); return new PipedOutputStream(in) { @Override public void close() throws IOException { try { super.close(); transport.join(); } catch(InterruptedException e) { throw new IOException("Swift input/output shenanigans."); } } }; }

Target:
public OutputStream createOutput(final String blobName) throws IOException { deleteBlob(blobName); final PipedInputStream in = new PipedInputStream(); final Thread transport = new Thread(new Runnable(){ public void run(){ blobStore.swift().getObject(buildKey(blobName)).uploadObject(in); } }); transport.start(); return new PipedOutputStream(in) { @Override public void close() throws IOException { try { super.close(); transport.join(); } catch(InterruptedException e) { throw new IOException("Swift input/output shenanigans.", e); } } }; }
Source:
private Map<String, List<AppiumDevice>> getDevices() throws Exception { String platform = System.getenv(PLATFORM); Map<String, List<AppiumDevice>> devicesByHost = new HashMap<>(); if (capabilityManager.getCapabilities().has("hostMachines")) { JSONArray hostMachines = capabilityManager.getHostMachineObject(); for (Object hostMachine : hostMachines) { JSONObject hostMachineJson = (JSONObject) hostMachine; String machineIP = hostMachineJson.getString("machineIP"); IAppiumManager appiumManager = AppiumManagerFactory.getAppiumManager(machineIP); List<Device> devices = appiumManager.getDevices(machineIP, platform); if ((!platform.equalsIgnoreCase("android") && capabilityManager.isApp() && capabilityManager.isSimulatorAppPresentInCapsJson() && hostMachineJson.has("simulators")) || (capabilityManager.getCapabilityObjectFromKey("iOS").has("browserName") && hostMachineJson.has("simulators"))) { JSONArray simulators = hostMachineJson.getJSONArray("simulators"); List<Device> simulatorsToBoot = getSimulatorsToBoot( machineIP, simulators); devices.addAll(simulatorsToBoot); } List<AppiumDevice> appiumDevices = getAppiumDevices(machineIP, devices); devicesByHost.put(machineIP, appiumDevices); } } else { throw new RuntimeException("Provide hostMachine in Caps.json for execution"); } return devicesByHost; }

Target:
private Map<String, List<AppiumDevice>> getDevices() throws Exception { String platform = System.getenv(PLATFORM); Map<String, List<AppiumDevice>> devicesByHost = new HashMap<>(); if (capabilityManager.getCapabilities().has("hostMachines")) { JSONArray hostMachines = capabilityManager.getHostMachineObject(); for (Object hostMachine : hostMachines) { JSONObject hostMachineJson = (JSONObject) hostMachine; String machineIP = hostMachineJson.getString("machineIP"); IAppiumManager appiumManager = AppiumManagerFactory.getAppiumManager(machineIP); List<Device> devices = appiumManager.getDevices(machineIP, platform); if ((!platform.equalsIgnoreCase("android") && capabilityManager.isApp() && capabilityManager.isSimulatorAppPresentInCapsJson() && hostMachineJson.has("simulators")) && !capabilityManager.getCapabilityObjectFromKey("iOS").has("browserName")) { JSONArray simulators = hostMachineJson.getJSONArray("simulators"); List<Device> simulatorsToBoot = getSimulatorsToBoot( machineIP, simulators); devices.addAll(simulatorsToBoot); } List<AppiumDevice> appiumDevices = getAppiumDevices(machineIP, devices); devicesByHost.put(machineIP, appiumDevices); } } else { throw new RuntimeException("Provide hostMachine in Caps.json for execution"); } return devicesByHost; }
Source:
protected List<String> getToolbarTooltips() { String[] tooltipsArray = { "Align Views", "Optimize", "", "Show View Filters", "Show Legend", "", "Reset the Time Scale to Default", "Select Previous State Change", "Select Next State Change", "", "Add Bookmark...", "Previous Marker", "Next Marker", "", "Select Previous Process", "Select Next Process", "Zoom In", "Zoom Out", "", "Hide Arrows", "Follow CPU Backward", "Follow CPU Forward", "Go to previous event of the selected thread", "Go to next event of the selected thread" }; return Arrays.asList(tooltipsArray); }

Target:
protected List<String> getToolbarTooltips() { String[] tooltipsArray = { "Align Views", "Optimize", SEPARATOR, "Show View Filters", "Show Legend", SEPARATOR, "Reset the Time Scale to Default", "Select Previous State Change", "Select Next State Change", SEPARATOR, "Add Bookmark...", "Previous Marker", "Next Marker", SEPARATOR, "Select Previous Process", "Select Next Process", "Zoom In", "Zoom Out", SEPARATOR, "Hide Arrows", "Follow CPU Backward", "Follow CPU Forward", "Go to previous event of the selected thread", "Go to next event of the selected thread" }; return Arrays.asList(tooltipsArray); }
Source:
public ToStringHelper string() { return super.string() .add("app", app) .add("script", script) .add("location", locations) .add("port", port) .add("bindAddress", bindAddress) .add("noConsole", noConsole) .add("noConsoleSecurity", noConsoleSecurity) .add("startupFailOnPersistenceErrors", startupFailOnPersistenceErrors) .add("startupFailsOnCatalogErrors", startupFailOnCatalogErrors) .add("startupContinueOnWebErrors", startupContinueOnWebErrors) .add("startupFailOnManagedAppsErrors", startupFailOnManagedAppsErrors) .add("stopWhichAppsOnShutdown", stopWhichAppsOnShutdown) .add("noShutdownOnExit", noShutdownOnExit) .add("stopOnKeyPress", stopOnKeyPress) .add("localBrooklynProperties", localBrooklynProperties) .add("persist", persist) .add("persistenceLocation", persistenceLocation) .add("persistenceDir", persistenceDir) .add("highAvailability", highAvailability); }

Target:
public ToStringHelper string() { return super.string() .add("app", app) .add("script", script) .add("location", locations) .add("port", port) .add("bindAddress", bindAddress) .add("noConsole", noConsole) .add("noConsoleSecurity", noConsoleSecurity) .add("startupFailOnPersistenceErrors", startupFailOnPersistenceErrors) .add("startupFailsOnCatalogErrors", startupFailOnCatalogErrors) .add("startupContinueOnWebErrors", startupContinueOnWebErrors) .add("startupFailOnManagedAppsErrors", startupFailOnManagedAppsErrors) .add("catalogInitial", catalogInitial) .add("catalogAdd", catalogAdd) .add("catalogReset", catalogReset) .add("catalogForce", catalogForce) .add("stopWhichAppsOnShutdown", stopWhichAppsOnShutdown) .add("noShutdownOnExit", noShutdownOnExit) .add("stopOnKeyPress", stopOnKeyPress) .add("localBrooklynProperties", localBrooklynProperties) .add("persist", persist) .add("persistenceLocation", persistenceLocation) .add("persistenceDir", persistenceDir) .add("highAvailability", highAvailability); }
Source:
private Color getColor(RGB rgb) { if (rgb == null) { return null; } return resourceManger.createColor(rgb); }

Target:
private Color getColor(RGB rgb) { if (rgb == null) { return null; } return fColors.getUnchecked(rgb); }
Source:
public void testConnectOverProxy_explicit_http_uses_direct_connection() throws Exception { CountingProxy countingProxy = CountingProxy.start(); try { Proxy proxy = countingProxy.asProxy(); FtpURLConnection connection = (FtpURLConnection) fileUrl.openConnection(proxy); assertContents(connection.getInputStream()); } finally { int numConnections = countingProxy.shutdownAndGetConnectionCount(); assertEquals(0, numConnections); } }

Target:
public void testConnectOverProxy_explicit_http_uses_direct_connection() throws Exception { URL fileUrl = addFileEntry(FILE_PATH, fileContents); CountingProxy countingProxy = CountingProxy.start(); final int numConnections; try { Proxy proxy = countingProxy.asProxy(); URLConnection connection = fileUrl.openConnection(proxy); assertContents(fileContents, connection.getInputStream()); } finally { numConnections = countingProxy.shutdownAndGetConnectionCount(); } assertEquals(0, numConnections); }
Source:
public void existsByExampleShouldReturnNonExistingWithoutThrowException() { Example<ReactivePerson> example = Example.of(new ReactivePerson("foo", "bar", -1)); StepVerifier.create(repository.findOne(example)).expectNextCount(0).verifyComplete(); }

Target:
public void existsByExampleShouldReturnNonExistingWithoutThrowException() { Example<ReactivePerson> example = Example.of(new ReactivePerson("foo", "bar", -1)); StepVerifier.create(repository.findOne(example)).verifyComplete(); }
Source:
void serializeMessageInfoList(ByteBuffer outputBuffer) { outputBuffer.putInt(messageInfoList == null ? 0 : messageInfoList.size()); if (messageInfoList != null) { for (MessageInfo messageInfo : messageInfoList) { outputBuffer.put(messageInfo.getStoreKey().toBytes()); outputBuffer.putLong(messageInfo.getSize()); outputBuffer.putLong(messageInfo.getExpirationTimeInMs()); outputBuffer.put(messageInfo.isDeleted() ? (byte) 1 : 0); if (version == MessageInfoListVersion_V2) { Long crc = messageInfo.getCrc(); if (crc != null) { outputBuffer.put((byte) 1); outputBuffer.putLong(crc); } else { outputBuffer.put((byte) 0); } } } } }

Target:
void serializeMessageInfoList(ByteBuffer outputBuffer) { outputBuffer.putInt(messageInfoList == null ? 0 : messageInfoList.size()); if (messageInfoList != null) { for (MessageInfo messageInfo : messageInfoList) { outputBuffer.put(messageInfo.getStoreKey().toBytes()); outputBuffer.putLong(messageInfo.getSize()); outputBuffer.putLong(messageInfo.getExpirationTimeInMs()); outputBuffer.put(messageInfo.isDeleted() ? DELETED : (byte) ~DELETED); if (version == MessageInfoListVersion_V2) { Long crc = messageInfo.getCrc(); if (crc != null) { outputBuffer.put(CRC_PRESENT); outputBuffer.putLong(crc); } else { outputBuffer.put((byte) ~CRC_PRESENT); } } } } }
Source:
public static ModelStats computeStats(String theResult) { ModelStats modelStats = new ModelStats(); Stats wordStats = tokenLevelStats(theResult); modelStats.setTokenStats(wordStats); Stats fieldStats = fieldLevelStats(theResult); modelStats.setFieldStats(fieldStats); theResult = theResult.replace("\n\n", "\n \n"); StringTokenizer stt = new StringTokenizer(theResult, "\n"); boolean allGood = true; int correctInstance = 0; int totalInstance = 0; String line = null; while (stt.hasMoreTokens()) { line = stt.nextToken(); if ((line.trim().length() == 0) || (!stt.hasMoreTokens())) { totalInstance++; if (allGood) { correctInstance++; } allGood = true; } else { StringTokenizer st = new StringTokenizer(line, "\t "); String obtainedLabel = null; String expectedLabel = null; while (st.hasMoreTokens()) { obtainedLabel = getPlainLabel(st.nextToken()); if (st.hasMoreTokens()) { expectedLabel = obtainedLabel; } } if (!obtainedLabel.equals(expectedLabel)) { allGood = false; } } } modelStats.setTotalInstances(totalInstance); modelStats.setCorrectInstance(correctInstance); return modelStats; }

Target:
public static ModelStats computeStats(String theResult) { return new ModelStats(theResult); }
Source:
private static String checkSitePathToken(Site site, String pattern) { if (site.getRequestScheme().hasPathToken()) { StringBuilder modified = new StringBuilder(pattern.length() + 8); modified.append("/*"); if (!pattern.isEmpty() && !pattern.startsWith("/")) { modified.append('/'); } modified.append(pattern); return modified.toString(); } else { return pattern; } }

Target:
private static String checkSitePathToken(Site site, String pattern) { if (site.getRequestScheme().hasPathToken()) { StringBuilder modified = new StringBuilder(pattern.length() + 3); modified.append("/*"); if (!pattern.isEmpty() && !pattern.startsWith("/")) { modified.append('/'); } modified.append(pattern); return modified.toString(); } else { return pattern; } }
Source:
public CompletableFuture<Void> restoreSnapshot(String snapshotName) { boolean takeFailSafeSnapshot = false; return restoreSnapshot(snapshotName, takeFailSafeSnapshot); }

Target:
public CompletableFuture<Void> restoreSnapshot(String snapshotName) { return restoreSnapshot(snapshotName, false); }
Source:
public void select(final int... indices) { waitForEnabled(); if (indices.length > 1) assertMultiSelect(); setFocus(); log.debug(MessageFormat.format("Selecting rows {0} in table {1}", StringUtils.join(indices, ", "), this)); for (int i = 0; i < indices.length; i++) { assertIsLegalRowIndex(indices[i]); } asyncExec(new VoidResult() { public void run() { for (int i = 0; i < indices.length; i++) { lastSelectionItem = widget.getItem(indices[i]); if (i == 0) { widget.setSelection(indices[0]); notifySelect(); } else { widget.select(indices[i]); notifySelect(true); } } } }); }

Target:
public void select(final int... indices) { waitForEnabled(); if (indices.length > 1) { assertMultiSelect(); } else if (indices.length == 0) { unselect(); return; } setFocus(); log.debug(MessageFormat.format("Selecting rows {0} in table {1}", StringUtils.join(indices, ", "), this)); for (int i = 0; i < indices.length; i++) { assertIsLegalRowIndex(indices[i]); } asyncExec(new VoidResult() { public void run() { for (int i = 0; i < indices.length; i++) { lastSelectionItem = widget.getItem(indices[i]); if (i == 0) { widget.setSelection(indices[0]); notifySelect(); } else { widget.select(indices[i]); notifySelect(true); } } } }); }
Source:
public <K> Map<K, FixedLengthSliceInput> readFully(Map<K, DiskRange> diskRanges) throws IOException { checkNotNull(diskRanges, "diskRanges is null"); if (diskRanges.isEmpty()) { return ImmutableMap.of(); } Iterable<DiskRange> mergedRanges = mergeAdjacentDiskRanges(diskRanges.values(), maxMergeDistance, maxReadSize); Map<DiskRange, byte[]> buffers = new LinkedHashMap<>(); for (DiskRange mergedRange : mergedRanges) { byte[] buffer = new byte[mergedRange.getLength()]; readFully(mergedRange.getOffset(), buffer); buffers.put(mergedRange, buffer); } ImmutableMap.Builder<K, FixedLengthSliceInput> slices = ImmutableMap.builder(); for (Entry<K, DiskRange> entry : diskRanges.entrySet()) { slices.put(entry.getKey(), new BasicSliceInput(getDiskRangeSlice(entry.getValue(), buffers))); } return slices.build(); }

Target:
public <K> Map<K, FixedLengthSliceInput> readFully(Map<K, DiskRange> diskRanges) throws IOException { checkNotNull(diskRanges, "diskRanges is null"); if (diskRanges.isEmpty()) { return ImmutableMap.of(); } Iterable<DiskRange> mergedRanges = mergeAdjacentDiskRanges(diskRanges.values(), maxMergeDistance, maxReadSize); Map<DiskRange, byte[]> buffers = new LinkedHashMap<>(); for (DiskRange mergedRange : mergedRanges) { byte[] buffer = new byte[mergedRange.getLength()]; readFully(mergedRange.getOffset(), buffer); buffers.put(mergedRange, buffer); } ImmutableMap.Builder<K, FixedLengthSliceInput> slices = ImmutableMap.builder(); diskRanges.forEach((K key, DiskRange range) -> slices.put(key, new BasicSliceInput(getDiskRangeSlice(range, buffers)))); return slices.build(); }
Source:
private Coin(final long satoshis) { if ( Math.abs(satoshis) > COIN_VALUE * NetworkParameters.MAX_COINS ) throw new ArithmeticException("Magnitude of specified amount exceeds total possible quantity of Bitcoins."); this.value = satoshis; }

Target:
private Coin(final long satoshis) { checkArgument(Math.abs(satoshis) <= COIN_VALUE * NetworkParameters.MAX_COINS, "%s satoshis exceeds maximum possible quantity of Bitcoin.", satoshis); this.value = satoshis; }
Source:
public static String fixLocation(String location) { String[] parts = location.split(":", 2); if (parts[1].charAt(0) == '/') { return parts[0] + ":" + parts[1].substring(1); } return location; }

Target:
public static String fixLocation(String location) { int colon = location.indexOf(':'); if (colon != -1) { String scheme = location.substring(0, colon); String path = location.substring(colon+1); if (path.charAt(0) == '/') { return scheme + ":" + path.substring(1); } } return location; }
Source:
public void resetFailures() { rpcManager0.throwBefore = false; rpcManager0.throwInFuture = false; IntStream.of(0, 1, 2).mapToObj(this::cache).forEach(Cache::clear); }

Target:
public void resetFailures() { rpcManager0.throwBefore = false; rpcManager0.throwInFuture = false; caches().forEach(Cache::clear); }
Source:
public void unauthorizedPerunAdmin() throws Exception { assertFalse(AuthzResolver.authorized(new PerunSessionImpl( perun, new PerunPrincipal("pepa", ExtSourcesManager.EXTSOURCE_NAME_INTERNAL, ExtSourcesManager.EXTSOURCE_INTERNAL), new PerunClient() ), "default_policy")); }

Target:
public void unauthorizedPerunAdmin() throws Exception { assertFalse(AuthzResolver.authorized(new PerunSessionImpl( perun, new PerunPrincipal("pepa", ExtSourcesManager.EXTSOURCE_NAME_INTERNAL, ExtSourcesManager.EXTSOURCE_INTERNAL), new PerunClient() ), "default_policy", Collections.emptyList())); }
Source:
private boolean removeVm() { VM vm = getVm(); Guid vmId = getVmId(); hasImages = vm.getDiskList().size() > 0; if (getParameters().isRemoveDisks() && hasImages) { if (!removeVmImages(null)) { return false; } else if (getReturnValue().getTaskIdList().isEmpty()) { endCommandWithoutTasks(); } } else { endCommandWithoutTasks(); } return true; }

Target:
private boolean removeVm() { VM vm = getVm(); hasImages = vm.getDiskList().size() > 0; if (getParameters().isRemoveDisks() && hasImages) { if (!removeVmImages(null)) { return false; } } else { endCommandWithoutTasks(); } return true; }