auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Tier loadComplete(Tier newTier) throws EntityNotFoundException { Query query = getEntityManager() .createQuery( "select p from Tier p fetch all properties where p.name = :name and p.vdc =:vdc and p.environmentname= :environmentname"); query.setParameter("name", newTier.getName()); query.setParameter("vdc", newTier.getVdc()); query.setParameter("environmentname", newTier.getEnviromentName()); Tier tier = null; try { tier = (Tier) query.getResultList().get(0); tier.getNetworks(); tier.getProductReleases(); } catch (Exception e) { String message = " Tier don't exist in database "; throw new EntityNotFoundException(Tier.class, message, newTier.getName()); } return tier; }

Target:
public Tier loadComplete(Tier newTier) throws EntityNotFoundException { Query query = getEntityManager() .createQuery( "select p from Tier p fetch all properties where p.name = :name and p.vdc =:vdc and p.environmentname= :environmentname"); query.setParameter("name", newTier.getName()); query.setParameter("vdc", newTier.getVdc()); query.setParameter("environmentname", newTier.getEnviromentName()); Tier tier = null; try { tier = (Tier) query.getResultList().get(0); tier.getNetworks(); tier.getProductReleases(); } catch (Exception e) { String message = " Tier does not exist in database "; throw new EntityNotFoundException(Tier.class, message, newTier.getName()); } return tier; }
Source:
private static Optional<Pair<Integer, Integer>> pairIsNullToIndePair(RexNode leftConj, RexNode rightConj) { if (!(leftConj.isA(SqlKind.IS_NULL)) || !(rightConj.isA(SqlKind.IS_NULL))) { return Optional.empty(); } else { return pairInputRefToIndePair(((RexCall) leftConj).getOperands().get(0), ((RexCall) rightConj).getOperands().get(0)); } }

Target:
private static Optional<Pair<Integer, Integer>> pairIsNullToIndePair(RexNode leftConj, RexNode rightConj) { if (!(leftConj.isA(SqlKind.IS_NULL)) || !(rightConj.isA(SqlKind.IS_NULL))) { return Optional.empty(); } else { return pairInputRefToIndexPair(((RexCall) leftConj).getOperands().get(0), ((RexCall) rightConj).getOperands().get(0)); } }
Source:
public boolean isSampleCheckboxEnabled(String sampleName) { String checkboxId = format(CHECKBOX_BY_SAMPLE_NAME_ID_TEMPLATE, sampleName); String locator = format(" return seleniumWebDriverHelper .waitVisibilityAndGetAttribute(By.xpath(locator), "aria-checked") .equals("true"); }

Target:
public boolean isSampleCheckboxEnabled(String sampleName) { String checkboxId = format(CHECKBOX_BY_SAMPLE_NAME_ID_TEMPLATE, sampleName); String checkboxLocator = format(" return seleniumWebDriverHelper .waitVisibilityAndGetAttribute(By.xpath(checkboxLocator), "aria-checked") .equals("true"); }
Source:
public Optional<VirtualFile> findChild(String name) { try { if (childProvider == null) { return Optional.empty(); } return childProvider.findChild(this, name); } catch (Exception e) { throw handleErrorInCallback(e, "childProvider.findChild"); } }

Target:
public Optional<VirtualFile> findChild(String name) { try { if (childProvider != null) { return childProvider.findChild(this, name); } return Optional.empty(); } catch (Exception e) { throw handleErrorInCallback(e, "childProvider.findChild"); } }
Source:
public void edit(QosModel<StorageQos, StorageQosParametersModel> object) { qosWidget.edit(object.getQosParametersModel()); driver.edit(object); }

Target:
public void edit(QosModel<StorageQos, StorageQosParametersModel> object) { driver.edit(object); qosWidget.edit(object.getQosParametersModel()); }
Source:
public Mono<ServiceBusReceivedMessage> receiveDeferredMessage(long sequenceNumber, String sessionId) { if (validateSessionId(sessionId)) { return monoError(logger, new IllegalArgumentException(String.format( "This receiver client is tied to session %s. It can't be used for another session(%s).", receiverOptions.getSessionId(), sessionId))); } return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityPath, entityType)) .flatMap(node -> node.receiveDeferredMessages(receiverOptions.getReceiveMode(), sessionId, getLinkName(sessionId), Collections.singleton(sequenceNumber)).last()) .map(receivedMessage -> { if (CoreUtils.isNullOrEmpty(receivedMessage.getLockToken())) { return receivedMessage; } if (receiverOptions.getReceiveMode() == ReceiveMode.PEEK_LOCK) { receivedMessage.setLockedUntil(managementNodeLocks.addOrUpdate(receivedMessage.getLockToken(), receivedMessage.getLockedUntil(), receivedMessage.getLockedUntil())); } return receivedMessage; }); }

Target:
Mono<ServiceBusReceivedMessage> receiveDeferredMessage(long sequenceNumber, String sessionId) { return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityPath, entityType)) .flatMap(node -> node.receiveDeferredMessages(receiverOptions.getReceiveMode(), sessionId, getLinkName(sessionId), Collections.singleton(sequenceNumber)).last()) .map(receivedMessage -> { if (CoreUtils.isNullOrEmpty(receivedMessage.getLockToken())) { return receivedMessage; } if (receiverOptions.getReceiveMode() == ReceiveMode.PEEK_LOCK) { receivedMessage.setLockedUntil(managementNodeLocks.addOrUpdate(receivedMessage.getLockToken(), receivedMessage.getLockedUntil(), receivedMessage.getLockedUntil())); } return receivedMessage; }); }
Source:
public WMTSMapLayer(WebMapTileServer wmts, Layer layer) { super( new WMTSCoverageReader(wmts, layer), STYLE ); }

Target:
public WMTSMapLayer(WebMapTileServer wmts, Layer layer) { super(new WMTSCoverageReader(wmts, layer), createStyle()); }
Source:
public void shouldReturnNameWithMultipleTags() throws Exception { String metricName = MetricNameUtils.getMetricName("metricName", ImmutableMap.of("tag1", "tagVal1", "tag2", "tagVal2")); assertThat(metricName).isEqualTo("metricName;tag1=tagVal1;tag2=tagVal2"); }

Target:
public void shouldReturnNameWithMultipleTags() throws Exception { String metricName = MetricNameUtils.getMetricName(METRIC_NAME, ImmutableMap.of(TAG_KEY_2, TAG_VALUE_2, TAG_KEY_1, TAG_VALUE_1)); assertThat(metricName).isIn("metricName;tag1=tagVal1;tag2=tagVal2", "metricName;tag2=tagVal2;tag1=tagVal1"); }
Source:
private void resolveGroupsMemberships(List<ExtMap> groupsToResolve, Set<String> resolvedGroups) throws IOException, SQLException { if (groupsToResolve != null) { for (ExtMap groupRecord : groupsToResolve) { if (!resolvedGroups.contains(groupRecord.<String>get(Authz.GroupRecord.ID))) { resolvedGroups.add(groupRecord.<String>get(Authz.GroupRecord.ID)); groupRecord.put(Authz.GroupRecord.GROUPS, getGroupMemberships(groupRecord)); resolveGroupsMemberships( groupRecord.<List<ExtMap>>get(Authz.PrincipalRecord.GROUPS), resolvedGroups); } } } }

Target:
private void resolveGroupsMemberships(List<ExtMap> groupsToResolve, Set<String> resolvedGroups) throws IOException, SQLException { if (groupsToResolve != null) { for (ExtMap groupRecord : groupsToResolve) { if (!resolvedGroups.contains(groupRecord.<String>get(Authz.GroupRecord.ID))) { resolvedGroups.add(groupRecord.<String>get(Authz.GroupRecord.ID)); groupRecord.put(Authz.GroupRecord.GROUPS, getGroupMemberships(groupRecord)); resolveGroupsMemberships( groupRecord.<List<ExtMap>>get(Authz.GroupRecord.GROUPS), resolvedGroups); } } } }
Source:
public final void appendNext(PageBuilder pageBuilder, int outputChannelOffset) { BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(outputChannelOffset); elementType.appendTo(arrayBlock, position, blockBuilder); position++; }

Target:
public final void appendNext(PageBuilder pageBuilder, int outputChannelOffset) { checkState(arrayBlock != null, "arrayBlock is null"); BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(outputChannelOffset); elementType.appendTo(arrayBlock, position, blockBuilder); position++; }
Source:
public Promise<Response> request(final InetSocketAddress address, final Request request) throws InterruptedException { Channel ch = this.channelManager.findOrNew(address, this.clientBootstrap); ch.write(request); ResponseDispatcher responseDispatcher = ch.pipeline().get(ResponseDispatcher.class); Promise<Response> responsePromise = new DefaultPromise<>(GlobalEventExecutor.INSTANCE); responseDispatcher.put(request.getId(), responsePromise); ch.flush(); return responsePromise; }

Target:
public Promise<Response> request(final InetSocketAddress address, final Request request) throws InterruptedException { Channel ch = this.channelManager.findOrNew(address, this.clientBootstrap); ch.write(request); Promise<Response> responsePromise = new DefaultPromise<>(GlobalEventExecutor.INSTANCE); ResponseDispatcher responseDispatcher = ch.pipeline().get(ResponseDispatcher.class); responseDispatcher.put(request.getId(), responsePromise); ch.flush(); return responsePromise; }
Source:
protected boolean canAddLease() { if (!getParameters().getVmStaticData().isAutoStartup()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_LEASES_ARE_NOT_SUPPORTED_WITH_HA_OFF); } if (!FeatureSupported.isVmLeasesSupported(getEffectiveCompatibilityVersion())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_LEASES_ARE_NOT_SUPPORTED); } return validateLeaseStorageDomain(getParameters().getVmStaticData().getLeaseStorageDomainId()); }

Target:
protected boolean canAddLease() { if (!FeatureSupported.isVmLeasesSupported(getEffectiveCompatibilityVersion())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_LEASES_ARE_NOT_SUPPORTED); } if (!getParameters().getVmStaticData().isAutoStartup()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_LEASES_ARE_NOT_SUPPORTED_WITH_HA_OFF); } return validateLeaseStorageDomain(getParameters().getVmStaticData().getLeaseStorageDomainId()); }
Source:
public void handleNetworkException(VDSNetworkException ex) { boolean saveToDb = true; if (cachedVds.getStatus() != VDSStatus.Down) { long timeoutToFence = calcTimeoutToFence(cachedVds.getVmCount(), cachedVds.getSpmStatus()); if (isHostInGracePeriod(false)) { if (cachedVds.getStatus() != VDSStatus.Connecting && cachedVds.getStatus() != VDSStatus.Unassigned && cachedVds.getStatus() != VDSStatus.PreparingForMaintenance && cachedVds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, cachedVds); logChangeStatusToConnecting(timeoutToFence); } else { saveToDb = false; } mUnrespondedAttempts.incrementAndGet(); } else { if (cachedVds.getStatus() == VDSStatus.Maintenance) { saveToDb = false; } else { if (cachedVds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.NonResponsive, cachedVds); moveVMsToUnknown(); logHostFailToRespond(ex, timeoutToFence); resourceManager.getEventListener().vdsNotResponding(cachedVds); } else { setStatus(VDSStatus.NonResponsive, cachedVds); } } } } if (saveToDb) { updateDynamicData(cachedVds.getDynamicData()); updateStatisticsData(cachedVds.getStatisticsData()); } }

Target:
public void handleNetworkException(VDSNetworkException ex) { boolean saveToDb = true; if (cachedVds.getStatus() != VDSStatus.Down) { long timeoutToFence = calcTimeoutToFence(cachedVds.getVmCount(), cachedVds.getSpmStatus()); if (isHostInGracePeriod(false)) { if (cachedVds.getStatus() != VDSStatus.Connecting && cachedVds.getStatus() != VDSStatus.PreparingForMaintenance && cachedVds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, cachedVds); logChangeStatusToConnecting(timeoutToFence); } else { saveToDb = false; } mUnrespondedAttempts.incrementAndGet(); } else { if (cachedVds.getStatus() == VDSStatus.Maintenance) { saveToDb = false; } else { if (cachedVds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.NonResponsive, cachedVds); moveVMsToUnknown(); logHostFailToRespond(ex, timeoutToFence); resourceManager.getEventListener().vdsNotResponding(cachedVds); } else { setStatus(VDSStatus.NonResponsive, cachedVds); } } } } if (saveToDb) { updateDynamicData(cachedVds.getDynamicData()); updateStatisticsData(cachedVds.getStatisticsData()); } }
Source:
private Flux<IndexBatchResponse> sendBatch( List<com.azure.search.documents.implementation.models.IndexAction> actions, int actionsOffset, Context context) { return client.indexDocumentsWithResponse(actions, true, context) .delaySubscription(currentRetryDelay) .flatMapMany(response -> Flux.just( new IndexBatchResponse(response.getStatusCode(), response.getValue().getResults(), actionsOffset, actions.size(), false))) .onErrorResume(IndexBatchException.class, exception -> Flux .just(new IndexBatchResponse(207, exception.getIndexingResults(), actionsOffset, actions.size(), true))) .onErrorResume(HttpResponseException.class, exception -> { int statusCode = exception.getResponse().getStatusCode(); if (exception.getResponse().getStatusCode() == HttpURLConnection.HTTP_ENTITY_TOO_LARGE) { int actionCount = actions.size(); if (actionCount == 1) { return Flux.just(new IndexBatchResponse(statusCode, null, actionsOffset, actionCount, true)); } int splitOffset = Math.round(actionCount / 2.0f); return Flux.concat( sendBatch(actions.subList(0, splitOffset), 0, context), sendBatch(actions.subList(splitOffset, actionCount), splitOffset, context) ); } return Flux.just(new IndexBatchResponse(statusCode, null, actionsOffset, actions.size(), true)); }); }

Target:
private Flux<IndexBatchResponse> sendBatch( List<com.azure.search.documents.implementation.models.IndexAction> actions, int actionsOffset, Context context) { return client.indexDocumentsWithResponse(actions, true, context) .delaySubscription(currentRetryDelay) .flatMapMany(response -> Flux.just( new IndexBatchResponse(response.getStatusCode(), response.getValue().getResults(), actionsOffset, actions.size(), false))) .onErrorResume(IndexBatchException.class, exception -> Flux .just(new IndexBatchResponse(207, exception.getIndexingResults(), actionsOffset, actions.size(), true))) .onErrorResume(HttpResponseException.class, exception -> { int statusCode = exception.getResponse().getStatusCode(); if (statusCode == HttpURLConnection.HTTP_ENTITY_TOO_LARGE) { int actionCount = actions.size(); if (actionCount == 1) { return Flux.just(new IndexBatchResponse(statusCode, null, actionsOffset, actionCount, true)); } int splitOffset = Math.round(actionCount / 2.0f); return Flux.concat( sendBatch(actions.subList(0, splitOffset), 0, context), sendBatch(actions.subList(splitOffset, actionCount), splitOffset, context) ); } return Flux.just(new IndexBatchResponse(statusCode, null, actionsOffset, actions.size(), true)); }); }
Source:
public List<ScanResult> scan() { String javaClassPath = AccessController.doPrivileged(new GetSystemPropertyAction(JAVA_CLASS_PATH_SYSTEM_PROPERTY)); if (javaClassPath == null) { throw CommonLogger.LOG.cannotReadJavaClassPathSystemProperty(); } ImmutableList.Builder<ScanResult> results = ImmutableList.builder(); Set<String> entries = ImmutableSet.copyOf(Arrays.asList(javaClassPath.split(Pattern.quote(File.pathSeparator)))); logger.debugv("Scanning class path entries: {0}", entries); for (String entry : entries) { if (entry == null || entry.isEmpty()) { continue; } File entryFile = new File(entry); if (!entryFile.canRead()) { throw CommonLogger.LOG.cannotReadClassPathEntry(entryFile); } try { if (entryFile.isDirectory()) { scanDirectory(entryFile, results); } else { scanJarFile(entryFile, results); } } catch (IOException e) { throw CommonLogger.LOG.cannotScanClassPathEntry(entryFile, e); } } return results.build(); }

Target:
public List<ScanResult> scan() { String javaClassPath = AccessController.doPrivileged(new GetSystemPropertyAction(JAVA_CLASS_PATH_SYSTEM_PROPERTY)); if (javaClassPath == null) { throw CommonLogger.LOG.cannotReadJavaClassPathSystemProperty(); } ImmutableList.Builder<ScanResult> results = ImmutableList.builder(); Set<String> entries = ImmutableSet.of(javaClassPath.split(Pattern.quote(File.pathSeparator))); logger.debugv("Scanning class path entries: {0}", entries); for (String entry : entries) { if (entry == null || entry.isEmpty()) { continue; } File entryFile = new File(entry); if (!entryFile.canRead()) { throw CommonLogger.LOG.cannotReadClassPathEntry(entryFile); } try { if (entryFile.isDirectory()) { scanDirectory(entryFile, results); } else { scanJarFile(entryFile, results); } } catch (IOException e) { throw CommonLogger.LOG.cannotScanClassPathEntry(entryFile, e); } } return results.build(); }
Source:
public Result apply(AggregationNode aggregation, Captures captures, Context context) { Assignments.Builder newAssignments = Assignments.builder(); ImmutableMap.Builder<Symbol, Aggregation> aggregations = ImmutableMap.builder(); for (Map.Entry<Symbol, Aggregation> entry : aggregation.getAggregations().entrySet()) { Symbol output = entry.getKey(); FunctionCall call = entry.getValue().getCall(); Optional<Symbol> mask = entry.getValue().getMask(); if (call.getFilter().isPresent()) { Expression filter = call.getFilter().get(); Symbol symbol = context.getSymbolAllocator().newSymbol(filter, BOOLEAN); if (mask.isPresent()) { filter = ExpressionUtils.and(filter, mask.get().toSymbolReference()); } newAssignments.put(symbol, filter); mask = Optional.of(symbol); } aggregations.put(output, new Aggregation( new FunctionCall(call.getName(), call.getWindow(), Optional.empty(), call.getOrderBy(), call.isDistinct(), call.getArguments()), entry.getValue().getSignature(), mask)); } newAssignments.putIdentities(aggregation.getSource().getOutputSymbols()); return Result.ofPlanNode( new AggregationNode( context.getIdAllocator().getNextId(), new ProjectNode( context.getIdAllocator().getNextId(), aggregation.getSource(), newAssignments.build()), aggregations.build(), aggregation.getGroupingSets(), aggregation.getStep(), aggregation.getHashSymbol(), aggregation.getGroupIdSymbol())); }

Target:
public Result apply(AggregationNode aggregation, Captures captures, Context context) { Assignments.Builder newAssignments = Assignments.builder(); ImmutableMap.Builder<Symbol, Aggregation> aggregations = ImmutableMap.builder(); for (Map.Entry<Symbol, Aggregation> entry : aggregation.getAggregations().entrySet()) { Symbol output = entry.getKey(); FunctionCall call = entry.getValue().getCall(); Optional<Symbol> mask = entry.getValue().getMask(); if (call.getFilter().isPresent()) { Expression filter = call.getFilter().get(); Symbol symbol = context.getSymbolAllocator().newSymbol(filter, BOOLEAN); verify(!mask.isPresent(), "Expected aggregation without mask symbols, see Rule pattern"); newAssignments.put(symbol, filter); mask = Optional.of(symbol); } aggregations.put(output, new Aggregation( new FunctionCall(call.getName(), call.getWindow(), Optional.empty(), call.getOrderBy(), call.isDistinct(), call.getArguments()), entry.getValue().getSignature(), mask)); } newAssignments.putIdentities(aggregation.getSource().getOutputSymbols()); return Result.ofPlanNode( new AggregationNode( context.getIdAllocator().getNextId(), new ProjectNode( context.getIdAllocator().getNextId(), aggregation.getSource(), newAssignments.build()), aggregations.build(), aggregation.getGroupingSets(), aggregation.getStep(), aggregation.getHashSymbol(), aggregation.getGroupIdSymbol())); }
Source:
private boolean detectDuplicates(final Entity entity) throws EntityStorageException { boolean hasDuplicate = false; if (duplicateDataDetector.isDetectionEnabled()) { if (mongoTypeStorage == null) { mongoTypeStorage = new MongoTypeStorage(mongo, ryaInstanceName); } final Builder builder = new Builder(); builder.setSubject(entity.getSubject()); boolean abort = false; for (final RyaURI typeRyaUri : entity.getExplicitTypeIds()) { Optional<Type> type; try { type = mongoTypeStorage.get(typeRyaUri); } catch (final TypeStorageException e) { throw new EntityStorageException("Unable to get entity type: " + typeRyaUri, e); } if (type.isPresent()) { final ConvertingCursor<TypedEntity> cursor = search(Optional.empty(), type.get(), Collections.emptySet()); while (cursor.hasNext()) { final TypedEntity typedEntity = cursor.next(); builder.setExplicitType(typeRyaUri); for (final Property property : typedEntity.getProperties()) { builder.setProperty(typeRyaUri, property); } } } else { abort = true; break; } } if (!abort) { final Entity entity2 = builder.build(); try { hasDuplicate = duplicateDataDetector.compareEntities(entity, entity2); } catch (final SmartUriException e) { throw new EntityStorageException("Encountered an error while comparing entities.", e); } } } return hasDuplicate; }

Target:
private boolean detectDuplicates(final Entity entity) throws EntityStorageException { boolean hasDuplicate = false; if (duplicateDataDetector.isDetectionEnabled()) { final List<Entity> comparisonEntities = searchHasAllExplicitTypes(entity.getExplicitTypeIds()); for (final Entity compareEntity : comparisonEntities) { try { hasDuplicate = duplicateDataDetector.compareEntities(entity, compareEntity); } catch (final SmartUriException e) { throw new EntityStorageException("Encountered an error while comparing entities.", e); } if (hasDuplicate) { break; } } } return hasDuplicate; }
Source:
synchronized public void scheduleAfterDebounceTime(String actionName, long debounceTimeMs, Runnable runnable) { ScheduledFuture sf = futureHandles.get(actionName); if (sf != null && !sf.isDone()) { LOGGER.info("cancel future for " + actionName); if (!sf.cancel(false)) { try { sf.get(TIMEOUT_MS, TimeUnit.MILLISECONDS); } catch (Exception e) { LOGGER.warn("cancel for action " + actionName + " failed with ", e); } } futureHandles.remove(actionName); } sf = scheduledExecutorService.schedule(() -> { try { runnable.run(); LOGGER.debug(actionName + " completed successfully."); } catch (Exception e) { LOGGER.error(actionName + " threw an exception.", e); if (callback != null) { callback.onException(e); } } }, debounceTimeMs, TimeUnit.MILLISECONDS); LOGGER.info("scheduled " + actionName + " in " + debounceTimeMs); futureHandles.put(actionName, sf); }

Target:
synchronized public void scheduleAfterDebounceTime(String actionName, long debounceTimeMs, Runnable runnable) { ScheduledFuture sf = futureHandles.get(actionName); if (sf != null && !sf.isDone()) { LOG.info("cancel future for " + actionName); if (!sf.cancel(false)) { try { sf.get(TIMEOUT_MS, TimeUnit.MILLISECONDS); } catch (Exception e) { LOG.warn("cancel for action " + actionName + " failed with ", e); } } futureHandles.remove(actionName); } sf = scheduledExecutorService.schedule(() -> { try { runnable.run(); LOG.debug(actionName + " completed successfully."); } catch (Throwable t) { LOG.error(actionName + " threw an exception.", t); if (scheduledTaskFailureCallback != null) { scheduledTaskFailureCallback.onError(t); } } }, debounceTimeMs, TimeUnit.MILLISECONDS); LOG.info("scheduled " + actionName + " in " + debounceTimeMs); futureHandles.put(actionName, sf); }
Source:
public void updateSubscriptions() { if (!myMdmSettings.isEnabled()) { return; } myMdmProviderLoader.loadProvider(); ourLog.info("MDM provider registered"); myMdmSubscriptionLoader.daoUpdateMdmSubscriptions(); ourLog.info("MDM subscriptions updated"); myMdmSearchParameterLoader.daoUpdateMdmSearchParameters(); ourLog.info("MDM search parameters updated"); }

Target:
public void updateSubscriptions() { if (!myMdmSettings.isEnabled()) { return; } myMdmProviderLoader.loadProvider(); ourLog.info("MDM provider registered"); myMdmSubscriptionLoader.daoUpdateMdmSubscriptions(); ourLog.info("MDM subscriptions updated"); }
Source:
static private List<BlackboardArtifact> createListFromMap(SortedMap<BlackboardAttribute, List<BlackboardArtifact>> sortedMap, int maxCount) { List<BlackboardArtifact> artifactList = new ArrayList<>(); for (List<BlackboardArtifact> mapArtifactList : sortedMap.values()) { if (maxCount == artifactList.size()) { break; } if (maxCount == 0 || (artifactList.size() + mapArtifactList.size()) <= maxCount) { artifactList.addAll(mapArtifactList); continue; } for (BlackboardArtifact artifact : mapArtifactList) { if (artifactList.size() < maxCount) { artifactList.add(artifact); } else { break; } } } return artifactList; }

Target:
static private List<BlackboardArtifact> createListFromMap(SortedMap<BlackboardAttribute, List<BlackboardArtifact>> sortedMap, int maxCount) { List<BlackboardArtifact> artifactList = new ArrayList<>(); for (List<BlackboardArtifact> mapArtifactList : sortedMap.values()) { if (maxCount == 0 || (artifactList.size() + mapArtifactList.size()) <= maxCount) { artifactList.addAll(mapArtifactList); continue; } if (maxCount == artifactList.size()) { break; } for (BlackboardArtifact artifact : mapArtifactList) { if (artifactList.size() < maxCount) { artifactList.add(artifact); } else { break; } } } return artifactList; }
Source:
public void close() { zk.close(); }

Target:
public void close() { rpcClient.close(); zk.close(); }
Source:
public boolean delete(@NonNull Disposable disposable) { ObjectHelper.requireNonNull(disposable, "Disposable item is null"); if (disposed) { return false; } synchronized (this) { if (disposed) { return false; } OpenHashSet<Disposable> set = resources; if (set == null || !set.remove(disposable)) { return false; } } return true; }

Target:
public boolean delete(@NonNull Disposable disposable) { ObjectHelper.requireNonNull(disposable, "disposables is null"); if (disposed) { return false; } synchronized (this) { if (disposed) { return false; } OpenHashSet<Disposable> set = resources; if (set == null || !set.remove(disposable)) { return false; } } return true; }
Source:
public long getLength() throws IOException { try { URI uri = new URI(encodeUriParts(getSourcePath())); if (channel == null || channel.isClosed()) { channel = getSessionForHost(uri).openChannel("sftp"); channel.connect(); } ChannelSftp sftpChannel = (ChannelSftp) channel; SftpATTRS stats = sftpChannel.lstat(decodeUriParts(uri.getRawPath())); return stats.getSize(); } catch (URISyntaxException ex) { throw new IOException("Error parsing URL", ex); } catch (SftpException ex) { throw new IOException("Error getting file stats", ex); } catch (JSchException ex) { throw new IOException("Error opening SFTP channel", ex); } }

Target:
public long getLength() throws IOException { try { URI uri = new URI(encodeUriParts(getSourcePath())); if (channel == null || channel.isClosed()) { channel = getSessionForHost(uri).openChannel("sftp"); channel.connect(); } ChannelSftp sftpChannel = (ChannelSftp) channel; SftpATTRS stats = sftpChannel.lstat(decodeUriParts(uri.getRawPath())); return stats.getSize(); } catch (URISyntaxException ex) { String msg = String.format("Bad URI format for %s", getSourcePath()); LOG.error(msg,ex); throw new IOException(msg,ex); } catch (SftpException ex) { LOG.error("Error with connection",ex); throw new IOException("Error with connection", ex); } catch (JSchException ex) { LOG.error("Error while retrieving file",ex); throw new IOException("Error retrieving file", ex); } }
Source:
void updatePartitions(final Set<TopicPartition> newInputPartitions, final Function<TopicPartition, RecordQueue> recordQueueCreator) { final Iterator<Map.Entry<TopicPartition, RecordQueue>> queuesIterator = partitionQueues.entrySet().iterator(); final Set<TopicPartition> removedPartitions = new HashSet<>(); streamTime = RecordQueue.UNKNOWN; while (queuesIterator.hasNext()) { final Map.Entry<TopicPartition, RecordQueue> queueEntry = queuesIterator.next(); final TopicPartition topicPartition = queueEntry.getKey(); if (newInputPartitions.contains(topicPartition)) { newInputPartitions.remove(topicPartition); final long partitionTime = queueEntry.getValue().partitionTime(); if (streamTime < partitionTime) { streamTime = partitionTime; } } else { totalBuffered -= queueEntry.getValue().size(); queuesIterator.remove(); removedPartitions.add(topicPartition); } } for (final TopicPartition newInputPartition : newInputPartitions) { partitionQueues.put(newInputPartition, recordQueueCreator.apply(newInputPartition)); } nonEmptyQueuesByTime.removeIf(q -> removedPartitions.contains(q.partition())); allBuffered = allBuffered && newInputPartitions.isEmpty(); }

Target:
void updatePartitions(final Set<TopicPartition> newInputPartitions, final Function<TopicPartition, RecordQueue> recordQueueCreator) { final Set<TopicPartition> removedPartitions = new HashSet<>(); final Iterator<Map.Entry<TopicPartition, RecordQueue>> queuesIterator = partitionQueues.entrySet().iterator(); while (queuesIterator.hasNext()) { final Map.Entry<TopicPartition, RecordQueue> queueEntry = queuesIterator.next(); final TopicPartition topicPartition = queueEntry.getKey(); if (!newInputPartitions.contains(topicPartition)) { totalBuffered -= queueEntry.getValue().size(); queuesIterator.remove(); removedPartitions.add(topicPartition); } newInputPartitions.remove(topicPartition); } for (final TopicPartition newInputPartition : newInputPartitions) { partitionQueues.put(newInputPartition, recordQueueCreator.apply(newInputPartition)); } nonEmptyQueuesByTime.removeIf(q -> removedPartitions.contains(q.partition())); allBuffered = allBuffered && newInputPartitions.isEmpty(); }
Source:
public void tenant(WebContext ctx, String tenantId) { T tenant = find(getTenantClass(), tenantId); SaveHelper saveHelper = prepareSave(ctx).withAfterCreateURI("/tenant/${id}").withAfterSaveURI("/tenants"); saveHelper.withPreSaveHandler(isNew -> { tenant.getTenantData().getPackageData().getUpgrades().clear(); for (String upgrade : ctx.getParameters("upgrades")) { if (packages.getUpgrades("tenant").contains(upgrade)) { tenant.getTenantData().getPackageData().getUpgrades().add(upgrade); } } if (packages.getPackages("tenant").contains(ctx.get("package").asString())) { tenant.getTenantData().getPackageData().setPackage(ctx.get("package").asString()); } }); boolean requestHandled = saveHelper.saveEntity(tenant); if (!requestHandled) { validate(tenant); List<String> availableLanguages = ((TenantUserManager<?, ?, ?>) UserContext.get().getUserManager()).getAvailableLanguages(); List<BaseEntity<?>> possibleParentTenants = mixing.getDescriptor(getTenantClass()) .getMapper() .select(getTenantClass()) .orderAsc(Tenant.TENANT_DATA.inner(TenantData.NAME)) .queryList(); ctx.respondWith() .template("templates/biz/tenants/tenant-details.html.pasta", tenant, this, possibleParentTenants, availableLanguages, packages); } }

Target:
public void tenant(WebContext ctx, String tenantId) { T tenant = find(getTenantClass(), tenantId); SaveHelper saveHelper = prepareSave(ctx).withAfterCreateURI("/tenant/${id}").withAfterSaveURI("/tenants"); saveHelper.withPreSaveHandler(isNew -> { tenant.getTenantData().getPackageData().loadPackageAndUpgradesFromContext("tenant", ctx); }); boolean requestHandled = saveHelper.saveEntity(tenant); if (!requestHandled) { validate(tenant); List<String> availableLanguages = ((TenantUserManager<?, ?, ?>) UserContext.get().getUserManager()).getAvailableLanguages(); List<BaseEntity<?>> possibleParentTenants = mixing.getDescriptor(getTenantClass()) .getMapper() .select(getTenantClass()) .orderAsc(Tenant.TENANT_DATA.inner(TenantData.NAME)) .queryList(); ctx.respondWith() .template("templates/biz/tenants/tenant-details.html.pasta", tenant, this, possibleParentTenants, availableLanguages, packages); } }
Source:
public void activate() { VDS vds = null; try { if (log.isDebugEnabled()) { log.debugFormat( "Trying to activate host {0} , meanwhile setting status to Unassigned meanwhile", getVdsId()); } vds = DbFacade.getInstance().getVdsDao().get(getVdsId()); VDSStatus newStatus = refreshCapabilities(new AtomicBoolean(), vds); if (log.isDebugEnabled()) { log.debugFormat( "Succeeded to refreshCapabilities for host {0} , new status will be {1} ", getVdsId(), newStatus); } } catch (java.lang.Exception e) { log.infoFormat("Failed to get VDS = {0} capabilities with error: {1}.", getVdsId(), e.getMessage()); log.infoFormat("Failed to activate VDS = {0}", getVdsId()); } finally { if (vds != null) { UpdateDynamicData(vds.getDynamicData()); monitoringStrategy.processHardwareCapabilities(vds); ResourceManager.getInstance().getEventListener().handleVdsVersion(vds.getId()); } } }

Target:
public void activate() { VDS vds = null; try { log.debugFormat( "Trying to activate host {0} , meanwhile setting status to Unassigned.", getVdsId()); vds = DbFacade.getInstance().getVdsDao().get(getVdsId()); VDSStatus newStatus = refreshCapabilities(new AtomicBoolean(), vds); if (log.isDebugEnabled()) { log.debugFormat( "Succeeded to refreshCapabilities for host {0} , new status will be {1} ", getVdsId(), newStatus); } } catch (java.lang.Exception e) { log.infoFormat("Failed to activate VDS = {0} with error: {1}.", getVdsId(), e.getMessage()); } finally { if (vds != null) { UpdateDynamicData(vds.getDynamicData()); monitoringStrategy.processHardwareCapabilities(vds); ResourceManager.getInstance().getEventListener().handleVdsVersion(vds.getId()); } } }
Source:
public void file2url_shouldReturnNullIfFileIsNull() throws MalformedURLException { Assert.assertNull(ModuleUtil.file2url(null)); }

Target:
public void file2url_shouldReturnNullIfFileIsNull() throws MalformedURLException { assertNull(ModuleUtil.file2url(null)); }
Source:
public static void uploadEMX(String adminToken, String fileName) { URL resourceUrl = Resources.getResource(RestTestUtils.class, fileName); File file = null; try { file = new File(new URI(resourceUrl.toString()).getPath()); } catch (URISyntaxException e) { LOG.error(e.getMessage()); } String importJobURLString = given().multiPart(file) .param("file") .param("action", "ADD_UPDATE_EXISTING") .header(X_MOLGENIS_TOKEN, adminToken) .post("plugin/importwizard/importFile") .then() .extract() .asString(); String importJobURL = importJobURLString.substring(2, importJobURLString.length() - 1); LOG.info("############ " + importJobURL); Awaitility.await() .pollDelay(500, MILLISECONDS) .atMost(5, MINUTES) .until(() -> pollForStatus(adminToken, importJobURL), not(equalTo("RUNNING"))); LOG.info("Import completed"); }

Target:
public static void uploadEMX(String adminToken, String fileName) { URL resourceUrl = Resources.getResource(RestTestUtils.class, fileName); File file = null; try { file = new File(new URI(resourceUrl.toString()).getPath()); } catch (URISyntaxException e) { LOG.error(e.getMessage()); } String importJobURLString = given().multiPart(file) .param("file") .param("action", "ADD_UPDATE_EXISTING") .header(X_MOLGENIS_TOKEN, adminToken) .post("plugin/importwizard/importFile") .then() .extract() .asString(); String importJobURL = importJobURLString.substring(2, importJobURLString.length() - 1); LOG.info("############ " + importJobURL); await().pollDelay(500, MILLISECONDS) .atMost(5, MINUTES) .until(() -> pollForStatus(adminToken, importJobURL), not(equalTo("RUNNING"))); LOG.info("Import completed"); }
Source:
private Optional<Map<Integer, Integer>> fitNodes(int vmNumaNodeIndex, Map<Integer, Long> hostNodeFreeMem) { if (vmNumaNodeIndex >= vmNodes.size()) { return Optional.of(new HashMap<>(vmNodes.size())); } VmNumaNode vmNode = vmNodes.get(vmNumaNodeIndex); if (vmNode.getVdsNumaNodeList().isEmpty()) { return fitNodes( vmNumaNodeIndex + 1, hostNodeFreeMem); } for (Integer pinnedIndex: vmNode.getVdsNumaNodeList()) { long hostFreeMem = hostNodeFreeMem.get(pinnedIndex); List<Integer> hostNodeCpus = hostNodeCpuMap.get(pinnedIndex); if (!vmNodeFitsHostNode(vmNode, hostFreeMem, hostNodeCpus)) { continue; } hostNodeFreeMem.put(pinnedIndex, hostFreeMem - vmNode.getMemTotal()); Optional<Map<Integer, Integer>> othersFit = fitNodes(vmNumaNodeIndex + 1, hostNodeFreeMem); if (othersFit.isPresent()) { othersFit.get().put(vmNode.getIndex(), pinnedIndex); return othersFit; } hostNodeFreeMem.put(pinnedIndex, hostFreeMem); } return Optional.empty(); }

Target:
private Optional<Map<Integer, Integer>> fitNodes(int vmNumaNodeIndex, Map<Integer, Long> hostNodeFreeMem) { if (vmNumaNodeIndex >= vmNodes.size()) { return Optional.of(new HashMap<>(vmNodes.size())); } VmNumaNode vmNode = vmNodes.get(vmNumaNodeIndex); if (vmNode.getVdsNumaNodeList().isEmpty()) { return fitNodes(vmNumaNodeIndex + 1, hostNodeFreeMem); } for (Integer pinnedIndex: vmNode.getVdsNumaNodeList()) { long hostFreeMem = hostNodeFreeMem.get(pinnedIndex); if (hostFreeMem < vmNode.getMemTotal()) { failedOnMemory = true; continue; } List<Integer> hostNodeCpus = hostNodeCpuMap.get(pinnedIndex); if (!vmNodeFitsHostNodeCpuPinning(vmNode, hostNodeCpus)) { failedOnCpuPinning = true; continue; } hostNodeFreeMem.put(pinnedIndex, hostFreeMem - vmNode.getMemTotal()); Optional<Map<Integer, Integer>> othersFit = fitNodes(vmNumaNodeIndex + 1, hostNodeFreeMem); if (othersFit.isPresent()) { othersFit.get().put(vmNode.getIndex(), pinnedIndex); return othersFit; } hostNodeFreeMem.put(pinnedIndex, hostFreeMem); } return Optional.empty(); }
Source:
private void addDomainProvider(DomainProvider provider, DefaultMutableTreeNode node) { String providerName = provider.getName().getString(getSession().getLocale()); DefaultMutableTreeNode providerNode = new DefaultMutableTreeNode(providerName); node.add(providerNode); ServiceId domainProviderServiceId = new ServiceId(); domainProviderServiceId.setServiceId(DOMAINSTRING + providerName + "]"); availableDomains.put(provider.getDomainInterface().getName(), provider.getDomainInterface()); domainProviderServiceId.setServiceClass(provider.getDomainInterface().getName()); DefaultMutableTreeNode endPointReferenceNode = new DefaultMutableTreeNode(domainProviderServiceId, false); providerNode.add(endPointReferenceNode); for (ServiceReference serviceReference : services.serviceReferencesForDomain(provider.getDomainInterface())) { String id = (String) serviceReference.getProperty("id"); if (id != null) { ServiceId serviceId = new ServiceId(); serviceId.setServiceId(id); serviceId.setServiceClass(provider.getDomainInterface().getName()); DefaultMutableTreeNode referenceNode = new DefaultMutableTreeNode(serviceId, false); providerNode.add(referenceNode); } } }

Target:
private void addDomainProvider(DomainProvider provider, DefaultMutableTreeNode node) { String providerName = provider.getName().getString(getSession().getLocale()); DefaultMutableTreeNode providerNode = new DefaultMutableTreeNode(providerName); node.add(providerNode); ServiceId domainProviderServiceId = new ServiceId(); String name = String.format(DOMAINSTRING, providerName); domainProviderServiceId.setServiceId(name); availableDomains.put(name, provider); domainProviderServiceId.setServiceClass(provider.getDomainInterface().getName()); DefaultMutableTreeNode endPointReferenceNode = new DefaultMutableTreeNode(domainProviderServiceId, false); providerNode.add(endPointReferenceNode); for (ServiceReference serviceReference : services.serviceReferencesForDomain(provider.getDomainInterface())) { String id = (String) serviceReference.getProperty("id"); if (id != null) { ServiceId serviceId = new ServiceId(); serviceId.setServiceId(id); serviceId.setServiceClass(provider.getDomainInterface().getName()); DefaultMutableTreeNode referenceNode = new DefaultMutableTreeNode(serviceId, false); providerNode.add(referenceNode); } } }
Source:
CachedFileInfo getFileInfo(final Long ledger, final byte masterKey[]) throws IOException { try { CachedFileInfo fi; pendingGetFileInfoCounter.inc(); Callable<CachedFileInfo> loader = () -> { CachedFileInfo fileInfo = fileInfoBackingCache.loadFileInfo(ledger, masterKey); activeLedgers.put(ledger, true); return fileInfo; }; if (null != masterKey) { fi = writeFileInfoCache.get(ledger, loader); } else { fi = readFileInfoCache.get(ledger, loader); } fi.retain(); return fi; } catch (ExecutionException | UncheckedExecutionException ee) { if (ee.getCause() instanceof IOException) { throw (IOException) ee.getCause(); } else { throw new IOException("Failed to load file info for ledger " + ledger, ee); } } finally { pendingGetFileInfoCounter.dec(); } }

Target:
CachedFileInfo getFileInfo(final Long ledger, final byte masterKey[]) throws IOException { try { CachedFileInfo fi; pendingGetFileInfoCounter.inc(); Callable<CachedFileInfo> loader = () -> { CachedFileInfo fileInfo = fileInfoBackingCache.loadFileInfo(ledger, masterKey); activeLedgers.put(ledger, true); return fileInfo; }; do { if (null != masterKey) { fi = writeFileInfoCache.get(ledger, loader); } else { fi = readFileInfoCache.get(ledger, loader); } } while (!fi.tryRetain()); return fi; } catch (ExecutionException | UncheckedExecutionException ee) { if (ee.getCause() instanceof IOException) { throw (IOException) ee.getCause(); } else { throw new IOException("Failed to load file info for ledger " + ledger, ee); } } finally { pendingGetFileInfoCounter.dec(); } }
Source:
public static VariantContext makeMergedVariantContext(final List<VariantContext> vcs) { final List<String> sources = vcs.stream().map(VariantContext::getSource).collect(Collectors.toList()); return GATKVariantContextUtils.simpleMerge(vcs, sources, GATKVariantContextUtils.FilteredRecordMergeType.KEEP_IF_ANY_UNFILTERED, GATKVariantContextUtils.GenotypeMergeType.PRIORITIZE, false, false, null, false, false); }

Target:
public static VariantContext makeMergedVariantContext(final List<VariantContext> vcs) { if (vcs.isEmpty()) { return null; } final List<String> haplotypeSources = vcs.stream().map(VariantContext::getSource).collect(Collectors.toList()); return GATKVariantContextUtils.simpleMerge(vcs, haplotypeSources, GATKVariantContextUtils.FilteredRecordMergeType.KEEP_IF_ANY_UNFILTERED, GATKVariantContextUtils.GenotypeMergeType.PRIORITIZE, false, false, null, false, false); }
Source:
public void setGlusterNetwork(ClusterNetworkModel model, boolean value) { if (!isMultiCluster()) { if (value) { if (getGlusterNetwork() != null) { getGlusterNetwork().setGlusterNetwork(false); } } else { managementNetwork.setGlusterNetwork(true); } } model.setGlusterNetwork(value); }

Target:
public void setGlusterNetwork(ClusterNetworkModel model, boolean value) { if (!isMultiCluster()) { if (value) { if (getGlusterNetwork() != null) { getGlusterNetwork().setGlusterNetwork(false); } glusterNetwork = model; } else { getManagementNetwork().setGlusterNetwork(true); } } model.setGlusterNetwork(value); }
Source:
protected void assertIsLegalCell(final int row, final int column) { int rowCount = rowCount(); int columnCount = columnCount(); Assert.isLegal(row < rowCount, "The row number (" + row + ") is more than the number of rows (" + rowCount + ") in the table."); Assert.isLegal((column < columnCount) || ((columnCount == 0) && (column == 0)), "The column number (" + column + ") is more than the number of columns (" + columnCount + ") in the table."); }

Target:
protected void assertIsLegalCell(final int row, final int column) { int rowCount = rowCount(); int columnCount = columnCount(); Assert.isLegal(row >= 0); Assert.isLegal(column >= 0); Assert.isLegal(row < rowCount, "The row number (" + row + ") is more than the number of visible rows (" + rowCount + ") in the table."); Assert.isLegal((column < columnCount) || ((columnCount == 0) && (column == 0)), "The column number (" + column + ") is more than the number of visible columns (" + columnCount + ") in the table."); }
Source:
private Map<StoreKey, StoreKey> batchConvertReplicaMetadataResponseKeys(ReplicaMetadataResponse response) throws IOException { try { List<StoreKey> storeKeysToConvert = new ArrayList<>(); for (ReplicaMetadataResponseInfo replicaMetadataResponseInfo : response.getReplicaMetadataResponseInfoList()) { if (replicaMetadataResponseInfo.getError() == ServerErrorCode.No_Error) { for (MessageInfo messageInfo : replicaMetadataResponseInfo.getMessageInfoList()) { storeKeysToConvert.add(messageInfo.getStoreKey()); } } } return storeKeyConverter.convert(storeKeysToConvert); } catch (Exception e) { throw new IOException("Problem with store key conversion", e); } }

Target:
private Map<StoreKey, StoreKey> batchConvertReplicaMetadataResponseKeys(ReplicaMetadataResponse response) throws IOException { try { List<StoreKey> storeKeysToConvert = new ArrayList<>(); for (ReplicaMetadataResponseInfo replicaMetadataResponseInfo : response.getReplicaMetadataResponseInfoList()) { if ((replicaMetadataResponseInfo.getError() == ServerErrorCode.No_Error) && ( replicaMetadataResponseInfo.getMessageInfoList() != null)) { for (MessageInfo messageInfo : replicaMetadataResponseInfo.getMessageInfoList()) { storeKeysToConvert.add(messageInfo.getStoreKey()); } } } return storeKeyConverter.convert(storeKeysToConvert); } catch (Exception e) { throw new IOException("Problem with store key conversion", e); } }
Source:
public void handle(ContainerEvent event) { String podName = event.getPodName(); if (isUnrecoverable(event) && workspacePods.containsKey(podName)) { String reason = event.getReason(); String message = event.getMessage(); String workspaceId = getContext().getIdentity().getWorkspaceId(); LOG.error( "Unrecoverable event occurred during workspace '{}' startup: {}, {}, {}", workspaceId, reason, message, podName); try { internalStop(emptyMap()); } catch (InfrastructureException e) { LOG.error("Error occurred during runtime '{}' stopping. {}", workspaceId, e.getMessage()); } finally { eventPublisher.sendRuntimeStoppedEvent( format("Unrecoverable event occurred: '%s', '%s', '%s'", reason, message, podName), getContext().getIdentity()); } } }

Target:
public void handle(ContainerEvent event) { if (isWorkspaceEvent(event) && happenedAfterHandlerInitialization(event) && isUnrecoverable(event)) { String reason = event.getReason(); String message = event.getMessage(); String workspaceId = getContext().getIdentity().getWorkspaceId(); LOG.error( "Unrecoverable event occurred during workspace '{}' startup: {}, {}, {}", workspaceId, reason, message, event.getPodName()); try { internalStop(emptyMap()); } catch (InfrastructureException e) { LOG.error("Error occurred during runtime '{}' stopping. {}", workspaceId, e.getMessage()); } finally { eventPublisher.sendRuntimeStoppedEvent( format( "Unrecoverable event occurred: '%s', '%s', '%s'", reason, message, event.getPodName()), getContext().getIdentity()); } } }
Source:
public void setDefinedSize(boolean definedSize) { if (this.definedSize != definedSize) { this.definedSize = definedSize; this.countCallback = null; this.skipCountIncreaseUntilReset = false; if (definedSize) { requestFlush(); } else if (requestedRange.contains(assumedSize - 1)) { requestFlush(); } } }

Target:
public void setDefinedSize(boolean definedSize) { if (this.definedSize != definedSize) { this.definedSize = definedSize; countCallback = null; skipCountIncreaseUntilReset = false; if (definedSize) { requestFlush(); } else if (requestedRange.contains(assumedSize - 1)) { requestFlush(); } } }
Source:
protected void executeQueryCommand() { final Guid id = getParameters().getId(); final MacPool macPool = getDbFacade().getMacPoolDao().get(id); getQueryReturnValue().setReturnValue(macPool); }

Target:
protected void executeQueryCommand() { final MacPool macPool = getDbFacade().getMacPoolDao().get(getParameters().getId()); getQueryReturnValue().setReturnValue(macPool); }
Source:
public Comment getExternalComment(CoreSession session, String entityId) { DocumentModel commentModel = getExternalCommentModel(session, entityId); checkReadCommentPermissions(session, commentModel.getRef()); return Framework.doPrivileged( () -> COMMENT_DOC_TYPE.equals(commentModel.getType()) ? Comments.newComment(commentModel) : Comments.newAnnotation(commentModel)); }

Target:
public Comment getExternalComment(CoreSession session, String entityId) { DocumentModel commentModel = getExternalCommentModel(session, entityId); checkReadCommentPermissions(session, commentModel.getRef()); return Framework.doPrivileged(() -> Comments.toComment(commentModel)); }
Source:
public CacheServiceMBean getCacheServiceProxy() { if (cacheService == null) cacheService = newProxy(CacheService.MBEAN_NAME, CacheServiceMBean.class); return cacheService; }

Target:
public CacheServiceMBean getCacheServiceProxy() { if (cacheService == null) { cacheService = newProxy(CacheService.MBEAN_NAME, CacheServiceMBean.class); } return cacheService; }