auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void ExecuteVmCommand() { if (getVm() != null) { VmHandler.checkStatusAndLockVm(getVm().getId(), getCompensationContext()); } AddImageFromScratchParameters parameters = new AddImageFromScratchParameters(Guid.Empty, getParameters().getVmId(), getParameters().getDiskInfo()); parameters.setQuotaId(getParameters().getQuotaId()); parameters.setStorageDomainId(getStorageDomainId().getValue()); parameters.setParentCommand(VdcActionType.AddDisk); parameters.setEntityId(getParameters().getEntityId()); parameters.setStoragePoolId(getStorageDomain().getstorage_pool_id().getValue()); getParameters().getImagesParameters().add(parameters); parameters.setParentParemeters(getParameters()); if (getVm() != null) { parameters.setVmSnapshotId(getSnapshotDao().getId(getVmId(), SnapshotType.ACTIVE)); VmDeviceUtils.addManagedDevice(new VmDeviceId(getParameters().getDiskInfo().getDisk().getId(), getVmId()), VmDeviceType.DISK, VmDeviceType.DISK, null, true, false); } VdcReturnValueBase tmpRetValue = Backend.getInstance().runInternalAction(VdcActionType.AddImageFromScratch, parameters, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); getReturnValue().getTaskIdList().addAll(tmpRetValue.getInternalTaskIdList()); getReturnValue().setActionReturnValue(tmpRetValue.getActionReturnValue()); getReturnValue().setFault(tmpRetValue.getFault()); setSucceeded(tmpRetValue.getSucceeded()); }

Target:
protected void ExecuteVmCommand() { if (getVm() != null) { VmHandler.checkStatusAndLockVm(getVm().getId(), getCompensationContext()); } AddImageFromScratchParameters parameters = new AddImageFromScratchParameters(Guid.Empty, getParameters().getVmId(), getParameters().getDiskInfo()); parameters.setQuotaId(getParameters().getQuotaId()); parameters.setStorageDomainId(getStorageDomainId().getValue()); parameters.setParentCommand(VdcActionType.AddDisk); parameters.setEntityId(getParameters().getEntityId()); parameters.setStoragePoolId(getStorageDomain().getstorage_pool_id().getValue()); getParameters().getImagesParameters().add(parameters); parameters.setParentParemeters(getParameters()); if (getVm() != null) { parameters.setVmSnapshotId(getSnapshotDao().getId(getVmId(), SnapshotType.ACTIVE)); VmDeviceUtils.addManagedDevice(new VmDeviceId(getParameters().getDiskInfo().getId(), getVmId()), VmDeviceType.DISK, VmDeviceType.DISK, null, true, false); } VdcReturnValueBase tmpRetValue = Backend.getInstance().runInternalAction(VdcActionType.AddImageFromScratch, parameters, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); getReturnValue().getTaskIdList().addAll(tmpRetValue.getInternalTaskIdList()); getReturnValue().setActionReturnValue(tmpRetValue.getActionReturnValue()); getReturnValue().setFault(tmpRetValue.getFault()); setSucceeded(tmpRetValue.getSucceeded()); }
Source:
private void buildMessage(MessageContext synCtx) { try { RelayUtils.buildMessage(((Axis2MessageContext) synCtx).getAxis2MessageContext()); } catch (IOException | XMLStreamException ex) { String msg = "Error while building the message"; handleException(msg, ex); } }

Target:
private void buildMessage(MessageContext synCtx) { try { RelayUtils.buildMessage(((Axis2MessageContext) synCtx).getAxis2MessageContext()); } catch (IOException | XMLStreamException ex) { handleException("Error while building the message", ex); } }
Source:
public void merge(MergeOp.Factory mof, Change change) throws MergeException { if (start(change.getDest())) { mergeImpl(mof, change); } }

Target:
public boolean merge(MergeOp.Factory mof, Change change) throws MergeException { boolean started = start(change.getDest()); if (started) { mergeImpl(mof, change); } return started; }
Source:
public String xpath() { return String.format( "/github/repos/repo[@coords='%s']/milestones[number='%d']", this.coords, this.code ); }

Target:
private String xpath() { return String.format( "/github/repos/repo[@coords='%s']/milestones[number='%d']", this.coords, this.code ); }
Source:
public String asCanonicalNameString() { return getUnversionedPart() + (versioning == null ? ":" : versioning.getSeparator()) + getVersionPart(); }

Target:
public String asCanonicalNameString() { return getUnversionedPart() + versioning.getSeparator() + getVersionPart(); }
Source:
protected AuditMessageType getPatientParticipantObjectIdentificationForResponse(PRPAIN201306UV02 response, AuditMessageType auditMsg) { List<II> oII = PRPAIN201306UV02Parser.getPatientIds(response); if (oII != null && oII.size() > 0) { for (II entry : oII) { if (entry != null && entry.getRoot() != null && entry.getExtension() != null && !entry.getRoot().isEmpty() && !entry.getExtension().isEmpty()) { createPatientParticipantObjectIdentification(auditMsg, entry.getRoot(), entry.getExtension()); } } } else { createPatientParticipantObjectIdentification(auditMsg, null, null); } return auditMsg; }

Target:
protected AuditMessageType getPatientParticipantObjectIdentificationForResponse(PRPAIN201306UV02 response, AuditMessageType auditMsg) { List<II> oII = PRPAIN201306UV02Parser.getPatientIds(response); if (oII != null && !oII.isEmpty()) { for (II entry : oII) { if (entry == null) { createPatientParticipantObjectIdentification(auditMsg, null, null); } else { createPatientParticipantObjectIdentification(auditMsg, NullChecker.isNullishIgnoreSpace(entry. getRoot()) ? entry.getRoot().trim() : null, NullChecker.isNullishIgnoreSpace(entry. getRoot()) ? entry.getExtension().trim() : null); } } } else { createPatientParticipantObjectIdentification(auditMsg, null, null); } return auditMsg; }
Source:
public TopologyInfo getTopologyInfoByNameWithOpts(String name, GetInfoOptions options) throws NotAliveException, AuthorizationException, TException { return nimbus.getTopologyInfoByNameWithOpts(name, options); }

Target:
public TopologyInfo getTopologyInfoByNameWithOpts(String name, GetInfoOptions options) throws TException { return nimbus.getTopologyInfoByNameWithOpts(name, options); }
Source:
public void runScript(String path) throws Exception { final InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream(path); if(resourceAsStream == null) { log.warn("Given resource with path could not be found", path); return; } try (BufferedReader reader = new BufferedReader(new InputStreamReader(resourceAsStream)); ) { Connection connection = DriverManager.getConnection(url); connection.setAutoCommit(true); String line = null; while ((line = reader.readLine()) != null) { if (!line.trim().isEmpty()) { connection.createStatement().execute(line); log.info(String.format("######## SQL Query: %s ", line)); } } } }

Target:
public void runScript(String path) throws Exception { final InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream(path); if(resourceAsStream == null) { log.warn("Given resource with path could not be found", path); throw new RuntimeException("Resource not found for given path "+path); } try (BufferedReader reader = new BufferedReader(new InputStreamReader(resourceAsStream)); ) { Connection connection = DriverManager.getConnection(url); connection.setAutoCommit(true); String line = null; while ((line = reader.readLine()) != null) { if (!line.trim().isEmpty()) { connection.createStatement().execute(line); log.info(String.format("######## SQL Query: %s ", line)); } } } }
Source:
private void dumpCommits() { try { writer.openCommitsMeta( this.repositoryId ); final NodeCommitQuery nodeCommitQuery = NodeCommitQuery.create().build(); this.nodeService.findCommits( nodeCommitQuery ); final NodeCommitEntries nodeCommitEntries = this.nodeService.findCommits( nodeCommitQuery ). getNodeCommitEntries(); nodeCommitEntries.stream(). map( nodeCommitEntry -> CommitDumpEntry.create(). nodeCommitId( nodeCommitEntry.getNodeCommitId() ). message( nodeCommitEntry.getMessage() ). committer( nodeCommitEntry.getCommitter() ). timestamp( nodeCommitEntry.getTimestamp() ). build() ). forEach( this.writer::writeCommitEntry ); } finally { writer.close(); } }

Target:
private void dumpCommits() { try { writer.openCommitsMeta( this.repositoryId ); final NodeCommitQuery nodeCommitQuery = NodeCommitQuery.create().build(); final NodeCommitEntries nodeCommitEntries = this.nodeService.findCommits( nodeCommitQuery ). getNodeCommitEntries(); nodeCommitEntries.stream(). map( nodeCommitEntry -> CommitDumpEntry.create(). nodeCommitId( nodeCommitEntry.getNodeCommitId() ). message( nodeCommitEntry.getMessage() ). committer( nodeCommitEntry.getCommitter() ). timestamp( nodeCommitEntry.getTimestamp() ). build() ). forEach( this.writer::writeCommitEntry ); } finally { writer.close(); } }
Source:
protected void setOptionalMultipartUploadRequestParameters( InitiateMultipartUploadRequest req) { if(S3AEncryptionMethods.SSE_KMS.equals(serverSideEncryptionAlgorithm)) { req.setSSEAwsKeyManagementParams(generateSSEAwsKeyParams()); } else if(S3AEncryptionMethods.SSE_C.equals(serverSideEncryptionAlgorithm) && StringUtils.isNotBlank( S3AUtils.getServerSideEncryptionKey(getConf()))) { req.setSSECustomerKey(generateSSECustomerKey()); } }

Target:
protected void setOptionalMultipartUploadRequestParameters( InitiateMultipartUploadRequest req) { switch (serverSideEncryptionAlgorithm) { case SSE_KMS: req.setSSEAwsKeyManagementParams(generateSSEAwsKeyParams()); break; case SSE_C: if (StringUtils.isNotBlank(getServerSideEncryptionKey(getConf()))) { req.setSSECustomerKey(generateSSECustomerKey()); } break; default: } }
Source:
public static <TSource, TKey> Enumerable<TSource> orderBy( Enumerable<TSource> source, Function1<TSource, TKey> keySelector, Comparator<TKey> comparator, int offset, int fetch) { return new AbstractEnumerable<TSource>() { @Override public Enumerator<TSource> enumerator() { TreeMap<TKey, List<TSource>> map = new TreeMap<>(comparator); long size = 0; long needed = fetch + offset; try (Enumerator<TSource> os = source.enumerator()) { while (os.moveNext()) { TSource o = os.current(); TKey key = keySelector.apply(o); if (needed >= 0 && size >= needed) { if (comparator.compare(key, map.lastKey()) >= 0) { continue; } List<TSource> l = map.get(map.lastKey()); if (l.size() == 1) { map.remove(map.lastKey()); } else { l.remove(l.size() - 1); } size--; } map.compute(key, (k, l) -> { if (l == null) { return Collections.singletonList(o); } if (l.size() == 1) { l = new ArrayList<>(l); } l.add(o); return l; }); size++; } } if (offset > 0) { int skipped = 0; TKey until = null; for (Map.Entry<TKey, List<TSource>> e : map.entrySet()) { skipped += e.getValue().size(); if (skipped > offset) { List<TSource> l = e.getValue(); int toKeep = skipped - offset; if (toKeep < l.size()) { l.subList(0, l.size() - toKeep).clear(); } until = e.getKey(); break; } } if (until == null) { return Linq4j.emptyEnumerator(); } else if (until != null) { map.headMap(until).clear(); } } return new LookupImpl<>(map).valuesEnumerable().enumerator(); } }; }

Target:
public static <TSource, TKey> Enumerable<TSource> orderBy( Enumerable<TSource> source, Function1<TSource, TKey> keySelector, Comparator<TKey> comparator, int offset, int fetch) { return new AbstractEnumerable<TSource>() { @Override public Enumerator<TSource> enumerator() { if (fetch == 0) { return Linq4j.emptyEnumerator(); } TreeMap<TKey, List<TSource>> map = new TreeMap<>(comparator); long size = 0; long needed = fetch + offset; try (Enumerator<TSource> os = source.enumerator()) { while (os.moveNext()) { TSource o = os.current(); TKey key = keySelector.apply(o); if (needed >= 0 && size >= needed) { if (comparator.compare(key, map.lastKey()) >= 0) { continue; } List<TSource> l = map.get(map.lastKey()); if (l.size() == 1) { map.remove(map.lastKey()); } else { l.remove(l.size() - 1); } size--; } map.compute(key, (k, l) -> { if (l == null) { return Collections.singletonList(o); } if (l.size() == 1) { l = new ArrayList<>(l); } l.add(o); return l; }); size++; } } if (offset > 0) { int skipped = 0; TKey until = null; for (Map.Entry<TKey, List<TSource>> e : map.entrySet()) { skipped += e.getValue().size(); if (skipped > offset) { List<TSource> l = e.getValue(); int toKeep = skipped - offset; if (toKeep < l.size()) { l.subList(0, l.size() - toKeep).clear(); } until = e.getKey(); break; } } if (until == null) { return Linq4j.emptyEnumerator(); } map.headMap(until).clear(); } return new LookupImpl<>(map).valuesEnumerable().enumerator(); } }; }
Source:
public void foundDir( URL url, int statusCode, String response, String baseCase, String rawResponse, BaseCase baseCaseObj) { if (getView() != null) { this.getBruteForcePanel() .foundDir(url, statusCode, response, baseCase, rawResponse, baseCaseObj); ; } }

Target:
public void foundDir( URL url, int statusCode, String response, String baseCase, String rawResponse, BaseCase baseCaseObj)
Source:
public void testCrash() throws Exception { IRunnableWithProgress operation = new CrashingRunnable(); try{ PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, false, operation); fail("Should have an invocation target exception"); } catch (InvocationTargetException e){ } boolean interrupted = Thread.interrupted(); if (interrupted) { fail("Thread was interrupted at end of test"); } }

Target:
public void testCrash() throws Exception { IRunnableWithProgress operation = new CrashingRunnable(); try{ PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, false, operation); fail("Should have an invocation target exception"); } catch (InvocationTargetException e){ } if (Thread.interrupted()) { fail("Thread was interrupted at end of test"); } }
Source:
public void postProcessAfterResolution(ProjectRequest request, InitializrMetadata metadata) { boolean hasSpringCloudStream = hasDependency(request, "cloud-stream"); boolean hasWeb = hasDependency(request, "web"); if (hasSpringCloudStream) { request.getResolvedDependencies().add(STREAM_ADAPTER); } if (hasWeb) { request.getResolvedDependencies().add(WEB_ADAPTER); } }

Target:
public void postProcessAfterResolution(ProjectRequest request, InitializrMetadata metadata) { boolean hasSpringCloudStream = hasDependency(request, "cloud-stream") || hasDependency(request, "reactive-cloud-stream"); boolean hasWeb = hasDependency(request, "web"); if (hasSpringCloudStream) { request.getResolvedDependencies().add(STREAM_ADAPTER); } if (hasWeb) { request.getResolvedDependencies().add(WEB_ADAPTER); } }
Source:
private TypeCompatibility typeCompatibilityForRow(RowType firstType, RowType secondType) { List<Field> firstFields = firstType.getFields(); List<Field> secondFields = secondType.getFields(); if (firstFields.size() != secondFields.size()) { return TypeCompatibility.incompatible(); } ImmutableList.Builder<RowType.Field> fields = ImmutableList.builder(); boolean firstCanCoerceToSecond = true; for (int i = 0; i < firstFields.size(); i++) { Type firstFieldType = firstFields.get(i).getType(); Type secondFieldType = secondFields.get(i).getType(); TypeCompatibility typeCompatibility = compatibility(firstFieldType, secondFieldType); if (!typeCompatibility.isCompatible()) { return TypeCompatibility.incompatible(); } Type commonParameterType = typeCompatibility.getCommonSuperType(); Optional<String> firstParameterName = firstFields.get(i).getName(); Optional<String> secondParameterName = secondFields.get(i).getName(); Optional<String> commonName = firstParameterName.equals(secondParameterName) ? firstParameterName : Optional.empty(); firstCanCoerceToSecond &= typeCompatibility.isFirstCanCoerceToSecond(); fields.add(new RowType.Field(commonName, commonParameterType)); } return TypeCompatibility.explicit(RowType.from(fields.build()), firstCanCoerceToSecond); }

Target:
private TypeCompatibility typeCompatibilityForRow(RowType firstType, RowType secondType) { List<Field> firstFields = firstType.getFields(); List<Field> secondFields = secondType.getFields(); if (firstFields.size() != secondFields.size()) { return TypeCompatibility.incompatible(); } ImmutableList.Builder<RowType.Field> fields = ImmutableList.builder(); boolean coercible = true; for (int i = 0; i < firstFields.size(); i++) { Type firstFieldType = firstFields.get(i).getType(); Type secondFieldType = secondFields.get(i).getType(); TypeCompatibility typeCompatibility = compatibility(firstFieldType, secondFieldType); if (!typeCompatibility.isCompatible()) { return TypeCompatibility.incompatible(); } Type commonParameterType = typeCompatibility.getCommonSuperType(); Optional<String> firstParameterName = firstFields.get(i).getName(); Optional<String> secondParameterName = secondFields.get(i).getName(); Optional<String> commonName = firstParameterName.equals(secondParameterName) ? firstParameterName : Optional.empty(); coercible &= typeCompatibility.isCoercible(); fields.add(new RowType.Field(commonName, commonParameterType)); } return TypeCompatibility.compatible(RowType.from(fields.build()), coercible); }
Source:
private Map<String, String> getJps() throws IOException { Map<String, String> procs = new HashMap<>(); String[] jpsCommand = new String[]{"jps"}; CommandReturn cr = ShellUtils.execCommandWithOutput(jpsCommand); if (cr.getExitCode() != 0) { LOG.warn(cr.getFormattedOutput()); return procs; } LOG.info("JPS succeeded"); int idx = 0; for (String row : cr.getOutput().split("\n")) { String[] parts = row.split(" "); if (parts.length == 0) { LOG.error(String.format("Failed to parse row %s", row)); continue; } else if (parts.length == 1) { LOG.info(String.format("Row %s has no process name", row)); procs.put(parts[0], "unknown" + idx); idx++; } else { LOG.info(String.format("Found JVM %s %s", parts[0], parts[1])); procs.put(parts[0], parts[1]); } } return procs; }

Target:
private Map<String, String> getJps() throws IOException { Map<String, String> procs = new HashMap<>(); ShellCommand sudoJpsCommand = new ShellCommand(new String[]{"sudo", "jps"}); ShellCommand jpsCommand = new ShellCommand(new String[]{"jps"}); CommandReturn cr = ShellUtils.execCmdWithBackup(sudoJpsCommand, jpsCommand); if (cr.getExitCode() != 0) { LOG.warn(cr.getFormattedOutput()); return procs; } LOG.info("JPS succeeded"); int idx = 0; for (String row : cr.getOutput().split("\n")) { String[] parts = row.split(" "); if (parts.length == 0) { LOG.error(String.format("Failed to parse row %s", row)); continue; } else if (parts.length == 1) { LOG.info(String.format("Row %s has no process name", row)); procs.put(parts[0], "unknown" + idx); idx++; } else { LOG.info(String.format("Found JVM %s %s", parts[0], parts[1])); procs.put(parts[0], parts[1]); } } return procs; }
Source:
private SoapSigningHelper signingHelper() { return Environment.getInstance().getSoapSigningHelper(); }

Target:
protected SoapSigningHelper signingHelper() { return getEnvironment().getSoapSigningHelper(); }
Source:
public void registerRcsAvailabilityCallback(IImsCapabilityCallback callback) throws ImsException { try { mRcsFeatureConnection.addCapabilityCallback(callback); } catch (RemoteException e) { loge("registerRcsAvailabilityCallback: ", e); throw new ImsException( "register capability callback", e, ImsReasonInfo.CODE_LOCAL_INTERNAL_ERROR); } }

Target:
public void registerRcsAvailabilityCallback(IImsCapabilityCallback callback) throws ImsException { try { int subId = sSubscriptionManagerProxy.getSubId(mSlotId); mCapabilityCallbackManager.addCallbackForSubscription(callback, subId); } catch (IllegalStateException e) { loge("registerRcsAvailabilityCallback: ", e); throw new ImsException( "register capability callback", e, ImsReasonInfo.CODE_LOCAL_INTERNAL_ERROR); } }
Source:
public SearchHelper executeQuery() { SuggesterServiceImpl.getInstance().onSearch(projects, query); if (redirect != null || errorMsg != null) { return this; } try { TopFieldDocs fdocs = searcher.search(query, start + maxItems, sort); totalHits = fdocs.totalHits; hits = fdocs.scoreDocs; boolean isSingleDefinitionSearch = (query instanceof TermQuery) && (builder.getDefs() != null); boolean uniqueDefinition = false; if (isSingleDefinitionSearch && hits != null && hits.length == 1) { Document doc = searcher.doc(hits[0].doc); if (doc.getField(QueryBuilder.TAGS) != null) { byte[] rawTags = doc.getField(QueryBuilder.TAGS).binaryValue().bytes; Definitions tags = Definitions.deserialize(rawTags); String symbol = ((TermQuery) query).getTerm().text(); if (tags.occurrences(symbol) == 1) { uniqueDefinition = true; } } } if (uniqueDefinition && hits != null && hits.length > 0 && isCrossRefSearch) { redirect = contextPath + Prefix.XREF_P + Util.URIEncodePath(searcher.doc(hits[0].doc).get(QueryBuilder.PATH)) + '#' + Util.URIEncode(((TermQuery) query).getTerm().text()); } } catch (BooleanQuery.TooManyClauses e) { errorMsg = "Too many results for wildcard!"; } catch (IOException | ClassNotFoundException e) { errorMsg = e.getMessage(); } return this; }

Target:
public SearchHelper executeQuery() { SuggesterServiceFactory.getDefault().onSearch(projects, query); if (redirect != null || errorMsg != null) { return this; } try { TopFieldDocs fdocs = searcher.search(query, start + maxItems, sort); totalHits = fdocs.totalHits; hits = fdocs.scoreDocs; boolean isSingleDefinitionSearch = (query instanceof TermQuery) && (builder.getDefs() != null); boolean uniqueDefinition = false; if (isSingleDefinitionSearch && hits != null && hits.length == 1) { Document doc = searcher.doc(hits[0].doc); if (doc.getField(QueryBuilder.TAGS) != null) { byte[] rawTags = doc.getField(QueryBuilder.TAGS).binaryValue().bytes; Definitions tags = Definitions.deserialize(rawTags); String symbol = ((TermQuery) query).getTerm().text(); if (tags.occurrences(symbol) == 1) { uniqueDefinition = true; } } } if (uniqueDefinition && hits != null && hits.length > 0 && isCrossRefSearch) { redirect = contextPath + Prefix.XREF_P + Util.URIEncodePath(searcher.doc(hits[0].doc).get(QueryBuilder.PATH)) + '#' + Util.URIEncode(((TermQuery) query).getTerm().text()); } } catch (BooleanQuery.TooManyClauses e) { errorMsg = "Too many results for wildcard!"; } catch (IOException | ClassNotFoundException e) { errorMsg = e.getMessage(); } return this; }
Source:
private void loadData(boolean isResponseOk, Search response) { if (isResponseOk) { mCountProducts = Integer.parseInt(response.getCount()); if (pageAddress == 1) { countProductsView.setText(getResources().getString(R.string.number_of_products)+ " " + NumberFormat.getInstance(getResources().getConfiguration().locale).format(Long.parseLong(response.getCount() ))); mProducts = new ArrayList<>(); mProducts.addAll(response.getProducts()); if (mProducts.size() < mCountProducts) { mProducts.add(null); } setUpRecyclerView(); } else { if (mProducts.size() - 1 < mCountProducts + 1) { final int posStart = mProducts.size(); mProducts.remove(mProducts.size() - 1); mProducts.addAll(response.getProducts()); if (mProducts.size() < mCountProducts) { mProducts.add(null); } productsRecyclerView.getAdapter().notifyItemRangeChanged(posStart - 1, mProducts.size() - 1); } } } else { progressBar.setVisibility(View.INVISIBLE); offlineCloudLayout.setVisibility(View.VISIBLE); } }

Target:
private void loadData(boolean isResponseOk, Search response) { if (isResponseOk) { mCountProducts = Integer.parseInt(response.getCount()); if (pageAddress == 1) { countProductsView.setText(getResources().getString(R.string.number_of_results) + " " + NumberFormat.getInstance(getResources().getConfiguration().locale).format(Long.parseLong(response.getCount()))); mProducts = new ArrayList<>(); mProducts.addAll(response.getProducts()); if (mProducts.size() < mCountProducts) { mProducts.add(null); } if (setupDone) { productsRecyclerView.setAdapter(new ProductsRecyclerViewAdapter(mProducts)); } setUpRecyclerView(); } else { if (mProducts.size() - 1 < mCountProducts + 1) { final int posStart = mProducts.size(); mProducts.remove(mProducts.size() - 1); mProducts.addAll(response.getProducts()); if (mProducts.size() < mCountProducts) { mProducts.add(null); } productsRecyclerView.getAdapter().notifyItemRangeChanged(posStart - 1, mProducts.size() - 1); } } } else { swipeRefreshLayout.setRefreshing(false); productsRecyclerView.setVisibility(View.INVISIBLE); progressBar.setVisibility(View.INVISIBLE); offlineCloudLayout.setVisibility(View.VISIBLE); } }
Source:
public void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, ConsumerGroupMetadata groupMetadata) throws ProducerFencedException, IllegalGenerationException, UnknownMemberIdException, FencedInstanceIdException { sendOffsetsToTransaction(offsets, groupMetadata.groupId()); }

Target:
public void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, ConsumerGroupMetadata groupMetadata) throws ProducerFencedException { Objects.requireNonNull(groupMetadata); sendOffsetsToTransaction(offsets, groupMetadata.groupId()); }
Source:
public <T> T get(Class<T> serviceType) { ArgChecker.notNull(serviceType, "serviceType"); final T service = services.getInstance(serviceType); if (service == null) { throw new IllegalArgumentException("No service found: " + serviceType); } return service; }

Target:
public <T> T get(Class<T> serviceType) { ArgChecker.notNull(serviceType, "serviceType"); T service = services.getInstance(serviceType); if (service == null) { throw new IllegalArgumentException("No service found: " + serviceType); } return service; }
Source:
void testDeployAndResolveArtifact(@TestRepository(layout = RawLayoutProvider.ALIAS, storageId = STORAGE, repositoryId = REPOSITORY) Repository repository, @TestArtifact(resource = "foo/bar.zip", generator = NullArtifactGenerator.class) Path artifactPath) throws Exception { String path = "foo/bar.zip"; RepositoryPath artifactRepositoryPath = repositoryPathResolver.resolve(repository, path); artifactManagementService.validateAndStore(artifactRepositoryPath, createZipFile()); assertTrue(Files.exists(artifactRepositoryPath), "Failed to deploy artifact!"); assertTrue(Files.size(artifactRepositoryPath) > 0, "Failed to deploy artifact!"); try { artifactManagementService.validateAndStore(artifactRepositoryPath, createZipFile()); } catch (Exception e) { if (e.getMessage().contains("repository does not allow artifact re-deployment")) { logger.info("Successfully declined to re-deploy {}!", artifactRepositoryPath); } else { throw e; } } try (InputStream is = artifactResolutionService.getInputStream(artifactRepositoryPath)) { int total = 0; int len; final int size = 4096; byte[] bytes = new byte[size]; while ((len = is.read(bytes, 0, size)) != -1) { total += len; } assertTrue(total > 0, "Failed to resolve artifact!"); } }

Target:
void testDeployAndResolveArtifact(@TestRepository(layout = RawLayoutProvider.ALIAS, storageId = STORAGE, repositoryId = REPOSITORY) Repository repository, @TestArtifact(resource = "foo/bar.zip", generator = NullArtifactGenerator.class) Path artifactPath) throws Exception { String path = "foo/bar.zip"; RepositoryPath artifactRepositoryPath = repositoryPathResolver.resolve(repository, path); artifactManagementService.validateAndStore(artifactRepositoryPath, Files.newInputStream(artifactPath)); assertTrue(Files.exists(artifactRepositoryPath), "Failed to deploy artifact!"); assertTrue(Files.size(artifactRepositoryPath) > 0, "Failed to deploy artifact!"); try { artifactManagementService.validateAndStore(artifactRepositoryPath, Files.newInputStream(artifactPath)); } catch (Exception e) { if (e.getMessage().contains("repository does not allow artifact re-deployment")) { logger.debug("Successfully declined to re-deploy {}!", artifactRepositoryPath); } else { throw e; } } try (InputStream is = artifactResolutionService.getInputStream(artifactRepositoryPath)) { int total = 0; int len; final int size = 4096; byte[] bytes = new byte[size]; while ((len = is.read(bytes, 0, size)) != -1) { total += len; } assertTrue(total > 0, "Failed to resolve artifact!"); } }
Source:
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { if (sourceViewer == null) { return null; } Map<?, ?> targets = getHyperlinkDetectorTargets(sourceViewer); HyperlinkDetectorRegistry hlDetectorRegistry = EditorsUI.getHyperlinkDetectorRegistry(); HyperlinkDetectorDescriptor[] hlDetectorDescriptor = hlDetectorRegistry.getHyperlinkDetectorDescriptors(); List<IHyperlinkDetector> tempHDList = new ArrayList<IHyperlinkDetector>(); for (Map.Entry<?, ?> entry : targets.entrySet()) { for (HyperlinkDetectorDescriptor hdd : hlDetectorDescriptor) { try { AbstractHyperlinkDetector ahld = hdd.createHyperlinkDetector(); if (hdd.getTargetId().equals(entry.getKey()) && !(ahld instanceof URLHyperlinkDetector)) { ahld.setContext((IAdaptable)entry.getValue()); tempHDList.add(ahld); } } catch (CoreException e) { SpecfileLog.logError(e); } } } if (!tempHDList.isEmpty()) { IHyperlinkDetector[] rc = new IHyperlinkDetector[tempHDList.size()]; rc = tempHDList.toArray(rc); return rc; } else { return null; } }

Target:
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { if (sourceViewer == null) { return null; } Map<?, ?> targets = getHyperlinkDetectorTargets(sourceViewer); HyperlinkDetectorRegistry hlDetectorRegistry = EditorsUI.getHyperlinkDetectorRegistry(); HyperlinkDetectorDescriptor[] hlDetectorDescriptor = hlDetectorRegistry.getHyperlinkDetectorDescriptors(); List<IHyperlinkDetector> tempHDList = new ArrayList<IHyperlinkDetector>(); for (Map.Entry<?, ?> entry : targets.entrySet()) { for (HyperlinkDetectorDescriptor hdd : hlDetectorDescriptor) { try { AbstractHyperlinkDetector ahld = hdd.createHyperlinkDetector(); if (hdd.getTargetId().equals(entry.getKey()) && (!(ahld instanceof URLHyperlinkDetector) || (ahld instanceof URLHyperlinkDetector && ahld instanceof URLHyperlinkWithMacroDetector))) { ahld.setContext((IAdaptable)entry.getValue()); tempHDList.add(ahld); } } catch (CoreException e) { SpecfileLog.logError(e); } } } if (!tempHDList.isEmpty()) { IHyperlinkDetector[] rc = new IHyperlinkDetector[tempHDList.size()]; rc = tempHDList.toArray(rc); return rc; } else { return null; } }
Source:
public boolean validate() { if (!getShouldSetDnsConfiguration().getEntity()) { getShouldSetDnsConfiguration().setIsValid(true); setIsValid(true); return true; } Collection<NameServerModel> items = this.nameServerModelListModel.getItems(); int numberOfAddresses = items.size(); boolean atLeastOneAddress = numberOfAddresses > 0; boolean exceedingNumberOfAddresses = numberOfAddresses > BusinessEntitiesDefinitions.MAX_SUPPORTED_DNS_CONFIGURATIONS; boolean isValid = atLeastOneAddress && !exceedingNumberOfAddresses && validateNameserverAddresses(items); getShouldSetDnsConfiguration().setIsValid(atLeastOneAddress); setIsValid(isValid); return isValid; }

Target:
public boolean validate() { if (!getShouldSetDnsConfiguration().getEntity()) { setShouldSetDnsConfigurationValidity(true); setIsValid(true); return true; } Collection<NameServerModel> items = this.nameServerModelListModel.getItems(); int numberOfAddresses = items.size(); boolean atLeastOneAddress = numberOfAddresses > 0; boolean exceedingNumberOfAddresses = numberOfAddresses > BusinessEntitiesDefinitions.MAX_SUPPORTED_DNS_CONFIGURATIONS; boolean isValid = atLeastOneAddress && !exceedingNumberOfAddresses && validateNameserverAddresses(items); setShouldSetDnsConfigurationValidity(atLeastOneAddress); setIsValid(isValid); return isValid; }
Source:
private void processReportDetailed(SensorContext context, Collection<TestSuite> parsedReports) { Map<InputFile, TestResult> locatedResources = lookupResources(parsedReports); for (Map.Entry<InputFile, TestResult> entry : locatedResources.entrySet()) { InputFile inputFile = entry.getKey(); TestResult fileTestResult = entry.getValue(); LOG.debug("Saving test execution measures for '{}'", inputFile.toString()); saveMeasure(context, inputFile, CoreMetrics.SKIPPED_TESTS, fileTestResult.getSkipped()); saveMeasure(context, inputFile, CoreMetrics.TESTS, fileTestResult.getTests() - fileTestResult.getSkipped()); saveMeasure(context, inputFile, CoreMetrics.TEST_ERRORS, fileTestResult.getErrors()); saveMeasure(context, inputFile, CoreMetrics.TEST_FAILURES, fileTestResult.getFailures()); saveMeasure(context, inputFile, CoreMetrics.TEST_EXECUTION_TIME, fileTestResult.getTime()); } }

Target:
private void processReportDetailed(SensorContext context, Collection<TestSuite> parsedReports) { Map<InputFile, TestResult> locatedResources = lookupResources(parsedReports); for (Map.Entry<InputFile, TestResult> entry : locatedResources.entrySet()) { InputFile inputFile = entry.getKey(); TestResult fileTestResult = entry.getValue(); LOG.debug("Saving test execution measures for '{}'", inputFile.toString()); saveMeasure(context, inputFile, CoreMetrics.SKIPPED_TESTS, fileTestResult.getSkipped()); saveMeasure(context, inputFile, CoreMetrics.TESTS, fileTestResult.getExecutedTests()); saveMeasure(context, inputFile, CoreMetrics.TEST_ERRORS, fileTestResult.getErrors()); saveMeasure(context, inputFile, CoreMetrics.TEST_FAILURES, fileTestResult.getFailures()); saveMeasure(context, inputFile, CoreMetrics.TEST_EXECUTION_TIME, fileTestResult.getTime()); } }
Source:
private boolean executeDumper(String dumperPath, String inputFilePath, String inputFilePrefix, String outputDir){ final String outputFileFullPath = outputDir + File.separator + inputFilePrefix + ".txt"; final String errFileFullPath = outputDir + File.separator + inputFilePrefix + ".err"; logger.log(Level.INFO, "Writing ESEDatabaseViewer results to: {0}", outputDir); List<String> commandLine = new ArrayList<>(); commandLine.add(dumperPath); commandLine.add("/table"); commandLine.add(inputFilePath); commandLine.add("*"); commandLine.add("/scomma"); commandLine.add(outputDir + "\\" + inputFilePrefix + "_*.csv"); ProcessBuilder processBuilder = new ProcessBuilder(commandLine); processBuilder.redirectOutput(new File(outputFileFullPath)); processBuilder.redirectError(new File(errFileFullPath)); try{ ExecUtil.execute(processBuilder, new DataSourceIngestModuleProcessTerminator(context)); }catch(IOException ex){ logger.log(Level.SEVERE, "Unable to execute ESEDatabaseView to process Edge file." , ex); return false; } return true; }

Target:
private void executeDumper(String dumperPath, String inputFilePath, String inputFilePrefix, String outputDir) throws IOException { final String outputFileFullPath = outputDir + File.separator + inputFilePrefix + ".txt"; final String errFileFullPath = outputDir + File.separator + inputFilePrefix + ".err"; logger.log(Level.INFO, "Writing ESEDatabaseViewer results to: {0}", outputDir); List<String> commandLine = new ArrayList<>(); commandLine.add(dumperPath); commandLine.add("/table"); commandLine.add(inputFilePath); commandLine.add("*"); commandLine.add("/scomma"); commandLine.add(outputDir + "\\" + inputFilePrefix + "_*.csv"); ProcessBuilder processBuilder = new ProcessBuilder(commandLine); processBuilder.redirectOutput(new File(outputFileFullPath)); processBuilder.redirectError(new File(errFileFullPath)); ExecUtil.execute(processBuilder, new DataSourceIngestModuleProcessTerminator(context)); }
Source:
public static final MavenExecutionResult tryAndExec(Path directory, String[] mavenArgs) { log.info("Defaultin to MavenInvocator"); return new MavenInvokatorMavenTaskRunner().exec(directory, mavenArgs); }

Target:
public static final MavenExecutionResult tryAndExec(Path directory, String[] mavenArgs) { log.info("Defaulting to MavenInvokator"); return new MavenInvokatorMavenTaskRunner().exec(directory, mavenArgs); }
Source:
protected Set<String> listObjects() { Set<String> digests = new HashSet<>(); try { binaryManager.storage.list(binaryManager.bucketName).iterateAll().forEach(blob -> { if (blob != null) { digests.add(blob.getName()); } }); return digests; } catch (StorageException e) { if (e.getMessage().equals("Not Found")) return digests; throw new NuxeoException(e); } }

Target:
protected Set<String> listObjects() { Set<String> digests = new HashSet<>(); try { binaryManager.storage.list(binaryManager.bucketName).iterateAll().forEach(blob -> { if (blob != null) { digests.add(binaryManager.bucketPrefix + blob.getName()); } }); return digests; } catch (StorageException e) { if (e.getMessage().equals("Not Found")) { return digests; } throw new NuxeoException(e); } }
Source:
public void canUntangleHighlyConflictingPutUnlessExists() { TransactionTables.createTables(keyValueService); TransactionTables.truncateTables(keyValueService); TransactionService transactionService = WriteBatchingTransactionService.create( SimpleTransactionService.createV2(keyValueService)); ExecutorService executorService = Executors.newCachedThreadPool(); List<Future<?>> futures = LongStream.range(0, 100) .mapToObj(unused -> executorService.submit(() -> { try { transactionService.putUnlessExists(unused, unused + 1); transactionService.putUnlessExists(unused + 1, unused + 3); transactionService.putUnlessExists(unused - 1, unused + 5); } catch (KeyAlreadyExistsException ex) { } })) .collect(Collectors.toList()); futures.forEach(Futures::getUnchecked); }

Target:
public void canUntangleHighlyConflictingPutUnlessExists() { TransactionTables.createTables(keyValueService); TransactionTables.truncateTables(keyValueService); SimpleTransactionService v2TransactionService = SimpleTransactionService.createV2(keyValueService); TransactionService transactionService = WriteBatchingTransactionService.create(v2TransactionService); ExecutorService executorService = Executors.newCachedThreadPool(); int numTransactionPutters = 100; List<Future<?>> futures = LongStream.range(1, numTransactionPutters) .mapToObj(timestamp -> executorService.submit(() -> { tryPutTimestampPermittingExceptions(transactionService, timestamp); tryPutTimestampPermittingExceptions(transactionService, timestamp + 1); })) .collect(Collectors.toList()); futures.forEach(Futures::getUnchecked); }
Source:
public ConfigDiff buildConfigDiff(PluginTask task, Schema schema, int taskCount, List<TaskReport> taskReports) { ConfigDiff configDiff = super.buildConfigDiff(task, schema, taskCount, taskReports); if (task.getQueryBy().isPresent() && task.getQueryBy().get() == QueryBy.DATE_RANGE && task.getIncremental()) { OffsetDateTime earliest = task.getEarliestUpdatedAt().isPresent() ? task.getEarliestUpdatedAt().get().toInstant().atOffset(ZoneOffset.UTC) : OffsetDateTime.now(ZoneOffset.UTC); OffsetDateTime latest = task.getLatestUpdatedAt().isPresent() ? task.getLatestUpdatedAt().get().toInstant().atOffset(ZoneOffset.UTC) : OffsetDateTime.now(ZoneOffset.UTC); Duration d = Duration.between(earliest, latest); OffsetDateTime nextEarliestUpdatedAt = latest.plusSeconds(1); configDiff.set("earliest_updated_at", nextEarliestUpdatedAt.format(DATE_FORMATTER)); configDiff.set("report_duration", task.getReportDuration().or(d.toMillis())); } return configDiff; }

Target:
public ConfigDiff buildConfigDiff(PluginTask task, Schema schema, int taskCount, List<TaskReport> taskReports) { ConfigDiff configDiff = super.buildConfigDiff(task, schema, taskCount, taskReports); if (task.getQueryBy().isPresent() && task.getQueryBy().get() == QueryBy.DATE_RANGE && task.getIncremental()) { OffsetDateTime earliest = task.getEarliestUpdatedAt().isPresent() ? OffsetDateTime.ofInstant(task.getEarliestUpdatedAt().get().toInstant(), ZoneOffset.UTC) : OffsetDateTime.now(ZoneOffset.UTC); OffsetDateTime latest = task.getLatestUpdatedAt().isPresent() ? OffsetDateTime.ofInstant(task.getLatestUpdatedAt().get().toInstant(), ZoneOffset.UTC) : OffsetDateTime.now(ZoneOffset.UTC); Duration d = Duration.between(earliest, latest); OffsetDateTime nextEarliestUpdatedAt = latest.plusSeconds(1); configDiff.set("earliest_updated_at", nextEarliestUpdatedAt.format(DATE_FORMATTER)); configDiff.set("report_duration", task.getReportDuration().or(d.toMillis())); } return configDiff; }
Source:
public void testCreateDTD() { factory.createDTD("foo"); Assert.fail("executed without expected exception"); }

Target:
public void testCreateDTD() { factory.createDTD("foo"); }
Source:
public void invitesUserByEmail() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:1"; final User user = base.user(new URN(urn)); user.aliases().add("jeff"); final Alias alias = user.aliases().iterate().iterator().next(); final Bout bout = alias.inbox().bout(alias.inbox().start()); bout.messages().post("Before invite by email."); bout.friends().invite(alias.name()); try { new TkInvite(base).act( new RqWithHeader( new RqWithAuth( urn, new RqFake( RqMethod.POST, String.format( "/b/%d/invite", bout.number() ), "name=foo@bar.com" ) ), "X-Netbout-Bout", Long.toString(bout.number()) ) ); } catch (final RsForward ex) { MatcherAssert.assertThat( ex.getLocalizedMessage(), Matchers.containsString("foo-bar-com") ); } }

Target:
public void invitesUserByEmail() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:1"; final User user = base.user(new URN(urn)); user.aliases().add("jeff"); final Alias alias = user.aliases().iterate().iterator().next(); final Bout bout = alias.inbox().bout(alias.inbox().start()); bout.messages().post("Before invite by email."); bout.friends().invite(alias.name()); try { new TkInvite(base).act( new RqWithHeader( new RqWithAuth( urn, new RqFake( RqMethod.POST, String.format( "/b/%d/invite", bout.number() ), "name=foo@bar.airforce" ) ), "X-Netbout-Bout", Long.toString(bout.number()) ) ); } catch (final RsForward ex) { MatcherAssert.assertThat( ex.getLocalizedMessage(), Matchers.containsString("foo-bar-airforce") ); throw ex; } }
Source:
public SinglePhaseSubTask newSubTaskWithBackwardCompatibleType(int numAttempts) { return new SinglePhaseSubTask( null, getGroupId(), null, getSupervisorTaskId(), numAttempts, getIngestionSpec(), getContext(), null, null, new DummyForInjectionAppenderatorsManager() ) { @Override public String getType() { return SinglePhaseSubTask.OLD_TYPE_NAME; } }; }

Target:
public SinglePhaseSubTask newSubTaskWithBackwardCompatibleType(int numAttempts) { return new LegacySinglePhaseSubTask( null, getGroupId(), null, getSupervisorTaskId(), numAttempts, getIngestionSpec(), getContext(), null, null, new DummyForInjectionAppenderatorsManager() ); }
Source:
public void testSameEncryption() { String firstEncrypt = "123456:654321"; String secondEncrypt = "123456:654322"; try { String firstEncrypted = EncryptUtility.encrypt(firstEncrypt); String secondEncrypted = EncryptUtility.encrypt(secondEncrypt); if (firstEncrypted.equals(secondEncrypted)) { fail("should be different"); } } catch (Exception ex) { fail("no exceptions"); } }

Target:
public void testSameEncryption() throws Exception { String firstEncrypt = "123456:654321"; String secondEncrypt = "123456:654322"; String firstEncrypted = EncryptUtility.encrypt(firstEncrypt, SECRET); String secondEncrypted = EncryptUtility.encrypt(secondEncrypt, SECRET); assertTrue(!firstEncrypted.equals(secondEncrypted)); }
Source:
public void onBlockBreak(BlockBreakEvent e) { ItemStack item = e.getPlayer().getInventory().getItemInMainHand(); List<ItemStack> drops = new ArrayList<>(e.getBlock().getDrops(item)); int fortune = 1; Random random = ThreadLocalRandom.current(); if (item.getType() != Material.AIR && item.getAmount() > 0) { if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS) && !item.getEnchantments().containsKey(Enchantment.SILK_TOUCH)) { fortune = random.nextInt(item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) + 2) - 1; if (fortune <= 0) fortune = 1; fortune = (e.getBlock().getType() == Material.LAPIS_ORE ? 4 + random.nextInt(5) : 1) * (fortune + 1); } if (!item.getEnchantments().containsKey(Enchantment.SILK_TOUCH) && MaterialCollections.getAllOres().contains(e.getBlock().getType()) && Talisman.checkFor(e, (SlimefunItemStack) SlimefunItems.TALISMAN_MINER)) { for (ItemStack drop : drops) { if (!drop.getType().isBlock()) { int amount = (fortune * 2) - drop.getAmount() == 0 ? 1 : (fortune * 2) - drop.getAmount(); e.getPlayer().getInventory().addItem(new CustomItem(drop, amount)); } } } } }

Target:
public void onBlockBreak(BlockBreakEvent e) { ItemStack item = e.getPlayer().getInventory().getItemInMainHand(); List<ItemStack> drops = new ArrayList<>(e.getBlock().getDrops(item)); int fortune = 1; Random random = ThreadLocalRandom.current(); if (item.getType() != Material.AIR && item.getAmount() > 0) { if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS) && !item.getEnchantments().containsKey(Enchantment.SILK_TOUCH)) { fortune = random.nextInt(item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) + 2) - 1; if (fortune <= 0) fortune = 1; fortune = (e.getBlock().getType() == Material.LAPIS_ORE ? 4 + random.nextInt(5) : 1) * (fortune + 1); } if (!item.getEnchantments().containsKey(Enchantment.SILK_TOUCH) && MaterialCollections.getAllOres().contains(e.getBlock().getType()) && Talisman.checkFor(e, (SlimefunItemStack) SlimefunItems.TALISMAN_MINER)) { for (ItemStack drop : drops) { if (!drop.getType().isBlock()) { int amount = Math.max(1, (fortune * 2) - drop.getAmount()); e.getBlock().getWorld().dropItemNaturally(e.getBlock().getLocation(), new CustomItem(drop, amount)); } } } } }
Source:
public void testDeleteParentWithNonEmptyContainerInside() { this.tested = new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), graphHolderContainer.graph, graphHolderContainer.parentNode); tested.run(callback); verify(callback, times(1)).deleteConnector(eq(graphHolderContainer.edge2)); verify(callback, times(1)).removeChild(eq(graphHolderContainer.containerNode), eq(graphHolderContainer.endNode)); verify(callback, times(1)).deleteNode(eq(graphHolderContainer.endNode)); verify(callback, times(1)).deleteConnector(eq(graphHolderContainer.edge1)); verify(callback, times(1)).deleteConnector(eq(graphHolderContainer.edge2)); verify(callback, times(1)).removeChild(eq(graphHolderContainer.containerNode), eq(graphHolderContainer.intermNode)); verify(callback, times(1)).deleteNode(eq(graphHolderContainer.intermNode)); verify(callback, times(1)).deleteConnector(eq(graphHolderContainer.edge1)); verify(callback, times(1)).removeChild(eq(graphHolderContainer.containerNode), eq(graphHolderContainer.startNode)); verify(callback, times(1)).deleteNode(eq(graphHolderContainer.startNode)); verify(callback, times(1)).deleteNode(eq(graphHolderContainer.containerNode)); verify(callback, times(1)).deleteCandidateNode(eq(graphHolderContainer.parentNode)); }

Target:
public void testDeleteParentWithNonEmptyContainerInside() { this.tested = new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), graphHolderContainer.graph, graphHolderContainer.parentNode); tested.run(callback); InOrder inOrder = inOrder(callback); inOrder.verify(callback, times(1)).deleteConnector(eq(graphHolderContainer.edge2)); inOrder.verify(callback, times(1)).removeChild(eq(graphHolderContainer.containerNode), eq(graphHolderContainer.endNode)); inOrder.verify(callback, times(1)).deleteNode(eq(graphHolderContainer.endNode)); inOrder.verify(callback, times(1)).deleteConnector(eq(graphHolderContainer.edge1)); inOrder.verify(callback, times(1)).removeChild(eq(graphHolderContainer.containerNode), eq(graphHolderContainer.intermNode)); inOrder.verify(callback, times(1)).deleteNode(eq(graphHolderContainer.intermNode)); inOrder.verify(callback, times(1)).removeChild(eq(graphHolderContainer.containerNode), eq(graphHolderContainer.startNode)); inOrder.verify(callback, times(1)).deleteNode(eq(graphHolderContainer.startNode)); inOrder.verify(callback, times(1)).deleteNode(eq(graphHolderContainer.containerNode)); inOrder.verify(callback, times(1)).deleteCandidateNode(eq(graphHolderContainer.parentNode)); }
Source:
public static void setUp() throws IOException { String[] files = {"network.dat", "osm.mapdb", "osm.mapdb.p"}; String tempDirPath = createTempDirWithFiles("pointServer", files); String[] args = {"--graphs", tempDirPath}; PointToPointRouterServer.main(args); }

Target:
public static void setUp() throws IOException { String[] files = {"osm.pbf", "terre-haute-gtfs.zip"}; String tempDirPath = createTempDirWithFiles("pointServer", files); String[] buildArgs = {"--build", tempDirPath}; PointToPointRouterServer.main(buildArgs); String[] runArgs = {"--graphs", tempDirPath}; PointToPointRouterServer.main(runArgs); }
Source:
public void spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled_shouldFailForNotCompletingPublisher() throws Throwable { requireTestFailure(new ThrowingRunnable() { @Override public void run() throws Throwable { demandIgnoringSynchronousPublisherVerification().spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled(); } }, "Expected end-of-stream but got"); }

Target:
public void spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled_shouldFailForNotCompletingPublisher() throws Throwable { requireTestFailure(new ThrowingRunnable() { @Override public void run() throws Throwable { demandIgnoringSynchronousPublisherVerification().spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled(); } }, "Expected end-of-stream but got element [" ); }