auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>@Override public StaticInjection getStaticInjection(Class<?> injectedClass) { try { StaticInjection result = GeneratedAdapters.initStaticInjection(injectedClass); if (result == null) { result = ReflectiveStaticInjection.create(injectedClass); } return result; } catch (RuntimeException e) { <START> logNotFound("Static injection", injectedClass.getName(), e); <END> throw e; } }</code><technical_language>again</technical_language>

Target:
@Override public StaticInjection getStaticInjection(Class<?> injectedClass) { StaticInjection result = GeneratedAdapters.initStaticInjection(injectedClass); if (result == null) { result = ReflectiveStaticInjection.create(injectedClass); } return result; }
Source:
<code>public void testValidResources() { <START> cleanUp(); <END> final Resource[] resources = new Resource[]{new ClassPathResource(validName1)}; NeverFailAutoDeploymentStrategy deploymentStrategy = new NeverFailAutoDeploymentStrategy(); deploymentStrategy.deployResources(nameHint, resources, repositoryService); assertEquals(1, repositoryService.createDeploymentQuery().count()); cleanUp(); }</code><technical_language>@daisuke-yoshimoto @Before @After annotations setUp() tearDown() public method reduce boilerplate code in tests for cleanup. enough rename cleanUp() tearDown() annotate @After</technical_language>

Target:
public void testValidResources() { final Resource[] resources = new Resource[]{new ClassPathResource(validName1)}; NeverFailAutoDeploymentStrategy deploymentStrategy = new NeverFailAutoDeploymentStrategy(); deploymentStrategy.deployResources(nameHint, resources, repositoryService); assertEquals(1, repositoryService.createDeploymentQuery().count()); }
Source:
<code>private boolean evaluateDeterministicFilterFunctionWithConstantInputs(FilterFunction function) { int[] inputs = function.getInputChannels(); Block[] blocks = new Block[inputs.length]; for (int i = 0; i < inputs.length; i++) { int columnIndex = filterFunctionInputMapping.get(inputs[i]); Object constantValue = constantValues[columnIndex]; blocks[i] = RunLengthEncodedBlock.create(columnTypes.get(columnIndex), constantValue == NULL_MARKER ? null : constantValue, 1); } int[] positions = new int[] {0}; initializeTmpErrors(1); int positionCount = function.filter(new Page(blocks), positions, 1, tmpErrors); if (tmpErrors[0] != null) { <START> this.constantFilterError = tmpErrors[0]; <END> } return positionCount == 1; }</code><technical_language>remove "this."</technical_language>

Target:
private boolean evaluateDeterministicFilterFunctionWithConstantInputs(FilterFunction function) { int[] inputs = function.getInputChannels(); Block[] blocks = new Block[inputs.length]; for (int i = 0; i < inputs.length; i++) { int columnIndex = filterFunctionInputMapping.get(inputs[i]); Object constantValue = constantValues[columnIndex]; blocks[i] = RunLengthEncodedBlock.create(columnTypes.get(columnIndex), constantValue == NULL_MARKER ? null : constantValue, 1); } initializeTmpErrors(1); int positionCount = function.filter(new Page(blocks), new int[] {0}, 1, tmpErrors); if (tmpErrors[0] != null) { constantFilterError = tmpErrors[0]; } return positionCount == 1; }
Source:
<code>public List<HostInventory> getConnectedHostForOperation(PrimaryStorageInventory pri, int startPage, int pageLimit) { if (pri.getAttachedClusterUuids().isEmpty()) { throw new OperationFailureException(operr("cannot find a Connected host to execute command for nfs primary storage[uuid:%s]", pri.getUuid())); } String sql = "select h from HostVO h " + "where h.state = :state and h.status = :connectionState and h.clusterUuid in (:clusterUuids) " + "and h.uuid not in (select ref.hostUuid from PrimaryStorageHostRefVO ref " + "where ref.primaryStorageUuid = :psUuid and ref.hostUuid = h.uuid and ref.status = :status)"; TypedQuery<HostVO> q = dbf.getEntityManager().createQuery(sql, HostVO.class); q.setParameter("state", HostState.Enabled); q.setParameter("connectionState", HostStatus.Connected); q.setParameter("clusterUuids", pri.getAttachedClusterUuids()); q.setParameter("psUuid", pri.getUuid()); q.setParameter("status", PrimaryStorageHostStatus.Disconnected); q.setFirstResult(startPage * pageLimit); if (pageLimit > 0){ q.setMaxResults(pageLimit); } List<HostVO> ret = q.getResultList(); <START> if (ret.isEmpty() && q.getFirstResult() == 0) { <END> throw new OperationFailureException(operr("cannot find a Connected host-NFS connection to execute command for nfs primary storage[uuid:%s]", pri.getUuid())); } else { Collections.shuffle(ret); return HostInventory.valueOf(ret); } }</code><technical_language>boolean isTheFirstPage = startPage * pageLimit == 0</technical_language>

Target:
public List<HostInventory> getConnectedHostForOperation(PrimaryStorageInventory pri, int startPage, int pageLimit) { if (pri.getAttachedClusterUuids().isEmpty()) { throw new OperationFailureException(operr("cannot find a Connected host to execute command for nfs primary storage[uuid:%s]", pri.getUuid())); } String sql = "select h from HostVO h " + "where h.state = :state and h.status = :connectionState and h.clusterUuid in (:clusterUuids) " + "and h.uuid not in (select ref.hostUuid from PrimaryStorageHostRefVO ref " + "where ref.primaryStorageUuid = :psUuid and ref.hostUuid = h.uuid and ref.status = :status)"; TypedQuery<HostVO> q = dbf.getEntityManager().createQuery(sql, HostVO.class); q.setParameter("state", HostState.Enabled); q.setParameter("connectionState", HostStatus.Connected); q.setParameter("clusterUuids", pri.getAttachedClusterUuids()); q.setParameter("psUuid", pri.getUuid()); q.setParameter("status", PrimaryStorageHostStatus.Disconnected); q.setFirstResult(startPage * pageLimit); if (pageLimit > 0){ q.setMaxResults(pageLimit); } List<HostVO> ret = q.getResultList(); if (ret.isEmpty() && startPage == 0) { throw new OperationFailureException(operr("cannot find a Connected host-NFS connection to execute command for nfs primary storage[uuid:%s]", pri.getUuid())); } else { Collections.shuffle(ret); return HostInventory.valueOf(ret); } }
Source:
<code>private void populateBestMatchingMilestones(String querySentence) { bestMatchingMilestones.clear(); addMatchingMilestones(bestMatchingMilestones, getRemainingBestMatchesToLimit(), getSelectableMilestones(allMilestones)); if (isMilestonesSizeBelowLimit(bestMatchingMilestones, BEST_MATCHING_LIMIT)) { addPartiallyMatchingMilestones(bestMatchingMilestones, getRemainingBestMatchesToLimit(), querySentence, getSelectableMilestones(allMilestones)); } if (isMilestonesSizeBelowLimit(bestMatchingMilestones, BEST_MATCHING_LIMIT)) { addLikelyUnmatchedMilestones(bestMatchingMilestones, getRemainingBestMatchesToLimit(), <START> getSelectableMilestones(allMilestones)); <END> } }</code><technical_language>getSelectableMilestones(allMilestones) done top</technical_language>

Target:
private void populateBestMatchingMilestones(String querySentence) { bestMatchingMilestones.clear(); List<PickerMilestone> selectableMilestones = PickerMilestone.getSelectableMilestones(allMilestones); addMatchingMilestones(bestMatchingMilestones, getRemainingBestMatchesToLimit(), selectableMilestones); if (isMilestonesSizeBelowLimit(bestMatchingMilestones, BEST_MATCHING_LIMIT)) { addPartiallyMatchingMilestones(bestMatchingMilestones, getRemainingBestMatchesToLimit(), querySentence, selectableMilestones); } if (isMilestonesSizeBelowLimit(bestMatchingMilestones, BEST_MATCHING_LIMIT)) { addLikelyUnmatchedMilestones(bestMatchingMilestones, getRemainingBestMatchesToLimit(), selectableMilestones); } }
Source:
<code>ShardRewriter createShardRewriter( FileSystemContext fileSystemContext, FileSystem fileSystem, long transactionId, OptionalInt bucketNumber, UUID shardUuid, int shardRowCount, Optional<UUID> deltaShardUuid, boolean tableSupportsDeltaDelete, Map<String, Type> columns) { if (tableSupportsDeltaDelete) { return new DeltaShardRewriter( shardUuid, shardRowCount, deltaShardUuid, deletionExecutor, <START> uuid -> this.getRowsFromUuid(fileSystem, uuid), <END> (columnIds, columnTypes) -> this.createStoragePageSink( fileSystemContext, transactionId, bucketNumber, columnIds, columnTypes, true)); } else { return new InplaceShardRewriter( fileSystem, transactionId, bucketNumber, shardUuid, columns, deletionExecutor, nodeId, this, storageService, shardRecorder, backupManager); } }</code><technical_language>pass in fileSystemContext, transactionId, DeltaShardRewriter? functions is hard understand interface</technical_language>

Target:
ShardRewriter createShardRewriter( FileSystemContext fileSystemContext, FileSystem fileSystem, long transactionId, OptionalInt bucketNumber, UUID shardUuid, int shardRowCount, Optional<UUID> deltaShardUuid, boolean tableSupportsDeltaDelete, Map<String, Type> columns) { if (tableSupportsDeltaDelete) { return new DeltaShardRewriter( shardUuid, shardRowCount, deltaShardUuid, deletionExecutor, transactionId, bucketNumber, this, fileSystemContext, fileSystem); } return new InplaceShardRewriter( shardUuid, columns, deletionExecutor, transactionId, bucketNumber, nodeId, this, fileSystem, storageService, shardRecorder, backupManager); }
Source:
<code>private Map<String, Pair<NodeTemplate, String>> getOfferingsFromDiscoverer() throws IOException { <START> String idsString = discovererClient.getRequest("discoverer/fetch", Collections.EMPTY_LIST); <END> String[] discoveredIds = discovererClient.getObjectFromJson(idsString, String[].class); Map<String, Pair<NodeTemplate, String>> offerings = new HashMap<>(); for(String offerId:discoveredIds) { ArrayList<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("oid", offerId)); Pair<String, String> discovererResponse = discovererClient.postRequestWithParams("discoverer/fetch", params); if(discovererResponse.first.equals("200")){ String offerStr = discovererResponse.second; Offering offer = discovererClient.getObjectFromJson(offerStr, Offering.class); try { NodeTemplate nt = ToscaSerializer.fromTOSCA(offer.offering).getResult().getTopology().getNodeTemplates().values().iterator().next(); offerings.put(offerId, new Pair<NodeTemplate, String>(nt, offer.offering)); }catch (ParsingException e){ } } } return offerings; }</code><technical_language>Consider injecting discoverClient method</technical_language>

Target:
private Map<String, Pair<NodeTemplate, String>> getOfferingsFromDiscoverer() throws IOException { ObjectMapper mapper = new ObjectMapper(); String idsString = discovererClient.getRequest("fetch", Collections.EMPTY_LIST); String[] discoveredIds = mapper.readValue(idsString, String[].class); Map<String, Pair<NodeTemplate, String>> offerings = new HashMap<>(); for(String offerId:discoveredIds) { ArrayList<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("oid", offerId)); Pair<String, String> discovererResponse = discovererClient.postRequestWithParams("fetch", params); if(discovererResponse.first.equals("200")){ String offerStr = discovererResponse.second; Offering offer = mapper.readValue(offerStr, Offering.class); try { NodeTemplate nt = ToscaSerializer.fromTOSCA(offer.offering).getResult().getTopology().getNodeTemplates().values().iterator().next(); offerings.put(offerId, new Pair<NodeTemplate, String>(nt, offer.offering)); }catch (ParsingException e){ } } } return offerings; }
Source:
<code>public void publish(List<? extends EventMessage<?>> events) { Stream<MessageMonitor.MonitorCallback> ingested = events.stream().map(messageMonitor::onMessageIngested); if (CurrentUnitOfWork.isStarted()) { UnitOfWork<?> unitOfWork = CurrentUnitOfWork.get(); Assert.state(!unitOfWork.phase().isAfter(PREPARE_COMMIT), () -> "It is not allowed to publish events when the current Unit of Work has already been " + "committed. Please start a new Unit of Work before publishing events."); Assert.state(!unitOfWork.root().phase().isAfter(PREPARE_COMMIT), () -> "It is not allowed to publish events when the root Unit of Work has already been " + "committed."); unitOfWork.afterCommit(u -> ingested.forEach(MessageMonitor.MonitorCallback::reportSuccess)); unitOfWork.onRollback( <START> u -> ingested.forEach(m -> m.reportFailure(u.getExecutionResult().getExceptionResult())) <END> ); eventsQueue(unitOfWork).addAll(events); } else { try { prepareCommit(intercept(events)); commit(events); afterCommit(events); ingested.forEach(MessageMonitor.MonitorCallback::reportSuccess); } catch (Exception e) { ingested.forEach(m -> m.reportFailure(e)); throw e; } } }</code><technical_language>m -> messageMonitor? u -> unitOfWork</technical_language>

Target:
public void publish(List<? extends EventMessage<?>> events) { Stream<MessageMonitor.MonitorCallback> ingested = events.stream().map(messageMonitor::onMessageIngested); if (CurrentUnitOfWork.isStarted()) { UnitOfWork<?> unitOfWork = CurrentUnitOfWork.get(); Assert.state(!unitOfWork.phase().isAfter(PREPARE_COMMIT), () -> "It is not allowed to publish events when the current Unit of Work has already been " + "committed. Please start a new Unit of Work before publishing events."); Assert.state(!unitOfWork.root().phase().isAfter(PREPARE_COMMIT), () -> "It is not allowed to publish events when the root Unit of Work has already been " + "committed."); unitOfWork.afterCommit(u -> ingested.forEach(MessageMonitor.MonitorCallback::reportSuccess)); unitOfWork.onRollback(uow -> ingested.forEach( message -> message.reportFailure(uow.getExecutionResult().getExceptionResult()) )); eventsQueue(unitOfWork).addAll(events); } else { try { prepareCommit(intercept(events)); commit(events); afterCommit(events); ingested.forEach(MessageMonitor.MonitorCallback::reportSuccess); } catch (Exception e) { ingested.forEach(m -> m.reportFailure(e)); throw e; } } }
Source:
<code><START> public void testGrabChecksumFromDockerHub() { <END> final ApiClient webClient = getWebClient(USER_2_USERNAME, testingPostgres); ContainersApi toolApi = new ContainersApi(webClient); ContainertagsApi toolTagsApi = new ContainertagsApi(webClient); DockstoreTool tool = createManualDockerHubTool(); tool.setDefaultDockerfilePath("/Dockerfile"); tool.setDefaultCwlPath("/Docstore.cwl"); tool = toolApi.registerManual(tool); tool = addDockerHubTag(tool, toolTagsApi, toolApi); List<Tag> tags = verifyChecksumsAreSaved(toolApi, tool); refreshAfterDeletedTag(toolApi, tool, tags); }</code><technical_language>For quay.io DockerHub a test 1) A tool tags existing records for checksums 2) do a refresh, quay.io/DockerHub slow and/or non-responsive 3) Verify existing checksums</technical_language>

Target:
public void testGrabChecksumFromDockerHub() { final ApiClient webClient = getWebClient(USER_2_USERNAME, testingPostgres); ContainersApi toolApi = new ContainersApi(webClient); ContainertagsApi toolTagsApi = new ContainertagsApi(webClient); DockstoreTool tool = createManualDockerHubTool(); tool.setDefaultDockerfilePath("/Dockerfile"); tool.setDefaultCwlPath("/Docstore.cwl"); tool = toolApi.registerManual(tool); tool = addDockerHubTag(tool, toolTagsApi, toolApi); List<Tag> tags = toolApi.getContainer(tool.getId(), null).getWorkflowVersions(); verifyChecksumsAreSaved(tags); refreshAfterDeletedTag(toolApi, tool, tags); testingPostgres.runUpdateStatement("update tool set name = 'thisnamedoesnotexist' where giturl = 'git@bitbucket.org:dockstoretestuser2/dockstore-whalesay-2.git'"); toolApi.refresh(tool.getId()); List<Tag> updatedTags = toolApi.getContainer(tool.getId(), null).getWorkflowVersions(); verifyChecksumsAreSaved(updatedTags); }
Source:
<code>private void addTreeViewerBranch(ITmfStateSystem stateSystem, TmfTreeViewerEntry rootBranch, String branchName) { try { int quark = stateSystem.optQuarkAbsolute(branchName); if (quark != ITmfStateSystem.INVALID_ATTRIBUTE && !stateSystem.getSubAttributes(quark, false).isEmpty()) { TmfTreeViewerEntry branch = new TmfTreeViewerEntry(branchName); rootBranch.addChild(branch); addTreeViewerEntries(stateSystem, branch, <START> stateSystem.getQuarkAbsolute(branchName)); <END> } } catch (AttributeNotFoundException e) { LOGGER.log(Level.WARNING, e::getLocalizedMessage); } }</code><technical_language>this is 'quark', need try-catch</technical_language>

Target:
private void addTreeViewerBranch(ITmfStateSystem stateSystem, TmfTreeViewerEntry rootBranch, String branchName) { int quark = stateSystem.optQuarkAbsolute(branchName); if (quark != ITmfStateSystem.INVALID_ATTRIBUTE && !stateSystem.getSubAttributes(quark, false).isEmpty()) { TmfTreeViewerEntry branch = new TmfTreeViewerEntry(branchName); rootBranch.addChild(branch); addTreeViewerEntries(stateSystem, branch, quark); } }
Source:
<code>public boolean checkCell(Cell cell) { boolean valid = true; try { Comparable value = column.castValue(cell.value.toString()); <START> if (value.compareTo(column.castValue(threashold)) > 0) <END> valid = false; } catch (InvalidCastException | ConstraintsException e) { valid = false; } return valid; }</code><technical_language>is a typo here: threashold threshold (and other places)</technical_language>

Target:
public boolean checkCell(Cell cell) { boolean valid = true; try { Comparable value = column.castValue(cell.value.toString()); if (value.compareTo(column.castValue(threshold)) > 0) valid = false; } catch (InvalidCastException | ConstraintsException e) { valid = false; } return valid; }
Source:
<code>protected Object execute(Object blobInput, String chainOrOperationId, CoreSession session, Map<String, Object> contextParams, Map<String, Object> operationParams) { if (contextParams == null) { contextParams = new HashMap<>(); } if (operationParams == null) { operationParams = new HashMap<>(); } OperationContext ctx = new OperationContext(session); <START> AutomationServer server = Framework.getLocalService(AutomationServer.class); <END> RestBinding binding = server.getOperationBinding(chainOrOperationId); Principal principal = ctx.getPrincipal(); if (binding != null && binding.isAdministrator()) { if (!(principal instanceof NuxeoPrincipal) || !((NuxeoPrincipal) principal).isAdministrator()) { String message = "Not allowed. You must be administrator to use this operation"; log.error(message); throw new WebSecurityException(message); } } ctx.setInput(blobInput); ctx.putAll(contextParams); try { Object result = null; AutomationService as = Framework.getLocalService(AutomationService.class); result = as.run(ctx, chainOrOperationId, operationParams); return result; } catch (OperationException e) { log.error("Error while executing automation batch ", e); throw new NuxeoException(e); } }</code><technical_language>getLocalService -> getService</technical_language>

Target:
protected Object execute(Object blobInput, String chainOrOperationId, CoreSession session, Map<String, Object> contextParams, Map<String, Object> operationParams) { if (contextParams == null) { contextParams = new HashMap<>(); } if (operationParams == null) { operationParams = new HashMap<>(); } OperationContext ctx = new OperationContext(session); AutomationServer server = Framework.getService(AutomationServer.class); RestBinding binding = server.getOperationBinding(chainOrOperationId); if (binding != null && binding.isAdministrator()) { Principal principal = ctx.getPrincipal(); if (!(principal instanceof NuxeoPrincipal && ((NuxeoPrincipal) principal).isAdministrator())) { String message = "Not allowed. You must be administrator to use this operation"; log.error(message); throw new WebSecurityException(message); } } ctx.setInput(blobInput); ctx.putAll(contextParams); try { Object result = null; AutomationService as = Framework.getLocalService(AutomationService.class); result = as.run(ctx, chainOrOperationId, operationParams); return result; } catch (OperationException e) { log.error("Error while executing automation batch ", e); throw new NuxeoException(e); } }
Source:
<code>public boolean provides(final IOperation operation) { boolean provide = false; String currentDiagramType; final EObject referenceElement = ((View) ((CreateEditPoliciesOperation) operation).getEditPart().getModel()).getElement(); if (((((CreateEditPoliciesOperation) operation).getEditPart() instanceof NodeEditPart) && (operation instanceof CreateEditPoliciesOperation) && (referenceElement instanceof CallBehaviorAction))) { currentDiagramType = ((View) ((CreateEditPoliciesOperation) operation).getEditPart().getModel()).getDiagram().getType(); <START> if ((diagramType != null) && (diagramType.equals(currentDiagramType))) { <END> provide = true; } else { provide = false; } } return provide; }</code><technical_language>'null' operande</technical_language>

Target:
public boolean provides(final IOperation operation) { boolean provide = false; String currentDiagramType; final EObject referenceElement = ((View) ((CreateEditPoliciesOperation) operation).getEditPart().getModel()).getElement(); if (((((CreateEditPoliciesOperation) operation).getEditPart() instanceof NodeEditPart) && (operation instanceof CreateEditPoliciesOperation) && (referenceElement instanceof CallBehaviorAction))) { currentDiagramType = ((View) ((CreateEditPoliciesOperation) operation).getEditPart().getModel()).getDiagram().getType(); if ((null != diagramType) && (diagramType.equals(currentDiagramType))) { provide = true; } else { provide = false; } } return provide; }
Source:
<code>public static void deleteSubscription(final BlockingSphereClient client, final Subscription subscription) { if (subscription != null) { <START> Subscription subs = client.executeBlocking(SubscriptionDeleteCommand.of(subscription)); <END> } }</code><technical_language>subs return here, I suggest call client.executeBlocking storing return value</technical_language>

Target:
public static void deleteSubscription(final BlockingSphereClient client, final Subscription subscription) { if (subscription != null) { client.executeBlocking(SubscriptionDeleteCommand.of(subscription)); } }
Source:
<code>public boolean matches(RelOptRuleCall call) { FlinkLogicalAggregate agg = call.rel(0); List<AggregateCall> aggCalls = agg.getAggCallList(); boolean existPandasFunction = false; boolean existGeneralPythonFunction = false; boolean existJavaFunction = false; for (AggregateCall aggCall : aggCalls) { SqlAggFunction aggregation = aggCall.getAggregation(); if (aggregation instanceof AggSqlFunction) { ImperativeAggregateFunction<?, ?> func = ((AggSqlFunction) aggregation).aggregateFunction(); if (func instanceof PythonFunction) { PythonFunction pythonFunction = (PythonFunction) func; if (pythonFunction.getPythonFunctionKind() == PythonFunctionKind.PANDAS) { existPandasFunction = true; } else { existGeneralPythonFunction = true; } } else { existJavaFunction = true; } } } if (existPandasFunction) { if (existGeneralPythonFunction) { <START> throw new TableException("Pandas UDAF cannot be computed with General Python UDAF currently"); <END> } if (existJavaFunction) { throw new TableException("Pandas UDAF cannot be computed with Java/Scala UDAF currently"); } } return existPandasFunction || existGeneralPythonFunction; }</code><technical_language>suggestion throw new TableException("Pandas UDAF non-Pandas UDAF together.");</technical_language>

Target:
public boolean matches(RelOptRuleCall call) { FlinkLogicalAggregate agg = call.rel(0); List<AggregateCall> aggCalls = agg.getAggCallList(); boolean existGeneralPythonFunction = aggCalls.stream().anyMatch(x -> PythonUtil.isPythonAggregate(x, PythonFunctionKind.GENERAL)); boolean existPandasFunction = aggCalls.stream().anyMatch(x -> PythonUtil.isPythonAggregate(x, PythonFunctionKind.PANDAS)); boolean existJavaFunction = aggCalls.stream().noneMatch(x -> PythonUtil.isPythonAggregate(x, null)); if (existPandasFunction || existGeneralPythonFunction) { if (existJavaFunction) { throw new TableException("Python UDAF and Java/Scala UDAF cannot be used together."); } if (existPandasFunction && existGeneralPythonFunction) { throw new TableException("Pandas UDAF and non-Pandas UDAF cannot be used together."); } return true; } else { return false; } }
Source:
<code>synchronized boolean startAdb() { if (mAdbOsLocation == null) { Log.e(ADB, "Cannot start adb when AndroidDebugBridge is created without the location of adb."); return false; } Process proc; int status = -1; try { String[] command = new String[2]; command[0] = mAdbOsLocation; command[1] = "start-server"; Log.d(DDMS, String.format("Launching '%1$s %2$s' to ensure ADB is running.", mAdbOsLocation, command[1])); ProcessBuilder processBuilder = new ProcessBuilder(command); if (DdmPreferences.getUseAdbHost()) { String adbHostValue = DdmPreferences.getAdbHostValue(); <START> if (adbHostValue != null && !"".equals(adbHostValue)) { <END> Map<String, String> env = processBuilder.environment(); env.put("ADBHOST", adbHostValue); } } proc = processBuilder.start(); ArrayList<String> errorOutput = new ArrayList<String>(); ArrayList<String> stdOutput = new ArrayList<String>(); status = grabProcessOutput(proc, errorOutput, stdOutput, false ); } catch (IOException ioe) { Log.d(DDMS, "Unable to run 'adb': " + ioe.getMessage()); } catch (InterruptedException ie) { Log.d(DDMS, "Unable to run 'adb': " + ie.getMessage()); } if (status != 0) { Log.w(DDMS, "'adb start-server' failed -- run manually if necessary"); return false; } Log.d(DDMS, "'adb start-server' succeeded"); return true; }</code><technical_language>do adbHostValue.len() > 0</technical_language>

Target:
synchronized boolean startAdb() { if (mAdbOsLocation == null) { Log.e(ADB, "Cannot start adb when AndroidDebugBridge is created without the location of adb."); return false; } Process proc; int status = -1; try { String[] command = new String[2]; command[0] = mAdbOsLocation; command[1] = "start-server"; Log.d(DDMS, String.format("Launching '%1$s %2$s' to ensure ADB is running.", mAdbOsLocation, command[1])); ProcessBuilder processBuilder = new ProcessBuilder(command); if (DdmPreferences.getUseAdbHost()) { String adbHostValue = DdmPreferences.getAdbHostValue(); if (adbHostValue != null && adbHostValue.length() > 0) { Map<String, String> env = processBuilder.environment(); env.put("ADBHOST", adbHostValue); } } proc = processBuilder.start(); ArrayList<String> errorOutput = new ArrayList<String>(); ArrayList<String> stdOutput = new ArrayList<String>(); status = grabProcessOutput(proc, errorOutput, stdOutput, false ); } catch (IOException ioe) { Log.d(DDMS, "Unable to run 'adb': " + ioe.getMessage()); } catch (InterruptedException ie) { Log.d(DDMS, "Unable to run 'adb': " + ie.getMessage()); } if (status != 0) { Log.w(DDMS, "'adb start-server' failed -- run manually if necessary"); return false; } Log.d(DDMS, "'adb start-server' succeeded"); return true; }
Source:
<code>private void addFootnoteRef(MacroMarkerBlock footnoteMacro, Block footnoteRef) { <START> for (ListIterator<Block> it = footnoteMacro.getChildren().listIterator(); it.hasNext();) { <END> it.next(); it.remove(); } footnoteMacro.addChild(footnoteRef); }</code><technical_language>this for is equivalent footnoteMacro.getChildren().clear();</technical_language>

Target:
private void addFootnoteRef(MacroMarkerBlock footnoteMacro, Block footnoteRef) { footnoteMacro.getChildren().clear(); footnoteMacro.addChild(footnoteRef); }
Source:
<code>public void testLoadSingle() { <START> storage.reloadTemplateMaps();; <END> ServerTemplate toSearchFor = getFirstTemplateFromMap(); loadTemplateWithAssertEquals(toSearchFor); }</code><technical_language>';'</technical_language>

Target:
public void testLoadSingle() { storage.reloadTemplateMaps(); ServerTemplate toSearchFor = getFirstTemplateFromMap(); loadTemplateWithAssertEquals(toSearchFor); }
Source:
<code>private boolean waitForProcessCompletion(IOException originalError) { try { if (!p.waitFor(PROCESS_EXIT_TIMEOUT, TimeUnit.SECONDS)) { setError(originalError, MessageFormat.format( JGitText.get().commandClosedStderrButDidntExit, desc, PROCESS_EXIT_TIMEOUT), -1); fail.set(true); return false; } } catch (InterruptedException e) { LOG.error(MessageFormat.format( <START> JGitText.get().threadInterruptedWhileRunning, desc), e); <END> } return true; }</code><technical_language>Imagine catched InterruptedException reached this line. return true. Is correct? return false here</technical_language>

Target:
private boolean waitForProcessCompletion(IOException originalError) { try { if (!p.waitFor(PROCESS_EXIT_TIMEOUT, TimeUnit.SECONDS)) { setError(originalError, MessageFormat.format( JGitText.get().commandClosedStderrButDidntExit, desc, PROCESS_EXIT_TIMEOUT), -1); fail.set(true); return false; } } catch (InterruptedException e) { setError(originalError, MessageFormat.format( JGitText.get().threadInterruptedWhileRunning, desc), -1); fail.set(true); return false; } return true; }
Source:
<code>public void onOpenObjectExplorerEvent(OpenObjectExplorerEvent event) { if (!SourceWindowManager.isMainSourceWindow()) return; <START> Debug.logToRConsole("Opening object explorer"); <END> ObjectExplorerHandle handle = event.getHandle(); for (int i = 0; i < editors_.size(); i++) { String path = editors_.get(i).getPath(); if (path != null && path.equals(handle.getPath())) { ((ObjectExplorerEditingTarget)editors_.get(i)).update(handle); ensureVisible(false); view_.selectTab(i); return; } } ensureVisible(true); server_.newDocument( FileTypeRegistry.OBJECT_EXPLORER.getTypeId(), null, (JsObject) handle.cast(), new SimpleRequestCallback<SourceDocument>("Show Object Explorer") { @Override public void onResponseReceived(SourceDocument response) { addTab(response, OPEN_INTERACTIVE); } }); }</code><technical_language>Nit: Remove debug logging</technical_language>

Target:
public void onOpenObjectExplorerEvent(OpenObjectExplorerEvent event) { if (!SourceWindowManager.isMainSourceWindow()) return; ObjectExplorerHandle handle = event.getHandle(); for (int i = 0; i < editors_.size(); i++) { String path = editors_.get(i).getPath(); if (path != null && path.equals(handle.getPath())) { ((ObjectExplorerEditingTarget)editors_.get(i)).update(handle); ensureVisible(false); view_.selectTab(i); return; } } ensureVisible(true); server_.newDocument( FileTypeRegistry.OBJECT_EXPLORER.getTypeId(), null, (JsObject) handle.cast(), new SimpleRequestCallback<SourceDocument>("Show Object Explorer") { @Override public void onResponseReceived(SourceDocument response) { addTab(response, OPEN_INTERACTIVE); } }); }
Source:
<code>public static String convertToEqualShareFormatHtml(int i) { if (i == Const.INT_UNINITIALIZED) { return "<span class=\"color_neutral\">N/A</span>"; } else if (i == Const.POINTS_NOT_SUBMITTED) { return "<span class=\"color_neutral\"></span>"; } else if (i == Const.POINTS_NOT_SURE) { return "<span class=\"color-negative\">Not Sure</span>"; } else if (i == 0) { return "<span class=\"color-negative\">0%</span>"; } else if (i > 100) { return "<span class=\"color-positive\">Equal Share +" + (i - 100) + "%</span>"; } else if (i < 100) { return "<span class=\"color-negative\">Equal Share -" + (100 - i) + "%</span>"; } else if (i == 100) { return "<span class=\"color_neutral\">Equal Share</span>"; } else { return ""; <START> } <END> }</code><technical_language>Actually, else is unnecessary, condition i == 100 else clause, if i < 100 i > 100 violated, i == 100</technical_language>

Target:
public static String convertToEqualShareFormatHtml(int i) { if (i == Const.INT_UNINITIALIZED) { return "<span class=\"color_neutral\">N/A</span>"; } else if (i == Const.POINTS_NOT_SUBMITTED) { return "<span class=\"color_neutral\"></span>"; } else if (i == Const.POINTS_NOT_SURE) { return "<span class=\"color-negative\">Not Sure</span>"; } else if (i == 0) { return "<span class=\"color-negative\">0%</span>"; } else if (i > 100) { return "<span class=\"color-positive\">Equal Share +" + (i - 100) + "%</span>"; } else if (i < 100) { return "<span class=\"color-negative\">Equal Share -" + (100 - i) + "%</span>"; } else { return "<span class=\"color_neutral\">Equal Share</span>"; } }
Source:
<code>private void deleteFromStoresAndNotify(K key, V value, Metadata metadata) { CompletionStages.join(deleteFromStores(key)); <START> CompletionStages.join(cacheNotifier.notifyCacheEntryExpired(key, value, metadata, null)); <END> }</code><technical_language>call CompletionStages.join for a combined CompletionStage of delete notify operations</technical_language>

Target:
private void deleteFromStoresAndNotify(K key, V value, Metadata metadata) { CompletionStages.join(CompletionStages.allOf( persistenceManager.deleteFromAllStores(key, keyPartitioner.getSegment(key), PersistenceManager.AccessMode.BOTH), cacheNotifier.notifyCacheEntryExpired(key, value, metadata, null))); }
Source:
<code>public ParseResult beforeInvocation(ParseResult invocationContext) { ParseResult result = super.beforeInvocation(invocationContext); String defaultNameKey = (String) ReflectionUtils.getField( ReflectionUtils.findField(FileSystem.class, "FS_DEFAULT_NAME_KEY"), null); String fs = getHadoopConfiguration().get(defaultNameKey); if (fs != null && fs.length() > 0) { return result; } else { <START> LOG.severe("You must set namenode URL before running fs commands. Refer `hadoop config fs`"); <END> throw new IllegalStateException("You must set fs URL before running fs commands"); } }</code><technical_language>this "Refer to" possibly ", hadoop config fs"</technical_language>

Target:
public ParseResult beforeInvocation(ParseResult invocationContext) { ParseResult result = super.beforeInvocation(invocationContext); String defaultNameKey = (String) ReflectionUtils.getField( ReflectionUtils.findField(FileSystem.class, "FS_DEFAULT_NAME_KEY"), null); String fs = getHadoopConfiguration().get(defaultNameKey); if (fs != null && fs.length() > 0) { return result; } else { LOG.severe("You must set namenode URL before running fs commands. Use `hadoop config fs` to configure namenode URL."); throw new IllegalStateException("You must set fs URL before running fs commands"); } }
Source:
<code>private String formatDate(String dateString) { Date date = new Date(); <START> SimpleDateFormat formatedDate = new SimpleDateFormat("EEE"); <END> SimpleDateFormat originalDate = new SimpleDateFormat("yyyy-MM-dd"); try { date = originalDate.parse(dateString); } catch (ParseException e) { LoggingManager.Timber.e(e, "___________DateFormatError___________"); } String formattedString = formatedDate.format(date).toUpperCase(); return formattedString; }</code><technical_language>Small typo in variable name</technical_language>

Target:
private String formatDate(String dateString) { Date date = new Date(); SimpleDateFormat formattedDate = new SimpleDateFormat("EEE"); SimpleDateFormat originalDate = new SimpleDateFormat("yyyy-MM-dd"); try { date = originalDate.parse(dateString); } catch (ParseException e) { LoggingManager.Timber.e(e, "___________DateFormatError___________"); } String formattedString = formattedDate.format(date).toUpperCase(); return formattedString; }
Source:
<code>public History[] filterHistory(String... filters) throws Exception { <START> Map<String,String> params = new HashMap<String,String>(); <END> if (filters.length > 0) { for (int i = 0; i < filters.length; i++) { params.put("source_uri[]", filters[i]); } } else { return refreshHistory(); } return constructHistory(params); }</code><technical_language>Map<String,String> params = new HashMap<>();</technical_language>

Target:
public History[] filterHistory(String... filters) throws Exception { final Map<String,String> params = new HashMap<>(); if (filters.length > 0) { for (int i = 0; i < filters.length; i++) { params.put("source_uri[]", filters[i]); } } else { return refreshHistory(); } return constructHistory(params); }
Source:
<code>public void setAttribute(String key, String value, Context context) { if (ImplUtils.isNullOrEmpty(value)) { <START> logger.info("Failed to set span attribute since value is null or empty."); <END> return; } final Span span = getSpan(context); if (span != null) { span.setAttribute(key, AttributeValue.stringAttributeValue(value)); } else { logger.warning("Failed to find span to add attribute."); } }</code><technical_language>this logged info level this performing operation expected</technical_language>

Target:
public void setAttribute(String key, String value, Context context) { if (CoreUtils.isNullOrEmpty(value)) { logger.warning("Failed to set span attribute since value is null or empty."); return; } final Span span = getSpan(context); if (span != null) { span.setAttribute(key, AttributeValue.stringAttributeValue(value)); } else { logger.warning("Failed to find span to add attribute."); } }
Source:
<code>public void testNoBucketNumberHiddenColumn() { <START> assertUpdate("CREATE TABLE test_no_bucket_number AS SELECT * FROM orders", "SELECT count(*) FROM orders"); <END> computeActual("SELECT DISTINCT \"$bucket_number\" FROM test_no_bucket_number"); }</code><technical_language>this a simple CREATE TABLE (...)</technical_language>

Target:
public void testNoBucketNumberHiddenColumn() { assertUpdate("CREATE TABLE test_no_bucket_number (test bigint)"); computeActual("SELECT DISTINCT \"$bucket_number\" FROM test_no_bucket_number"); }
Source:
<code>@Override public void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c, MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException { <START> System.out.println("Fail once my coproc " + this); <END> if (failOnce) { failOnce = false; throw new IOException(); } }</code><technical_language>Please remove System.out</technical_language>

Target:
public void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c, MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException { if (failOnce) { failOnce = false; throw new IOException(); } }
Source:
<code>public BakingActionResult checkActionIsApplicableInState(State state, String[] params) { int len = params.length; <START> for (int i = 0; i < len; i++) { <END> String objectName = params[i]; ObjectInstance object = state.getObject(objectName); if (object == null) { return BakingActionResult.failure(objectName + " does not exist"); } String className = object.getObjectClass().name; if (!className.equalsIgnoreCase(this.parameterClasses[i])) { return BakingActionResult.failure(objectName + " is not valid for this action"); } } if (!this.canAgentGo(state, params)) { return BakingActionResult.failure(params[0] + " is not a valid agent to take this action"); } return BakingActionResult.success(); }</code><technical_language>len of this for loop, put in initialization. for (int i = 0, len = params.length; i < len; i++) {}</technical_language>

Target:
public BakingActionResult checkActionIsApplicableInState(State state, String[] params) { for (int i = 0, len = params.length; i < len; i++) { String objectName = params[i]; ObjectInstance object = state.getObject(objectName); if (object == null) { return BakingActionResult.failure(objectName + " does not exist"); } String className = object.getObjectClass().name; if (!className.equalsIgnoreCase(this.parameterClasses[i])) { return BakingActionResult.failure(objectName + " is not valid for this action"); } } if (!this.canAgentGo(state, params)) { return BakingActionResult.failure(params[0] + " is not a valid agent to take this action"); } return BakingActionResult.success(); }
Source:
<code>private long calculateRemainingEntriesIncrementalUpdates(long lastAckedTs, long txStreamTail, StreamIteratorMetadata currentTxStreamProcessedTs) { long noRemainingEntriesToSend = 0; if (txStreamTail <= currentTxStreamProcessedTs.getTimestamp()) { if (currentTxStreamProcessedTs.isStreamsToReplicatePresent()) { if (lastAckedTs == currentTxStreamProcessedTs.getTimestamp()) { log.trace(""); return noRemainingEntriesToSend; <START> } <END> return getTxStreamTotalEntries(lastAckedTs, currentTxStreamProcessedTs.getTimestamp()); } return noRemainingEntriesToSend; } if (currentTxStreamProcessedTs.isStreamsToReplicatePresent()) { return getTxStreamTotalEntries(lastAckedTs, txStreamTail); } return getTxStreamTotalEntries(currentTxStreamProcessedTs.getTimestamp(), txStreamTail); }</code><technical_language>in case of holes, Tx stream's tail stream tail, right? other</technical_language>

Target:
private long calculateRemainingEntriesIncrementalUpdates(long lastAckedTs, long txStreamTail, StreamIteratorMetadata currentTxStreamProcessedTs) { long noRemainingEntriesToSend = 0; if (txStreamTail <= currentTxStreamProcessedTs.getTimestamp()) { if (currentTxStreamProcessedTs.isStreamsToReplicatePresent()) { if (lastAckedTs == currentTxStreamProcessedTs.getTimestamp()) { log.trace("Log Entry Sync up to date, lastAckedTs={}, txStreamTail={}, currentTxProcessedTs={}, containsEntries={}", lastAckedTs, txStreamTail, currentTxStreamProcessedTs.getTimestamp(), currentTxStreamProcessedTs.isStreamsToReplicatePresent()); return noRemainingEntriesToSend; } log.trace("Log Entry Sync pending ACKs, lastAckedTs={}, txStreamTail={}, currentTxProcessedTs={}, containsEntries={}", lastAckedTs, txStreamTail, currentTxStreamProcessedTs.getTimestamp(), currentTxStreamProcessedTs.isStreamsToReplicatePresent()); return getTxStreamTotalEntries(lastAckedTs, currentTxStreamProcessedTs.getTimestamp()); } log.trace("Log Entry Sync up to date, no pending ACKs, lastAckedTs={}, txStreamTail={}, currentTxProcessedTs={}, containsEntries={}", lastAckedTs, txStreamTail, currentTxStreamProcessedTs.getTimestamp(), currentTxStreamProcessedTs.isStreamsToReplicatePresent()); return noRemainingEntriesToSend; } long remainingEntries = getTxStreamTotalEntries(lastAckedTs, txStreamTail); log.trace("Log Entry Sync pending entries for processing, lastAckedTs={}, txStreamTail={}, currentTxProcessedTs={}, containsEntries={}, remaining={}", lastAckedTs, txStreamTail, currentTxStreamProcessedTs.getTimestamp(), currentTxStreamProcessedTs.isStreamsToReplicatePresent(), remainingEntries); if (!currentTxStreamProcessedTs.isStreamsToReplicatePresent()) { return remainingEntries - 1; } return remainingEntries; }
Source:
<code>public void setEndDate(Date endDate) { <START> this.endDate = new Date(endDate.getTime()); <END> }</code><technical_language>happens, if endDate is null</technical_language>

Target:
public void setEndDate(Date endDate) { this.endDate = endDate != null ? new Date(endDate.getTime()) : null; }
Source:
<code>protected void setEnvironmentLabel(Map<String, Object> labels, Account account) { <START> labels.put(SystemLabels.LABEL_ENVIRONMENT_ID, account.getUuid()); <END> }</code><technical_language>This ENVIRONMENT_UUID, ID. ID UUID values</technical_language>

Target:
protected void setEnvironmentLabel(Map<String, Object> labels, Account account) { labels.put(SystemLabels.LABEL_ENVIRONMENT_UUID, account.getUuid()); }
Source:
<code>protected void executeCommand() { Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); VDSReturnValue vdsReturnValue = runVdsCommand(getParameters().isCreateImage() ? <START> VDSCommandType.CreateImage : VDSCommandType.CreateSnapshot, getCreateVDSCommandParameters()); <END> if (vdsReturnValue.getSucceeded()) { getParameters().setVdsmTaskIds(new ArrayList<>()); getParameters().getVdsmTaskIds().add( createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); getTaskIdList().add(getParameters().getVdsmTaskIds().get(0)); setSucceeded(true); } }</code><technical_language>CreateSnapshot, change accept InitialSize</technical_language>

Target:
protected void executeCommand() { Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); VDSReturnValue vdsReturnValue = runVdsCommand(VDSCommandType.CreateSnapshot, getCreateVDSCommandParameters()); if (vdsReturnValue.getSucceeded()) { getParameters().setVdsmTaskIds(new ArrayList<>()); getParameters().getVdsmTaskIds().add( createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); getTaskIdList().add(getParameters().getVdsmTaskIds().get(0)); setSucceeded(true); } }
Source:
<code>public void open() { try { <START> Optional<Path> resolvedPath = FileHelper.expandFilename( <END> databaseContext, linkedFile.getLink(), filePreferences); Optional<ExternalFileType> type = ExternalFileTypes.getInstance().fromLinkedFile(linkedFile, true); boolean successful = false; if (resolvedPath.isPresent()) { successful = JabRefDesktop.openExternalFileAnyFormat(databaseContext, resolvedPath.get().toString(), type); } if (!successful) { dialogService.showErrorDialogAndWait(Localization.lang("File not found"), Localization.lang("Could not find file '%0'.", linkedFile.getLink())); } } catch (IOException e) { dialogService.showErrorDialogAndWait(Localization.lang("Error opening file '%0'.", linkedFile.getLink()), e); } }</code><technical_language>code opens websites, leads problems this new code. I a isLink check appropiate place suffices</technical_language>

Target:
public void open() { try { Optional<ExternalFileType> type = ExternalFileTypes.getInstance().fromLinkedFile(linkedFile, true); boolean successful = JabRefDesktop.openExternalFileAnyFormat(databaseContext, linkedFile.getLink(), type); if (!successful) { dialogService.showErrorDialogAndWait(Localization.lang("File not found"), Localization.lang("Could not find file '%0'.", linkedFile.getLink())); } } catch (IOException e) { dialogService.showErrorDialogAndWait(Localization.lang("Error opening file '%0'.", linkedFile.getLink()), e); } }
Source:
<code>public String getPropertyString() { <START> return entity.getBukkitEntity() instanceof Creeper ? ((Creeper) entity.getBukkitEntity()).getMaxFuseTicks() + "" : null; <END> }</code><technical_language>Unneeded tern (it's a creeper if reading this line)</technical_language>

Target:
public String getPropertyString() { return String.valueOf(((Creeper) entity.getBukkitEntity()).getMaxFuseTicks()); }
Source:
<code>public static void checkKey(Class<?> keyType, Object keyObject) { Objects.requireNonNull(keyObject); <START> if (!keyType.isAssignableFrom(keyObject.getClass())) { <END> throw new ClassCastException("Invalid key type, expected : " + keyType.getName() + " but was : " + keyObject.getClass().getName()); } }</code><technical_language>java if (!keyType.isInstance(requireNonNull(keyObject))) { ... }</technical_language>

Target:
public static void checkKey(Class<?> keyType, Object keyObject) { if (!keyType.isInstance(Objects.requireNonNull(keyObject))) { throw new ClassCastException("Invalid key type, expected : " + keyType.getName() + " but was : " + keyObject.getClass().getName()); } }
Source:
<code>public void registered_device_with_x509cert_to_server_with_x509cert_rootca_certificate_usage_taa_intca_given() throws NonUniqueSecurityInfoException, CertificateEncodingException { helper.createServerWithX509Cert(helper.serverIntX509CertChain, helper.serverIntPrivateKeyFromCert, helper.trustedCertificates, true); helper.server.start(); helper.setEndpointNameFromX509(helper.clientX509Cert); helper.createX509CertClient(new X509Certificate[] { helper.clientX509Cert }, helper.clientPrivateKeyFromCert, helper.clientTrustStore, helper.serverIntX509CertChain[1], CertificateUsage.TRUST_ANCHOR_ASSERTION); helper.getSecurityStore().add(SecurityInfo.newX509CertInfo(helper.getCurrentEndpoint())); helper.assertClientNotRegisterered(); helper.client.start(); <START> helper.waitForRegistrationAtServerSide(1000); <END> assertNotNull(helper.getCurrentRegistration()); }</code><technical_language>be: java helper.waitForRegistrationAtServerSide(1);</technical_language>

Target:
public void registered_device_with_x509cert_to_server_with_x509cert_rootca_certificate_usage_taa_intca_given() throws NonUniqueSecurityInfoException, CertificateEncodingException { helper.createServerWithX509Cert(helper.serverIntX509CertChain, helper.serverIntPrivateKeyFromCert, helper.trustedCertificates, true); helper.server.start(); helper.setEndpointNameFromX509(helper.clientX509Cert); helper.createX509CertClient(new X509Certificate[] { helper.clientX509Cert }, helper.clientPrivateKeyFromCert, helper.clientTrustStore, helper.serverIntX509CertChain[1], CertificateUsage.TRUST_ANCHOR_ASSERTION); helper.getSecurityStore().add(SecurityInfo.newX509CertInfo(helper.getCurrentEndpoint())); helper.assertClientNotRegisterered(); helper.client.start(); helper.waitForRegistrationAtServerSide(1); assertNotNull(helper.getCurrentRegistration()); }