auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ProcessResult process(AbstractFile file) { if (!utils.isSupported(file, this)) { return ProcessResult.OK; } if (file.getSize() > TextClassifierUtils.MAX_FILE_SIZE) { logger.log(Level.INFO, "Encountered file " + file.getParentPath() + file.getName() + " with object id of " + file.getId() + " which exceeds max file size of " + TextClassifierUtils.MAX_FILE_SIZE + " bytes, with a size of " + file.getSize()); return IngestModule.ProcessResult.OK; } boolean isNotable; try { isNotable = classify(file); } catch (TextExtractorFactory.NoTextExtractorFound ex) { logger.log(Level.SEVERE, "NoTextExtractorFound in categorizing : " + ex.getMessage()); return ProcessResult.ERROR; } catch (InitReaderException ex) { logger.log(Level.SEVERE, "InitReaderException in categorizing : " + ex.getMessage()); return ProcessResult.ERROR; } catch (IOException ex) { logger.log(Level.SEVERE, "IOException in categorizing : " + ex.getMessage()); return ProcessResult.ERROR; } if (isNotable) { try { BlackboardArtifact artifact = file.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT); artifact.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME, Bundle.TextClassifierModuleFactory_moduleName_text(), "Possible notable text")); try { blackboard.indexArtifact(artifact); <START> } catch (Blackboard.BlackboardException ex) { <END> logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); } } catch (TskCoreException ex) { logger.log(Level.SEVERE, "TskCoreException in categorizing : " + ex.getMessage()); } } return ProcessResult.OK; }</code><technical_language>indexArtifact BlackboardException depreicated</technical_language>

Target:
public ProcessResult process(AbstractFile file) { if (!utils.isSupported(file)) { return ProcessResult.OK; } if (file.getSize() > TextClassifierUtils.MAX_FILE_SIZE) { logger.log(Level.INFO, "Encountered file " + file.getParentPath() + file.getName() + " with object id of " + file.getId() + " which exceeds max file size of " + TextClassifierUtils.MAX_FILE_SIZE + " bytes, with a size of " + file.getSize()); return IngestModule.ProcessResult.OK; } boolean isNotable; try { isNotable = classify(file); } catch (IOException | InitReaderException | NoTextExtractorFound ex) { logger.log(Level.SEVERE, "Exception while categorizing : " + ex.getMessage(), ex); return ProcessResult.ERROR; } if (isNotable) { try { BlackboardArtifact artifact = file.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT); artifact.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME, Bundle.TextClassifierModuleFactory_moduleName_text(), "Possible notable text")); try { blackboard.postArtifact(artifact, Bundle.TextClassifierModuleFactory_moduleName_text()); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to post blackboard artifact " + artifact.getArtifactID(), ex); } } catch (TskCoreException ex) { logger.log(Level.SEVERE, "TskCoreException in categorizing : " + ex.getMessage(), ex); } } return ProcessResult.OK; }
Source:
<code>public void buildAndDeployTest() { <START> ClassLoader currentCL = Thread.currentThread().getContextClassLoader(); <END> Thread.currentThread().setContextClassLoader(classLoader); PMMLRequestData request = new PMMLRequestData("123", "SimpleScorecard"); request.addRequestParam("param1", 10.0); request.addRequestParam("param2", 15.0); ApplyPmmlModelCommand command = (ApplyPmmlModelCommand) ((CommandFactoryServiceImpl) commandsFactory).newApplyPmmlModel(request); command.setPackageName("org.kie.scorecard"); ServiceResponse<ExecutionResults> results = ruleClient.executeCommandsWithResults(CONTAINER_ID, command); assertNotNull(results); PMML4Result resultHolder = (PMML4Result) results.getResult().getValue("results"); assertNotNull(resultHolder); assertEquals("OK", resultHolder.getResultCode()); System.out.println(resultHolder.toString()); logger.info(resultHolder.toString()); }</code><technical_language>saving existing classLoader? I remove</technical_language>

Target:
public void buildAndDeployTest() { Thread.currentThread().setContextClassLoader(classLoader); PMMLRequestData request = new PMMLRequestData("123", "SimpleScorecard"); request.addRequestParam("param1", 10.0); request.addRequestParam("param2", 15.0); ApplyPmmlModelCommand command = (ApplyPmmlModelCommand) ((CommandFactoryServiceImpl) commandsFactory).newApplyPmmlModel(request); command.setPackageName("org.kie.scorecard"); ServiceResponse<ExecutionResults> results = ruleClient.executeCommandsWithResults(CONTAINER_ID, command); assertNotNull(results); PMML4Result resultHolder = (PMML4Result) results.getResult().getValue("results"); assertNotNull(resultHolder); assertEquals("OK", resultHolder.getResultCode()); System.out.println(resultHolder.toString()); logger.info(resultHolder.toString()); }
Source:
<code>public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { TargetLandPermanent target = new TargetLandPermanent(0, amount, new FilterLandPermanent(), true); if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { FilterPermanent filter = new FilterLandPermanent(); filter.add(new TappedPredicate()); Player player = game.getPlayer(game.getActivePlayerId()); int tappedLands = game.getBattlefield().getAllActivePermanents(filter, game.getActivePlayerId(), game).size(); if (player != null && tappedLands <= amount) { <START> if (player.chooseUse(outcome, "Include your tapped lands to untap?", source, game)) { <END> for (Permanent land : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) { target.addTarget(land.getId(), source, game); } } } if (target.choose(Outcome.Untap, source.getControllerId(), source.getSourceId(), game)) { for (Object targetId : target.getTargets()) { Permanent p = game.getPermanent((UUID) targetId); if (p != null) { p.untap(game); } } } } return true; } return false; }</code><technical_language>Need Outcome.Untap code below</technical_language>

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { TargetLandPermanent target = new TargetLandPermanent(0, amount, new FilterLandPermanent(), true); if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { FilterPermanent filter = new FilterLandPermanent(); filter.add(new TappedPredicate()); int tappedLands = game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game).size(); if (tappedLands <= amount) { if (controller.chooseUse(outcome, "Include your tapped lands to untap?", source, game)) { for (Permanent land : game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) { target.addTarget(land.getId(), source, game); } } } if (target.choose(Outcome.Untap, source.getControllerId(), source.getSourceId(), game)) { for (Object targetId : target.getTargets()) { Permanent p = game.getPermanent((UUID) targetId); if (p != null) { p.untap(game); } } } } return true; } return false; }
Source:
<code>public void assertHasDeclaredMethods(AssertionInfo info, Class<?> actual, String... methods) { assertNotNull(info, actual); <START> doAssertHasMethods(info, actual, actual.getDeclaredMethods(), methods); <END> }</code><technical_language>do in doAssertHasMethods error message is declared methods methods</technical_language>

Target:
public void assertHasDeclaredMethods(AssertionInfo info, Class<?> actual, String... methods) { assertNotNull(info, actual); doAssertHasMethods(info, actual, actual.getDeclaredMethods(), true, methods); }
Source:
<code>public boolean testForEvent(ITmfEvent event) throws AttributeNotFoundException { ITmfStateSystem ss = fContainer.getStateSystem(); <START> if (fStateValueList.length > 0) { <END> return testForEvent(event, NonNullUtils.checkNotNull(ss)); } else if (!fConditions.isEmpty()) { switch (fOperator) { case AND: for (TmfXmlCondition childCondition : fConditions) { if (!childCondition.testForEvent(event)) { return false; } } return true; case NONE: break; case NOT: return !fConditions.get(0).testForEvent(event); case OR: for (TmfXmlCondition childCondition : fConditions) { if (childCondition.testForEvent(event)) { return true; } } return false; default: break; } } return true; }</code><technical_language>!isempty if list</technical_language>

Target:
public boolean testForEvent(ITmfEvent event) throws AttributeNotFoundException { ITmfStateSystem ss = fContainer.getStateSystem(); if (!fStateValues.isEmpty()) { return testForEvent(event, NonNullUtils.checkNotNull(ss)); } else if (!fConditions.isEmpty()) { switch (fOperator) { case AND: for (TmfXmlCondition childCondition : fConditions) { if (!childCondition.testForEvent(event)) { return false; } } return true; case NONE: break; case NOT: return !fConditions.get(0).testForEvent(event); case OR: for (TmfXmlCondition childCondition : fConditions) { if (childCondition.testForEvent(event)) { return true; } } return false; default: break; } } return true; }
Source:
<code>public void execute(DelegateExecution execution) throws Exception { Pool pool = (Pool) execution.getVariable(CoreProcessVariables.POOL); checkNotNull(pool, "Please add the pool description as a process " + "variable with the name '%s'.", CoreProcessVariables.POOL); Machine machine = (Machine) execution.getVariable("machine"); LOG.info(">> Connecting to machine to install packages", machine); <START> SSHClient client = Ssh.newClient(machine, pool.getAdminAccess(), 5 * 60000 ); <END> try { String puppetScript = Mustache.toString(InstallPackages.class, "/com/axemblr/provisionr/core/puppet/packages.pp.mustache", ImmutableMap.of("packages", packagesAsListOfMaps(pool.getSoftware()))); Ssh.createFile(client, puppetScript, 0600, "/tmp/packages.pp"); Session session = client.startSession(); try { session.allocateDefaultPTY(); Session.Command command = session.exec("sudo puppet apply /tmp/packages.pp"); Ssh.logCommandOutput(LOG, machine.getExternalId(), command); command.join(); if (command.getExitStatus() != 0) { throw new RuntimeException(String.format("Failed to execute " + "'sudo puppet apply /tmp/packages.pp'. Exit code: %d. Exit message: %s", command.getExitStatus(), command.getExitErrorMessage())); } else { LOG.info("<< Command completed successfully with exit code 0"); } } finally { session.close(); } } finally { client.close(); } }</code><technical_language>please a constant (static final)</technical_language>

Target:
public void execute(DelegateExecution execution) throws Exception { Pool pool = (Pool) execution.getVariable(CoreProcessVariables.POOL); checkNotNull(pool, "Please add the pool description as a process " + "variable with the name '%s'.", CoreProcessVariables.POOL); Machine machine = (Machine) execution.getVariable("machine"); LOG.info(">> Connecting to machine to install packages", machine); SSHClient client = Ssh.newClient(machine, pool.getAdminAccess()); try { String puppetScript = Mustache.toString(InstallPackages.class, "/com/axemblr/provisionr/core/puppet/packages.pp.mustache", ImmutableMap.of("packages", packagesAsListOfMaps(pool.getSoftware()))); Ssh.createFile(client, puppetScript, 0600, "/tmp/packages.pp"); Session session = client.startSession(); try { session.allocateDefaultPTY(); Session.Command command = session.exec("sudo puppet apply /tmp/packages.pp"); Ssh.logCommandOutput(LOG, machine.getExternalId(), command); command.join(); if (command.getExitStatus() != 0) { throw new RuntimeException(String.format("Failed to execute " + "'sudo puppet apply /tmp/packages.pp'. Exit code: %d. Exit message: %s", command.getExitStatus(), command.getExitErrorMessage())); } else { LOG.info("<< Command completed successfully with exit code 0"); } } finally { session.close(); } } finally { client.close(); } }
Source:
<code>public void testUpgradeTaskShouldPass() throws DotDataException { final Task05205UpdateIndexNameLength task = new Task05205UpdateIndexNameLength(); <START> task.executeUpgrade(); <END> final Map<String, String> result = getColumnPropertiesAfterUpgrade(); assertEquals("100", result.get("field_length")); assertEquals(DbConnectionFactory.getDBType().equals("Oracle") ? "N" : "NO", result.get("nullable_value")); }</code><technical_language>this run altered db. put in previous state run upgrade task test modification</technical_language>

Target:
public void testUpgradeTaskShouldPass() throws DotDataException, SQLException { setStateBeforeUpgrade(); Map<String, String> result = getColumnProperties(); assertEquals("30", result.get("field_length")); assertEquals(DbConnectionFactory.getDBType().equals("Oracle") ? "N" : "NO", result.get("nullable_value")); final Task05205UpdateIndexNameLength task = new Task05205UpdateIndexNameLength(); task.executeUpgrade(); result = getColumnProperties(); assertEquals("100", result.get("field_length")); assertEquals(DbConnectionFactory.getDBType().equals("Oracle") ? "N" : "NO", result.get("nullable_value")); }
Source:
<code><START> public Boolean isValid() { return valid && ( conf.size() == ConfigurationKey.values().length ); } <END></code><technical_language>conf.containsAll(keys) more robust</technical_language>

Target:
public Boolean isValid() { return valid && ( conf.keySet().containsAll(EnumSet.allOf(ConfigurationKey.class))); }
Source:
<code><START> void awaitOpCompletionOrTimeOut(FutureResult futureResult) throws InterruptedException { <END> int timer = 0; List<RequestInfo> allRequests = new ArrayList<>(); while (timer < AWAIT_TIMEOUT_MS / 2 && !futureResult.completed()) { pollOpManager(allRequests); Thread.sleep(50); timer += 50; allRequests.clear(); } }</code><technical_language>is this in some other class? private</technical_language>

Target:
private void awaitOpCompletionOrTimeOut(FutureResult futureResult) throws InterruptedException { int timer = 0; List<RequestInfo> allRequests = new ArrayList<>(); while (timer < AWAIT_TIMEOUT_MS / 2 && !futureResult.completed()) { pollOpManager(allRequests); Thread.sleep(50); timer += 50; allRequests.clear(); } }
Source:
<code>private void updateStoragePoolFormatType() { final storage_pool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (Version.OpEquality(spVersion, oldSpVersion)) { return; } StorageFormatType targetFormat = StorageFormatType.V1; if (spVersion.compareTo(Version.v3_0) == 0) { targetFormat = StorageFormatType.V2; } else if (spVersion.compareTo(Version.v3_1) == 0) { targetFormat = StorageFormatType.V3; } <START> StorageType spType = storagePool.getstorage_pool_type(); <END> if (targetFormat == StorageFormatType.V2 && spType != StorageType.ISCSI && spType != StorageType.FCP) { return; } storagePool.setStoragePoolFormatType(targetFormat); getStoragePoolDAO().update(storagePool); updateMemberDomainsFormat(targetFormat); if (storagePool.getstatus() != StoragePoolStatus.Up) { return; } UpgradeStoragePoolVDSCommandParameters parameters = new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat); if (getStoragePool().getstatus() == StoragePoolStatus.Up) { runVdsCommand(VDSCommandType.UpgradeStoragePool, parameters); } }</code><technical_language>I check is good candidate for canDoaction error message</technical_language>

Target:
private void updateStoragePoolFormatType() { final storage_pool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (Version.OpEquality(spVersion, oldSpVersion)) { return; } StorageFormatType targetFormat = StorageFormatType.V1; if (spVersion.compareTo(Version.v3_0) == 0) { targetFormat = StorageFormatType.V2; } else if (spVersion.compareTo(Version.v3_1) == 0) { targetFormat = StorageFormatType.V3; } StorageType spType = storagePool.getstorage_pool_type(); if (targetFormat == StorageFormatType.V2 && spType != StorageType.ISCSI && spType != StorageType.FCP) { return; } storagePool.setStoragePoolFormatType(targetFormat); getStoragePoolDAO().updatePartial(storagePool); updateMemberDomainsFormat(targetFormat); if (storagePool.getstatus() != StoragePoolStatus.Up) { return; } if (getStoragePool().getstatus() == StoragePoolStatus.Up) { runVdsCommand(VDSCommandType.UpgradeStoragePool, new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat)); } }
Source:
<code>public void setEnableSmallFileFeatures(final boolean on) { enableSmallFileFeatures = on; if (enableSmallFileFeatures) { syntaxHighlighting.setValue(getValue().isSyntaxHighlighting()); } else { syntaxHighlighting.setValue(false); } <START> Element element = context.getElement().getFirstChildElement(); <END> while (element.getPropertyInt("value") != AccountDiffPreference.WHOLE_FILE_CONTEXT) { element = element.getNextSiblingElement(); } if (element.getPropertyInt("value") == AccountDiffPreference.WHOLE_FILE_CONTEXT) { if (enableSmallFileFeatures) { element.removeAttribute("disabled"); } else { element.setAttribute("disabled", "disabled"); if (AccountDiffPreference.CONTEXT_CHOICES[context.getSelectedIndex()] == AccountDiffPreference.WHOLE_FILE_CONTEXT) { for (int i = 0; i < AccountDiffPreference.CONTEXT_CHOICES.length; i++) { if (AccountDiffPreference.CONTEXT_CHOICES[i] == PatchScreen.LARGE_FILE_CONTEXT) { context.setSelectedIndex(i); break; } } } } } toggleEnabledStatus(save.isEnabled()); }</code><technical_language>This is playing dirty. dig in DOM for child of anything. Please rework this GWT widgets more direct references elements based UiBinder annotations</technical_language>

Target:
public void setEnableSmallFileFeatures(final boolean on) { enableSmallFileFeatures = on; if (enableSmallFileFeatures) { syntaxHighlighting.setValue(getValue().isSyntaxHighlighting()); } else { syntaxHighlighting.setValue(false); } NodeList<OptionElement> options = context.getElement().<SelectElement>cast().getOptions(); for (int i = 0; i < options.getLength(); i++) { OptionElement currOption = options.getItem(i); if (Short.valueOf(currOption.getValue()) == AccountDiffPreference.WHOLE_FILE_CONTEXT) { if (enableSmallFileFeatures) { currOption.setDisabled(false); } else { currOption.setDisabled(true); if (AccountDiffPreference.CONTEXT_CHOICES[context.getSelectedIndex()] == AccountDiffPreference.WHOLE_FILE_CONTEXT) { for (int j = 0; i < AccountDiffPreference.CONTEXT_CHOICES.length; j++) { if (AccountDiffPreference.CONTEXT_CHOICES[j] == PatchScreen.LARGE_FILE_CONTEXT) { context.setSelectedIndex(j); break; } } } } } } toggleEnabledStatus(save.isEnabled()); }
Source:
<code>public static void main(String[] args) { String connectionString = System.getenv("AZURE_SERVICEBUS_CONNECTION_STRING"); ServiceBusReceiverAsyncClient receiverAsyncClient = new ServiceBusClientBuilder() .connectionString(connectionString) .buildReceiverClientBuilder() .queueName("<<queue-name>>") .buildAsyncClient(); Disposable subscription = receiverAsyncClient.receive() .subscribe(message -> { <START> System.out.println("Received Message Id:" + message.getMessageId()); <END> System.out.println("Received Message:" + new String(message.getBody())); }, error -> System.err.println("Error occurred while receiving message: " + error), () -> System.out.println("Receiving complete.")); try { Thread.sleep(Duration.ofSeconds(20).toMillis()); } catch (InterruptedException ignored) { } subscription.dispose(); receiverAsyncClient.close(); }</code><technical_language>describe messages autocompleted</technical_language>

Target:
public static void main(String[] args) { String connectionString = "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};" + "SharedAccessKey={key}"; ServiceBusReceiverAsyncClient receiverAsyncClient = new ServiceBusClientBuilder() .connectionString(connectionString) .receiver() .queueName("<<queue-name>>") .buildAsyncClient(); Disposable subscription = receiverAsyncClient.receive() .subscribe(message -> { System.out.println("Received Message Id:" + message.getMessageId()); System.out.println("Received Message:" + new String(message.getBody())); }, error -> System.err.println("Error occurred while receiving message: " + error), () -> System.out.println("Receiving complete.")); try { Thread.sleep(Duration.ofSeconds(20).toMillis()); } catch (InterruptedException ignored) { } subscription.dispose(); receiverAsyncClient.close(); }
Source:
<code>private InputStream downloadFile(final String fileId) { <START> final HttpResponse<InputStream> response = Unirest.delete(getDriveUrl() + "/api/drive/file/" + fileId + "/download") <END> .header("Authorization", "Bearer " + getAccessToken()) .asObject(raw -> raw.getContent()); final HttpResponse<InputStream> realResponse = response.getStatus() == 307 ? Unirest.get(response.getHeaders().getFirst("Location")).asObject(raw -> raw.getContent()) : response; return realResponse.getBody(); }</code><technical_language>Is delete method want invoke here</technical_language>

Target:
private InputStream downloadFile(final String fileId) { final HttpResponse<InputStream> response = Unirest.get(getDriveUrl() + "/api/drive/file/" + fileId + "/download") .header("Authorization", "Bearer " + getAccessToken()) .asObject(raw -> raw.getContent()); final HttpResponse<InputStream> realResponse = response.getStatus() == 307 ? Unirest.get(response.getHeaders().getFirst("Location")).asObject(raw -> raw.getContent()) : response; return realResponse.getBody(); }
Source:
<code>public String getSubnetHostname() { if (_privateHostname == null) { Optional<NodeMetadata> node = getOptionalNode(); if (node.isPresent()) { _privateHostname = jcloudsParent.getPrivateHostname(node.get(), Optional.of(getSshHostAndPort()), config().getBag()); } else { for (String p : getPrivateAddresses()) { if (Networking.isLocalOnly(p)) continue; _privateHostname = p; } if (groovyTruth(getPublicAddresses())) { _privateHostname = getPublicAddresses().iterator().next(); } else if (groovyTruth(getHostname())) { _privateHostname = getHostname(); } else { return null; } } <START> } <END> return _privateHostname; }</code><technical_language>I a single code path here, i.e. fallback? surprised behaviour in some edge cases</technical_language>

Target:
public String getSubnetHostname() { if (_privateHostname == null) { for (String p : getPrivateAddresses()) { if (Networking.isLocalOnly(p)) continue; _privateHostname = p; } if (groovyTruth(getPublicAddresses())) { _privateHostname = getPublicAddresses().iterator().next(); } else if (groovyTruth(getHostname())) { _privateHostname = getHostname(); } else { return null; } } return _privateHostname; }
Source:
<code>protected static void dropStacks(Multiset<ItemStack> drops, World world, BlockPos posToDrop) { for (Multiset.Entry<ItemStack> entry : drops.entrySet()) { int count = entry.getCount(); ItemStack stack = entry.getElement(); int maxStackSize = stack.getItem().getItemStackLimit(stack); while (count >= maxStackSize) { <START> ItemStack s = stack.copy(); <END> s.setCount(maxStackSize); world.spawnEntity(new EntityItem(world, posToDrop.getX(), posToDrop.getY(), posToDrop.getZ(), s)); count -= maxStackSize; } if (count > 0) { ItemStack s = stack.copy(); s.setCount(count); world.spawnEntity(new EntityItem(world, posToDrop.getX(), posToDrop.getY(), posToDrop.getZ(), s)); } } }</code><technical_language>java ItemStack s = ItemHandlerHelper.copyStackWithSize(stack, maxStackSize);</technical_language>

Target:
protected static void dropStacks(Multiset<ItemStack> drops, World world, BlockPos posToDrop) { for (Multiset.Entry<ItemStack> entry : drops.entrySet()) { int count = entry.getCount(); ItemStack stack = entry.getElement(); int maxStackSize = stack.getItem().getItemStackLimit(stack); while (count >= maxStackSize) { ItemStack s = ItemHandlerHelper.copyStackWithSize(stack, maxStackSize); world.spawnEntity(new EntityItem(world, posToDrop.getX(), posToDrop.getY(), posToDrop.getZ(), s)); count -= maxStackSize; } if (count > 0) { ItemStack s = ItemHandlerHelper.copyStackWithSize(stack, count); world.spawnEntity(new EntityItem(world, posToDrop.getX(), posToDrop.getY(), posToDrop.getZ(), s)); } } }
Source:
<code><START> public void testSequenceFlowSupplier() throws Exception { <END> final CaseManagementSetChildNodeGraphCommand command = new CaseManagementSetChildNodeGraphCommand(parent, candidate, index, originalParent, originalIndex); final Supplier<ViewConnector<SequenceFlow>> supplier = command.sequenceFlowSupplier(); final ViewConnector<SequenceFlow> viewConnector = supplier.get(); assertNotNull(viewConnector); assertNotNull(viewConnector.getSourceConnection()); assertNotNull(viewConnector.getTargetConnection()); assertNotNull(viewConnector.getBounds()); assertNotNull(viewConnector.getDefinition()); }</code><technical_language>Exception is thrown</technical_language>

Target:
public void testSequenceFlowSupplier() { final CaseManagementSetChildNodeGraphCommand command = new CaseManagementSetChildNodeGraphCommand(parent, candidate, index, originalParent, originalIndex); final Supplier<ViewConnector<SequenceFlow>> supplier = command.sequenceFlowSupplier(); final ViewConnector<SequenceFlow> viewConnector = supplier.get(); assertNotNull(viewConnector); assertNotNull(viewConnector.getSourceConnection()); assertNotNull(viewConnector.getTargetConnection()); assertNotNull(viewConnector.getBounds()); assertNotNull(viewConnector.getDefinition()); }
Source:
<code><START> public static boolean sanityCheckArenaBlockSize(long writeBufferSize, long arenaBlockSizeConfigured, long writeBufferManagerCapacity) throws IllegalStateException { <END> long defaultArenaBlockSize = RocksDBMemoryControllerUtils.calculateRocksDBDefaultArenaBlockSize(writeBufferSize); long arenaBlockSize = arenaBlockSizeConfigured <= 0 ? defaultArenaBlockSize : arenaBlockSizeConfigured; long mutableLimit = RocksDBMemoryControllerUtils.calculateRocksDBMutableLimit(writeBufferManagerCapacity); if (RocksDBMemoryControllerUtils.validateArenaBlockSize(arenaBlockSize, mutableLimit)) { return true; } else { LOG.warn("RocksDBStateBackend performance will be poor because of the current Flink memory configuration! " + "RocksDB will flush memtable constantly, causing high IO and CPU. " + "Typically the easiest fix is to increase task manager managed memory size. " + "If running locally, see the parameter taskmanager.memory.managed.size. " + "Details: arenaBlockSize < mutableLimit (writeBufferSize arenaBlockSizeConfigured defaultArenaBlockSize writeBufferManagerCapacity {})", arenaBlockSize, mutableLimit, writeBufferSize, arenaBlockSizeConfigured, defaultArenaBlockSize, writeBufferManagerCapacity); return false; } }</code><technical_language>suggestion static boolean sanityCheckArenaBlockSize( long writeBufferSize, long arenaBlockSizeConfigured, long writeBufferManagerCapacity) throws IllegalStateException { Line wrapping improvement</technical_language>

Target:
static boolean sanityCheckArenaBlockSize( long writeBufferSize, long arenaBlockSizeConfigured, long writeBufferManagerCapacity) throws IllegalStateException { long defaultArenaBlockSize = RocksDBMemoryControllerUtils.calculateRocksDBDefaultArenaBlockSize(writeBufferSize); long arenaBlockSize = arenaBlockSizeConfigured <= 0 ? defaultArenaBlockSize : arenaBlockSizeConfigured; long mutableLimit = RocksDBMemoryControllerUtils.calculateRocksDBMutableLimit(writeBufferManagerCapacity); if (RocksDBMemoryControllerUtils.validateArenaBlockSize(arenaBlockSize, mutableLimit)) { return true; } else { LOG.warn("RocksDBStateBackend performance will be poor because of the current Flink memory configuration! " + "RocksDB will flush memtable constantly, causing high IO and CPU. " + "Typically the easiest fix is to increase task manager managed memory size. " + "If running locally, see the parameter taskmanager.memory.managed.size. " + "Details: arenaBlockSize < mutableLimit (writeBufferSize = {}, arenaBlockSizeConfigured = {}," + " defaultArenaBlockSize = {}, writeBufferManagerCapacity = {})", arenaBlockSize, mutableLimit, writeBufferSize, arenaBlockSizeConfigured, defaultArenaBlockSize, writeBufferManagerCapacity); return false; } }
Source:
<code>public void testHighLevelApi() throws Exception { Random random = new Random(); int count = 10; List<PageView> pageviews = new ArrayList<>(count); for (int i = 0; i < count; i++) { String pagekey = PAGEKEYS[random.nextInt(PAGEKEYS.length - 1)]; int memberId = i; pageviews.add(new PageView(pagekey, memberId)); } CollectionStreamSystem system = CollectionStreamSystem.create("test"); <START> CollectionStream<PageView> input = CollectionStream.of("PageView", pageviews).from(system); <END> CollectionStream output = CollectionStream.empty("Output", 10).from(system); TestRunner .of(app) .addInputStream(input) .addOutputStream(output) .addOverrideConfig("job.default.system", "test") .run(); Assert.assertEquals(StreamUtils.getStreamState(output).get(random.nextInt(count)).size(), 1); }</code><technical_language>need explicitly create system here. do scene if needed</technical_language>

Target:
public void testHighLevelApi() throws Exception { Random random = new Random(); int count = 10; List<PageView> pageviews = new ArrayList<>(count); for (int i = 0; i < count; i++) { String pagekey = PAGEKEYS[random.nextInt(PAGEKEYS.length - 1)]; int memberId = i; pageviews.add(new PageView(pagekey, memberId)); } CollectionStream<PageView> input = CollectionStream.of("test", "PageView", pageviews); CollectionStream output = CollectionStream.empty("test", "Output", 10); TestRunner .of(app) .addInputStream(input) .addOutputStream(output) .addOverrideConfig("job.default.system", "test") .run(); Assert.assertEquals(TestRunner.consumeStream(output, 10000).get(random.nextInt(count)).size(), 1); }
Source:
<code>private Observable<String> dropTable(String table) { return session.execute(String.format(DROP_TABLE_CQL, table)) .map(resultSet -> table) .onErrorResumeNext(t -> { logger.infof(t, "Failed to drop %s", table); <START> return Observable.just(""); <END> }); }</code><technical_language>Observable.empty() instead removing filter part work well</technical_language>

Target:
private Observable<String> dropTable(String table) { return session.execute(String.format(DROP_TABLE_CQL, table)) .map(resultSet -> table) .onErrorResumeNext(t -> { logger.infof(t, "Failed to drop %s", table); return Observable.empty(); }); }
Source:
<code>public void bind() { try { afterBind(); } catch (Exception e) { <START> e.printStackTrace(); <END> } }</code><technical_language>throw new IllegalStateException(e)? instead</technical_language>

Target:
public void bind() { try { afterBind(); } catch (Exception e) { throw new IllegalStateException(e); } }
Source:
<code>public Stream<ProgramState> statesAfterInvocation(List<SymbolicValue> invocationArguments, List<Type> invocationTypes, ProgramState programState, Supplier<SymbolicValue> svSupplier) { int nbArguments = invocationArguments.size(); if (nbArguments != parametersConstraints().length) { return Stream.empty(); } int lastParameterIndex = nbArguments - 1; <START> if (behavior.isMethodVarArgs() && parameterConstraint(lastParameterIndex) != null && !invocationTypes.get(lastParameterIndex).isArray()) { <END> return Stream.empty(); } for (int index = 0; index < nbArguments; index++) { Constraint yieldConstraint = parameterConstraint(index); Constraint stateConstraint = programState.getConstraint(invocationArguments.get(index)); if (yieldConstraint != null && !yieldConstraint.equals(stateConstraint)) { return Stream.empty(); } } return super.statesAfterInvocation(invocationArguments, invocationTypes, programState, svSupplier); }</code><technical_language>clue</technical_language>

Target:
public Stream<ProgramState> statesAfterInvocation(List<SymbolicValue> invocationArguments, List<Type> invocationTypes, ProgramState programState, Supplier<SymbolicValue> svSupplier) { if (parameterConstraintsMatchExactly(invocationArguments, invocationTypes, programState)) { return super.statesAfterInvocation(invocationArguments, invocationTypes, programState, svSupplier); } return Stream.empty(); }
Source:
<code>public V process(Map.Entry<K, V> entry) { action.accept(entry.getKey(), entry.getValue()); <START> return entry.getValue(); <END> }</code><technical_language>forEach values, avoid sending caller simply returning null</technical_language>

Target:
public V process(Map.Entry<K, V> entry) { action.accept(entry.getKey(), entry.getValue()); return null; }
Source:
<code>public boolean isHeader() { <START> return true; <END> }</code><technical_language>good another test isHeader()=false, checks STATIC_ID trigger in a non-header file</technical_language>

Target:
public boolean isHeader() { return header; }
Source:
<code>public void silentInvalidateAll(final BiFunction<K, ValueHolder<V>, Void> biFunction) throws StoreAccessException { silentInvalidateAllObserver.begin(); StoreAccessException exception = null; long errorCount = 0; Iterator<Cache.Entry<K, ValueHolder<V>>> iterator = iterator(); <START> while (iterator.hasNext()) { <END> try { final Cache.Entry<K, ValueHolder<V>> entry = iterator.next(); silentInvalidate(entry.getKey(), new Function<ValueHolder<V>, Void>() { @Override public Void apply(ValueHolder<V> mappedValue) { biFunction.apply(entry.getKey(), mappedValue); return null; } }); } catch (StoreAccessException e) { errorCount++; if (exception == null) { exception = e; } } } if (exception != null) { silentInvalidateAllObserver.end(HigherCachingTierOperationOutcomes.SilentInvalidateAllOutcome.FAILURE); throw new StoreAccessException("silentInvalidateAll failed - error count: " + errorCount, exception); } silentInvalidateAllObserver.end(HigherCachingTierOperationOutcomes.SilentInvalidateAllOutcome.SUCCESS); }</code><technical_language>for loop</technical_language>

Target:
public void silentInvalidateAll(final BiFunction<K, ValueHolder<V>, Void> biFunction) throws StoreAccessException { silentInvalidateAllObserver.begin(); StoreAccessException exception = null; long errorCount = 0; for (final K k : map.keySet()) { try { silentInvalidate(k, new Function<ValueHolder<V>, Void>() { @Override public Void apply(ValueHolder<V> mappedValue) { biFunction.apply(k, mappedValue); return null; } }); } catch (StoreAccessException e) { errorCount++; if (exception == null) { exception = e; } } } if (exception != null) { silentInvalidateAllObserver.end(HigherCachingTierOperationOutcomes.SilentInvalidateAllOutcome.FAILURE); throw new StoreAccessException("silentInvalidateAll failed - error count: " + errorCount, exception); } silentInvalidateAllObserver.end(HigherCachingTierOperationOutcomes.SilentInvalidateAllOutcome.SUCCESS); }
Source:
<code>public void typesTextInReadOnly() throws Exception { final SWTBotText text = <START> bot.textInGroup("Text", 1); <END> assertTrue(text.isReadOnly()); try { text.typeText(""); fail("Expecting an exception"); } catch (Exception e) { assertEquals("TextBox is read-only", e.getMessage()); } }</code><technical_language>Instead, start bot.checkBox("SWT.READ_ONLY").select();</technical_language>

Target:
public void typesTextInReadOnly() throws Exception { bot.checkBox("SWT.READ_ONLY").select(); final SWTBotText text = bot.textInGroup("Text"); assertTrue(text.isReadOnly()); try { text.typeText(""); fail("Expecting an exception"); } catch (Exception e) { assertEquals("TextBox is read-only", e.getMessage()); } }
Source:
<code>private void refreshBeansList() throws IOException { this.beans = new HashSet<ObjectInstance>(); try { LinkedList<String> beanScopes = getBeansScopes(); for (String scope : beanScopes) { ObjectName name = new ObjectName(scope); this.beans.addAll(connection.queryMBeans(name)); } } catch (Exception e) { <START> e.printStackTrace(); <END> this.beans = connection.queryMBeans(null); } this.lastRefreshTime = System.currentTimeMillis(); }</code><technical_language>Bit of a nitpick, log error exception is completely silent JMXFetch's stderr is redirected a log? LOGGER.error("Unable compute common bean scope, querying beans a fallback")</technical_language>

Target:
private void refreshBeansList() throws IOException { this.beans = new HashSet<ObjectInstance>(); try { LinkedList<String> beanScopes = getBeansScopes(); for (String scope : beanScopes) { ObjectName name = new ObjectName(scope); this.beans.addAll(connection.queryMBeans(name)); } } catch (Exception e) { e.printStackTrace(); LOGGER.error("Unable to compute a common bean scope, querying all beans as a fallback"); this.beans = connection.queryMBeans(null); } this.lastRefreshTime = System.currentTimeMillis(); }
Source:
<code>public PartialInterestRateBean(Interval overlap, BigDecimal rate) { this.overlap = overlap; this.rate = rate; <START> this.numberOfDays = Days.daysBetween(overlap.getStart(), overlap.getEnd()).getDays(); <END> this.result = calculateResult(); }</code><technical_language>issue above</technical_language>

Target:
public PartialInterestRateBean(Interval overlap, BigDecimal rate) { this.overlap = overlap; this.rate = rate; this.numberOfDays = Days.daysBetween(overlap.getStart().toLocalDate(), overlap.getEnd().toLocalDate()).getDays(); this.result = calculateResult(); }
Source:
<code>public void testRouteWithSnmpV3UsersMultipleTimes() throws Exception { camelContext = new DefaultCamelContext(); camelContext.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { jaxbUnmarshaller=new JaxbUtilsUnmarshalProcessor(TrapdConfiguration.class); trapReciever=new TrapReceiverImpl(getTrapConfiguration()); from("http://localhost:10500/trapd-configuration-withSnmpV3Users.html").bean(jaxbUnmarshaller).bean(TrapdConfigBean.class, "onUpdate").bean(trapReciever, "setTrapdConfig").to("mock:result"); } }); camelContext.start(); for (int i = 0; i < 10; i++) { mockEndPoint = camelContext.getEndpoint("mock:result", MockEndpoint.class); mockEndPoint.expectedMessageCount(1); producerTemplate = camelContext.createProducerTemplate(); <START> producerTemplate.start(); <END> mockEndPoint.assertIsSatisfied(); } producerTemplate.stop(); camelContext.stop(); }</code><technical_language>I this loop is anything, starting producerTemplate sending messages. Change this test a timer invoke HTTP route multiple times</technical_language>

Target:
public void testRouteWithSnmpV3UsersMultipleTimes() throws Exception { DefaultCamelContext camelContext = new DefaultCamelContext(); Set<Object> uniqueExchangesRouted = new HashSet<Object>(); camelContext.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { JaxbUtilsUnmarshalProcessor jaxbUnmarshaller = new JaxbUtilsUnmarshalProcessor( TrapdConfiguration.class); TrapReceiverImpl trapReciever = new TrapReceiverImpl( getTrapConfiguration()); from("timer:mytimer?period=100") .to("http://localhost:10500/trapd-configuration-withSnmpV3Users.html") .bean(jaxbUnmarshaller) .bean(TrapdConfigBean.class, "onUpdate") .bean(trapReciever, "setTrapdConfig").to("mock:result"); } }); camelContext.start(); MockEndpoint mockEndPoint = camelContext.getEndpoint("mock:result", MockEndpoint.class); if (mockEndPoint.getExchanges().toArray().length == 10) { uniqueExchangesRouted.add(mockEndPoint.getExchanges().toArray()); assertEquals(1, uniqueExchangesRouted); } ProducerTemplate producerTemplate = camelContext .createProducerTemplate(); producerTemplate.start(); mockEndPoint.assertIsSatisfied(); producerTemplate.stop(); camelContext.stop(); }
Source:
<code>protected void activate() { DiscoveryServiceCallback dsc = createDiscoveryServiceCallback(); this.discoveryServiceCallback = dsc; active.set(true); for (ExtendedDiscoveryService extendedDiscoveryService : extendedDiscoveryServices) { <START> extendedDiscoveryService.setDiscoveryServiceCallback(dsc); <END> } }</code><technical_language>This means callback is a dynamic reference for service, i.e. (or cannot) time runtime, while guaranteed called immediately injected registry. note this call previously done in a safeCaller directly</technical_language>

Target:
protected void activate() { DiscoveryServiceCallbackImpl dsc = createDiscoveryServiceCallback(); this.discoveryServiceCallback = dsc; for (ExtendedDiscoveryService extendedDiscoveryService : extendedDiscoveryServices) { SafeCaller sc = safeCaller; if (sc != null) { sc.create(extendedDiscoveryService, ExtendedDiscoveryService.class).build() .setDiscoveryServiceCallback(dsc); } } }
Source:
<code>public void getOrderSubTypes_shouldGetAllSubOrderTypesWithRetiredOrderTypes() { OrderService orderService = Context.getOrderService(); List<OrderType> orderTypeList = orderService.getOrderSubtypes(orderService.getOrderType(2), true); <START> assertEquals(6, orderTypeList.size()); <END> }</code><technical_language>this exclude duplicates</technical_language>

Target:
public void getOrderSubTypes_shouldGetAllSubOrderTypesWithRetiredOrderTypes() { OrderService orderService = Context.getOrderService(); List<OrderType> orderTypeList = orderService.getOrderSubtypes(orderService.getOrderType(2), true); assertEquals(7, orderTypeList.size()); }
Source:
<code>public void locksAreExclusive() { LockTokenV2 token = CLUSTER.lock(requestFor(LOCK_A)); <START> Future<LockTokenV2> futureToken = executor.submit(() -> CLUSTER.lock(requestFor(LOCK_A))); <END> assertNotYetLocked(futureToken); CLUSTER.unlock(token); assertLockedAndUnlock(futureToken); }</code><technical_language>This is awkward, avoid proper method in TestableTimelockCluster? If changing around, I guess fine, reimplementing functionality here..</technical_language>

Target:
public void locksAreExclusive() { LockTokenV2 token = CLUSTER.lock(requestFor(LOCK_A)); Future<LockTokenV2> futureToken = CLUSTER.lockAsync(requestFor(LOCK_A)); assertNotYetLocked(futureToken); CLUSTER.unlock(token); assertLockedAndUnlock(futureToken); }
Source:
<code>public void removeAllGroupResourceAttributes(PerunSession sess, Resource resource) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { List<Group> groups = this.perunBl.getResourcesManagerBl().getAssignedGroups(sess, resource); List<Attribute> attrs = new ArrayList<>(); for(Group group: groups){ <START> attrs.addAll(this.getAttributes(sess, resource, group)); <END> for(Attribute attr : attrs) { attr.setValue(null); try { this.checkAttributesValue(sess, resource, group, attrs); } catch(WrongAttributeAssignmentException ex) { throw new ConsistencyErrorException(ex); } } attrs.clear(); } this.attributesManagerImpl.removeAllGroupResourceAttributes(sess, resource); log.info("All attributes (theirs values) were removed from resource. Resource={}.", resource); }</code><technical_language>instead: List<Attribute> attrs = this.getAttributes(sess, resource, group); need addAll existing collection clear right - confusing</technical_language>

Target:
public void removeAllGroupResourceAttributes(PerunSession sess, Resource resource) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { List<Group> groups = this.perunBl.getResourcesManagerBl().getAssignedGroups(sess, resource); List<Attribute> attrs = new ArrayList<>(); for(Group group: groups){ attrs =this.getAttributes(sess, resource, group); for(Attribute attr : attrs) { attr.setValue(null); try { this.checkAttributesValue(sess, resource, group, attrs); } catch(WrongAttributeAssignmentException ex) { throw new ConsistencyErrorException(ex); } } } this.attributesManagerImpl.removeAllGroupResourceAttributes(sess, resource); log.info("All non-virtual group-resource attributes removed for all groups and {}", resource); }
Source:
<code>public void setUp() throws Exception { super.setUp(); <START> if (SystemUtils.IS_OS_LINUX) { <END> try { eventLoopGroup = new EpollEventLoopGroup(); } catch (Throwable t) { LOG.warn("Could not use Netty Epoll event loop {}", t.getMessage()); eventLoopGroup = new NioEventLoopGroup(); } } else { eventLoopGroup = new NioEventLoopGroup(); } executor = OrderedSafeExecutor.newBuilder() .name("BKClientOrderedSafeExecutor") .numThreads(2) .build(); }</code><technical_language>create a common utility function build EventLoopGroups do duplicate this kind of code</technical_language>

Target:
public void setUp() throws Exception { super.setUp(); eventLoopGroup = new NioEventLoopGroup(); executor = OrderedSafeExecutor.newBuilder() .name("BKClientOrderedSafeExecutor") .numThreads(2) .build(); }
Source:
<code>private void setupStatsEnabledNamePatterns(IntegrationManagementConfigurer configurer) { <START> List<String> patterns = new ArrayList<String>(); <END> String[] statsEnabled = this.attributes.getStringArray("statsEnabled"); for (String managedComponent : statsEnabled) { String pattern = this.environment.resolvePlaceholders(managedComponent); patterns.addAll(Arrays.asList(StringUtils.commaDelimitedListToStringArray(pattern))); } configurer.setEnabledStatsPatterns(patterns.toArray(new String[patterns.size()])); }</code><technical_language>Please, this diamond a couple patterns.toArray(new String[patterns.size()]) in this class. I guess smells Sonar, great fix in this class. Thanks</technical_language>

Target:
private void setupStatsEnabledNamePatterns(IntegrationManagementConfigurer configurer) { List<String> patterns = new ArrayList<>(); String[] statsEnabled = this.attributes.getStringArray("statsEnabled"); for (String managedComponent : statsEnabled) { String pattern = this.environment.resolvePlaceholders(managedComponent); patterns.addAll(Arrays.asList(StringUtils.commaDelimitedListToStringArray(pattern))); } configurer.setEnabledStatsPatterns(patterns.toArray(new String[0])); }
Source:
<code>public PageableResult search(RequestContext context) throws ResponseException { String query = context.getParameter("q"); String location_uuid = context.getParameter("location_uuid"); query = query.isEmpty() ? null : query; location_uuid = StringUtils.isEmpty(location_uuid) ? null : location_uuid; ICashPointService service = Context.getService(ICashPointService.class); if (location_uuid == null) { PagingInfo pagingInfo = PagingUtil.getPagingInfoFromContext(context); List<CashPoint> cashpoints = service.findByName(query, context.getIncludeAll(), pagingInfo); AlreadyPagedWithLength<CashPoint> results = new AlreadyPagedWithLength<CashPoint>(context, cashpoints, pagingInfo.hasMoreResults(), pagingInfo.getTotalRecordCount()); <START> return results; <END> } else { LocationService locationService = Context.getLocationService(); Location location = locationService.getLocationByUuid(location_uuid); if (query == null) { return searchByLocation(location_uuid, context); } PagingInfo pagingInfo = PagingUtil.getPagingInfoFromContext(context); List<CashPoint> cashpoints = service.findCashPoints(location, query, context.getIncludeAll(), pagingInfo); PageableResult results = new AlreadyPagedWithLength<CashPoint>(context, cashpoints, pagingInfo.hasMoreResults(), pagingInfo.getTotalRecordCount()); return results; } }</code><technical_language>Instead of multiple exit points this method (the returns), create empty 'results' if, set in if, return after</technical_language>

Target:
public PageableResult search(RequestContext context) throws ResponseException { String query = context.getParameter("q"); String location_uuid = context.getParameter("location_uuid"); query = query.isEmpty() ? null : query; location_uuid = StringUtils.isEmpty(location_uuid) ? null : location_uuid; ICashPointService service = Context.getService(ICashPointService.class); LocationService locationService = Context.getLocationService(); Location location = locationService.getLocationByUuid(location_uuid); PagingInfo pagingInfo = PagingUtil.getPagingInfoFromContext(context); List<CashPoint> cashpoints = null; PageableResult results = null; if (location_uuid == null) { cashpoints = service.findByName(query, context.getIncludeAll(), pagingInfo); } else if (query == null) { cashpoints = service.getCashPointsByLocation(location, context.getIncludeAll(), pagingInfo); } else { cashpoints = service.findCashPoints(location, query, context.getIncludeAll(), pagingInfo); } results = new AlreadyPagedWithLength<CashPoint>(context, cashpoints, pagingInfo.hasMoreResults(), pagingInfo.getTotalRecordCount()); return results; }