auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ChannelFuture awaitBarrier(String barrierName) throws Exception { final Barrier barrier = barriersByName.get(barrierName); if (barrier == null) { throw new Exception("Can not await nonexistant barrier: " + barrierName); } return barrier.getFuture(); }

Target:
public ChannelFuture awaitBarrier(String barrierName) throws Exception { final Barrier barrier = barriersByName.get(barrierName); if (barrier == null) { throw new Exception("Can not notify a barrier that does not exist in the script: " + barrierName); } return barrier.getFuture(); }
Source:
private void validateStopDatetime(Visit visit, Visit otherVisit, Errors errors) { if (visit.getStopDatetime() != null && otherVisit.getStartDatetime() != null && otherVisit.getStopDatetime() != null && visit.getStopDatetime().after(otherVisit.getStartDatetime()) && visit.getStopDatetime().before(otherVisit.getStopDatetime())) { errors.rejectValue("stopDatetime", "Visit.stopDateCannotFallIntoAnotherVisitOfTheSamePatient", "This visit has a stop date that falls into another visit of the same patient."); } if (visit.getStartDatetime() != null && visit.getStopDatetime() != null && otherVisit.getStartDatetime() != null && otherVisit.getStopDatetime() != null && visit.getStartDatetime().before(otherVisit.getStartDatetime()) && visit.getStopDatetime().after(otherVisit.getStopDatetime())) { String messageBuilder = "This visit contains another visit of the same patient, " + "i.e. its start date is before the start date of the other visit " + "and its stop date is after the stop date of the other visit."; errors.rejectValue("stopDatetime", "Visit.visitCannotContainAnotherVisitOfTheSamePatient", messageBuilder); } }

Target:
private void validateStopDatetime(Visit visit, Visit otherVisit, Errors errors) { if (visit.getStopDatetime() != null && otherVisit.getStartDatetime() != null && otherVisit.getStopDatetime() != null && visit.getStopDatetime().after(otherVisit.getStartDatetime()) && visit.getStopDatetime().before(otherVisit.getStopDatetime())) { errors.rejectValue("stopDatetime", "Visit.stopDateCannotFallIntoAnotherVisitOfTheSamePatient", "This visit has a stop date that falls into another visit of the same patient."); } if (visit.getStartDatetime() != null && visit.getStopDatetime() != null && otherVisit.getStartDatetime() != null && otherVisit.getStopDatetime() != null && visit.getStartDatetime().before(otherVisit.getStartDatetime()) && visit.getStopDatetime().after(otherVisit.getStopDatetime())) { String message = "This visit contains another visit of the same patient, " + "i.e. its start date is before the start date of the other visit " + "and its stop date is after the stop date of the other visit."; errors.rejectValue("stopDatetime", "Visit.visitCannotContainAnotherVisitOfTheSamePatient", message); } }
Source:
public List<GridFSDBFile> find( DBObject query , DBObject sort){ List<GridFSDBFile> files = new ArrayList<GridFSDBFile>(); DBCursor c = _filesCollection.find( query ); if (sort != null) { c.sort(sort); } while ( c.hasNext() ){ files.add( _fix( c.next() ) ); } return files; }

Target:
public List<GridFSDBFile> find( DBObject query , DBObject sort){ List<GridFSDBFile> files = new ArrayList<GridFSDBFile>(); DBCursor c = null; try { c = _filesCollection.find( query ); if (sort != null) { c.sort(sort); } while ( c.hasNext() ){ files.add( _fix( c.next() ) ); } } finally { if (c != null){ c.close(); } } return files; }
Source:
public void test_evaluateAll() { DMNContext dmnContext = dmnClient.newContext(); dmnContext.set("Values", Arrays.asList(new BigDecimal(1), new BigDecimal(2), new BigDecimal(3))); ServiceResponse<DMNResult> evaluateAll = dmnClient.evaluateAll(CONTAINER_1_ID, dmnContext); assertThat(evaluateAll.getType(), is(ResponseType.SUCCESS)); DMNResult dmnResult = evaluateAll.getResult(); assertThat(dmnResult.getMessages().toString(), dmnResult.hasErrors(), is(false)); DMNContext result = dmnResult.getContext(); assertThat(result.get("Standard Deviation"), is(new BigDecimal(1))); }

Target:
public void test_evaluateAll() { DMNContext dmnContext = dmnClient.newContext(); dmnContext.set("Values", Arrays.asList(new BigDecimal(1), new BigDecimal(2), new BigDecimal(3))); ServiceResponse<DMNResult> evaluateAll = dmnClient.evaluateAll(CONTAINER_1_ID, dmnContext); KieServerAssert.assertSuccess(evaluateAll); DMNResult dmnResult = evaluateAll.getResult(); assertThat(dmnResult.getMessages().toString(), dmnResult.hasErrors(), is(false)); DMNContext result = dmnResult.getContext(); assertThat(result.get("Standard Deviation"), is(new BigDecimal(1))); }
Source:
public void setUp() throws Exception { bootstrap.start(1620, 8080, "dev.telcong.com"); }

Target:
public void setUp() throws Exception { bootstrap.start(); }
Source:
public void findAnyDonorStartsWith_softDeleteRecordNotInclude() { donorRepository.deleteDonor(228l); assertEquals("List size should be zero because matching donornumber record is softdeleted.",donorRepository.findAnyDonorStartsWith("000233").size(),0); }

Target:
public void findAnyDonorStartsWith_softDeleteRecordNotInclude() { List<Donor> listDonor = donorRepository.findAnyDonorStartsWith("00"); for (Donor donor : listDonor) { assertNotSame( "Donor Id 2 is deleted from donor table so, that record should not part of list.", 2, donor.getId()); } }
Source:
public void testOpenSessionEditorByDoubleClick5() { designerProject.convertToModelingProject(); Display.getDefault().syncExec(() -> { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.ui.navigator.ProjectExplorer"); } catch (PartInitException e) { e.printStackTrace(); } }); SWTBotView packageExplorerView = bot.viewById("org.eclipse.ui.navigator.ProjectExplorer"); packageExplorerView.setFocus(); SWTBot packageExplorerViewBot = packageExplorerView.bot(); SWTBotTreeItem expandedNode = packageExplorerViewBot.tree().expandNode("DesignerTestProject", true); SWTBotTreeItem node = expandedNode.getNode("My.aird"); node.doubleClick(); bot.waitUntil(new DefaultCondition() { @Override public boolean test() throws Exception { return PlatformUI.getWorkbench().getWorkbenchWindows()[0].getActivePage().getActiveEditor() != null; } @Override public String getFailureMessage() { return "Wrong Active editor is : " + PlatformUI.getWorkbench().getWorkbenchWindows()[0].getActivePage().getActiveEditor().getEditorSite().getId(); } }); assertEquals("The session editor has not opened.", "org.eclipse.sirius.ui.editor.session", PlatformUI.getWorkbench().getWorkbenchWindows()[0].getActivePage().getActiveEditor().getEditorSite().getId()); }

Target:
public void testOpenSessionEditorByDoubleClick5() { designerProject.convertToModelingProject(); Display.getDefault().syncExec(() -> { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.ui.navigator.ProjectExplorer"); } catch (PartInitException e) { e.printStackTrace(); } }); SWTBotView packageExplorerView = bot.viewById("org.eclipse.ui.navigator.ProjectExplorer"); packageExplorerView.setFocus(); SWTBot packageExplorerViewBot = packageExplorerView.bot(); assertSessionEditorOpened(packageExplorerViewBot); }
Source:
public double get(int i, int j) { ensureIndexesAreInBounds(i, j); return getOrElse(i, j, 0.0); }

Target:
public double get(int i, int j) { return getOrElse(i, j, 0.0); }
Source:
private void handleListTag(Editable output) { int size = mListParents.size(); if (size > 0) { if (mListParents.get(size - 1).equals("ul")) { output.append("\n"); String[] split = output.toString().split("\n"); int start = 0; if (split.length != 1) { int lastIndex = split.length - 1; start = output.length() - split[lastIndex].length() - 1; } output.setSpan(new BulletSpan(15 * mListParents.size()), start, output.length(), 0); } else if (mListParents.get(size - 1).equals("ol")) { mListItemCount++; output.append("\n"); String[] split = output.toString().split("\n"); int start = 0; if (split.length != 1) { int lastIndex = split.length - 1; start = output.length() - split[lastIndex].length() - 1; } output.insert(start, mListItemCount + ". "); output.setSpan(new LeadingMarginSpan.Standard(15 * mListParents.size()), start, output.length(), 0); } } }

Target:
private void handleListTag(Editable output) { int size = mListParents.size(); if (size > 0 && output != null) { if ("ul".equals(mListParents.get(size - 1))) { output.append("\n"); String[] split = output.toString().split("\n"); int start = 0; if (split.length != 1) { int lastIndex = split.length - 1; start = output.length() - split[lastIndex].length() - 1; } output.setSpan(new BulletSpan(SPAN_INDENT_WIDTH * mListParents.size()), start, output.length(), 0); } else if ("ol".equals(mListParents.get(size - 1))) { mListItemCount++; output.append("\n"); String[] split = output.toString().split("\n"); int start = 0; if (split.length != 1) { int lastIndex = split.length - 1; start = output.length() - split[lastIndex].length() - 1; } output.insert(start, mListItemCount + ". "); output.setSpan(new LeadingMarginSpan.Standard(SPAN_INDENT_WIDTH * mListParents.size()), start, output.length(), 0); } } }
Source:
public static boolean isValidEditEvent(int event) { for (int ignoreKeyEvent : MemoryViewUtil.ignoreKeyEvents) { if (event == ignoreKeyEvent) return false; } return true; }

Target:
public static boolean isValidEditEvent(int event) { for (int ignoredKeyKevent : MemoryViewUtil.ignoreKeyEvents) { if (event == ignoredKeyKevent) { return false; } } return true; }
Source:
public void testReadingPendingMessageWithNoAutoACK() { Address address = new Address("Winterfell, Westeros"); Person person = new Person(address, "John Snow"); this.template.opsForStream() .createGroup(STREAM_KEY, this.redisStreamMessageProducer.getBeanName()) .as(StepVerifier::create) .assertNext(message -> assertThat(message).isEqualTo("OK")) .thenCancel() .verify(Duration.ofSeconds(10)); this.redisStreamMessageProducer.setCreateConsumerGroup(false); this.redisStreamMessageProducer.setAutoAck(false); this.redisStreamMessageProducer.setConsumerName(CONSUMER); this.redisStreamMessageProducer.afterPropertiesSet(); this.redisStreamMessageProducer.start(); this.messageHandler.handleMessage(new GenericMessage<>(person)); Mono<PendingMessagesSummary> pending = template.opsForStream().pending(STREAM_KEY, this.redisStreamMessageProducer.getBeanName()); StepVerifier.create(pending) .expectSubscription() .expectNextCount(1) .verifyComplete(); }

Target:
public void testReadingPendingMessageWithNoAutoACK() { Address address = new Address("Winterfell, Westeros"); Person person = new Person(address, "John Snow"); this.template.opsForStream() .createGroup(STREAM_KEY, this.redisStreamMessageProducer.getBeanName()) .as(StepVerifier::create) .assertNext(message -> assertThat(message).isEqualTo("OK")) .thenCancel() .verify(Duration.ofSeconds(10)); this.redisStreamMessageProducer.setCreateConsumerGroup(false); this.redisStreamMessageProducer.setAutoAck(false); this.redisStreamMessageProducer.setConsumerName(CONSUMER); this.redisStreamMessageProducer.afterPropertiesSet(); this.redisStreamMessageProducer.start(); this.messageHandler.handleMessage(new GenericMessage<>(person)); Flux.from(this.fluxMessageChannel) .as(StepVerifier::create) .assertNext(message -> { assertThat(message.getPayload()).isEqualTo(person); assertThat(message.getHeaders()).containsKeys(IntegrationMessageHeaderAccessor.ACKNOWLEDGMENT_CALLBACK); }) .thenCancel() .verify(Duration.ofSeconds(10)); }
Source:
private void addPatternToIndex(TripPattern tripPattern) { for (Stop stop: tripPattern.getStops()) { if (!patternsForStop.containsEntry(stop, tripPattern)) { patternsForStop.put(stop, tripPattern); } } }

Target:
private void addPatternToIndex(TripPattern tripPattern) { for (Stop stop: tripPattern.getStops()) { patternsForStop.put(stop, tripPattern); } }
Source:
public static EndpointRegistry fromDTOtoEndpointRegistry(RegistryDTO registryDTO, String owner) { EndpointRegistry registry = new EndpointRegistry(); registry.setName(registryDTO.getName()); registry.setOwner(owner); registry.setType(registryDTO.getType().toString()); registry.setMode(registryDTO.getType().toString()); return registry; }

Target:
public static EndpointRegistryInfo fromDTOtoEndpointRegistry(RegistryDTO registryDTO, String owner) { EndpointRegistryInfo registry = new EndpointRegistryInfo(); registry.setName(registryDTO.getName()); registry.setOwner(owner); registry.setType(registryDTO.getType().toString()); registry.setMode(registryDTO.getMode().toString()); return registry; }
Source:
protected void executeCommand() { setActionReturnValue(getCurrentUser()); getReturnValue().setLoginResult(LoginResult.Autheticated); getReturnValue().setSessionId(engineSessionId); updateUserData(); ApplicationMode appMode = ApplicationMode.from(Config.<Integer> getValue(ConfigValues.ApplicationMode)); SessionDataContainer.getInstance().setData("app_mode", appMode); setSucceeded(true); }

Target:
protected void executeCommand() { setActionReturnValue(getCurrentUser()); getReturnValue().setLoginResult(LoginResult.Autheticated); getReturnValue().setSessionId(engineSessionId); updateUserData(); setSucceeded(true); }
Source:
public void t01_startDemoBulkWorkflow() { CreateWorkflowInstanceRequest req = new CreateWorkflowInstanceRequest(); req.type = DEMO_BULK_WORKFLOW_TYPE; req.stateVariables.put(BulkWorkflow.VAR_CONCURRENCY, 3); List<Integer> childData = asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); childrenCount = childData.size(); req.stateVariables.put(BulkWorkflow.VAR_CHILD_DATA, nflowObjectMapper().valueToTree(childData)); CreateWorkflowInstanceResponse resp = fromClient(workflowInstanceResource, true).put(req, CreateWorkflowInstanceResponse.class); assertThat(resp.id, notNullValue()); workflowId = resp.id; }

Target:
public void t01_startDemoBulkWorkflow() { CreateWorkflowInstanceRequest req = new CreateWorkflowInstanceRequest(); req.type = DEMO_BULK_WORKFLOW_TYPE; req.stateVariables.put(BulkWorkflow.VAR_CONCURRENCY, 3); List<Integer> childData = IntStream.rangeClosed(1, CHILDREN_COUNT).boxed().collect(toList()); req.stateVariables.put(BulkWorkflow.VAR_CHILD_DATA, nflowObjectMapper().valueToTree(childData)); CreateWorkflowInstanceResponse resp = fromClient(workflowInstanceResource, true).put(req, CreateWorkflowInstanceResponse.class); assertThat(resp.id, notNullValue()); workflowId = resp.id; }
Source:
public void cookie() throws Exception { final String name = "foo"; final String value = "bar"; final HttpServletResponse sresp = new HttpServletResponseFake( new RsEmpty() ); sresp.addCookie(new Cookie(name, value)); MatcherAssert.assertThat( "Can't add a cookie in servlet response", sresp.getHeaders("Set-Cookie:"), Matchers.hasItem( new FormattedText( "Set-Cookie: %s=%s;", name, value ).asString() ) ); }

Target:
public void cookie() throws Exception { final String name = "foo"; final String value = "bar"; final HttpServletResponse sresp = new HttpServletResponseFake( new RsEmpty() ); sresp.addCookie(new Cookie(name, value)); MatcherAssert.assertThat( "Can't add a cookie in servlet response", sresp.getHeaders(HttpServletResponseFakeTest.SET_COOKIE), Matchers.hasItem( new FormattedText( "%s %s=%s;", HttpServletResponseFakeTest.SET_COOKIE, name, value ).asString() ) ); }
Source:
private void putPreferred(String email) throws RestApiException, OrmException { List<EmailInfo> emails = getEmails.apply(rsrc); for (EmailInfo e : emails) { if (e.email.equals(email)) { putPreferred.apply(new AccountResource.Email(user, email), null); } } }

Target:
private void putPreferred(String email) throws RestApiException, OrmException { putPreferred.apply(new AccountResource.Email(user, email), null); }
Source:
private void addWorld() { this.getBuilder(Tags.Blocks.SLIMY_LOGS).add(WorldBlocks.congealed_green_slime.get(), WorldBlocks.congealed_blue_slime.get(), WorldBlocks.congealed_purple_slime.get(), WorldBlocks.congealed_blood_slime.get(), WorldBlocks.congealed_magma_slime.get()); for (SlimeGrassBlock.FoliageType type : SlimeGrassBlock.FoliageType.values()) { this.getBuilder(Tags.Blocks.SLIMY_LEAVES).add(WorldBlocks.slime_leaves.get(type)); this.getBuilder(Tags.Blocks.SLIMY_SAPLINGS).add(WorldBlocks.slime_sapling.get(type)); } this.getBuilder(net.minecraftforge.common.Tags.Blocks.ORES).add(Tags.Blocks.ORES_COBALT, Tags.Blocks.ORES_ARDITE); this.getBuilder(Tags.Blocks.ORES_COBALT).add(WorldBlocks.cobalt_ore.get()); this.getBuilder(Tags.Blocks.ORES_ARDITE).add(WorldBlocks.ardite_ore.get()); }

Target:
private void addWorld() { this.getBuilder(Tags.Blocks.SLIMY_LOGS).add(WorldBlocks.congealed_slime.get(SlimeBlock.SlimeType.GREEN), WorldBlocks.congealed_slime.get(SlimeBlock.SlimeType.BLUE), WorldBlocks.congealed_slime.get(SlimeBlock.SlimeType.PURPLE), WorldBlocks.congealed_slime.get(SlimeBlock.SlimeType.BLOOD), WorldBlocks.congealed_slime.get(SlimeBlock.SlimeType.MAGMA)); for (SlimeGrassBlock.FoliageType type : SlimeGrassBlock.FoliageType.values()) { this.getBuilder(Tags.Blocks.SLIMY_LEAVES).add(WorldBlocks.slime_leaves.get(SlimeGrassBlock.FoliageType.BLUE), WorldBlocks.slime_leaves.get(SlimeGrassBlock.FoliageType.PURPLE), WorldBlocks.slime_leaves.get(SlimeGrassBlock.FoliageType.ORANGE)); this.getBuilder(Tags.Blocks.SLIMY_SAPLINGS).add(WorldBlocks.slime_sapling.get(type)); } this.getBuilder(net.minecraftforge.common.Tags.Blocks.ORES).add(Tags.Blocks.ORES_COBALT, Tags.Blocks.ORES_ARDITE); this.getBuilder(Tags.Blocks.ORES_COBALT).add(WorldBlocks.cobalt_ore.get()); this.getBuilder(Tags.Blocks.ORES_ARDITE).add(WorldBlocks.ardite_ore.get()); }
Source:
protected Boolean getAutoCorrectFontMetrics() { return false; }

Target:
protected boolean getAutoCorrectFontMetrics() { return false; }
Source:
private void finalizeMetadataChunk() { finalBlobProperties = new BlobProperties(getBlobSize(), passedInBlobProperties.getServiceId(), passedInBlobProperties.getOwnerId(), passedInBlobProperties.getContentType(), passedInBlobProperties.isPrivate(), passedInBlobProperties.getTimeToLiveInSeconds(), passedInBlobProperties.getCreationTimeInMs(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), false); if (getNumDataChunks() > 1) { List<StoreKey> orderedChunkIdList = new ArrayList<>(indexToChunkIds.values()); buf = MetadataContentSerDe.serializeMetadataContent(routerConfig.routerMaxPutChunkSizeBytes, getBlobSize(), orderedChunkIdList); onFillComplete(false); } else { blobId = (BlobId) indexToChunkIds.get(0); state = ChunkState.Complete; operationCompleted = true; } }

Target:
private void finalizeMetadataChunk() { finalBlobProperties = new BlobProperties(getBlobSize(), passedInBlobProperties.getServiceId(), passedInBlobProperties.getOwnerId(), passedInBlobProperties.getContentType(), passedInBlobProperties.isPrivate(), passedInBlobProperties.getTimeToLiveInSeconds(), passedInBlobProperties.getCreationTimeInMs(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), passedInBlobProperties.isEncrypted()); if (getNumDataChunks() > 1) { List<StoreKey> orderedChunkIdList = new ArrayList<>(indexToChunkIds.values()); buf = MetadataContentSerDe.serializeMetadataContent(routerConfig.routerMaxPutChunkSizeBytes, getBlobSize(), orderedChunkIdList); onFillComplete(false); } else { blobId = (BlobId) indexToChunkIds.get(0); state = ChunkState.Complete; operationCompleted = true; } }
Source:
void columnsTabToggle(final GuidedDecisionTableView.Presenter decisionTablePresenter) { final boolean decisionTableIsEditable = !decisionTablePresenter.isReadOnly(); final boolean decisionTableHasEditableColumns = decisionTablePresenter.hasEditableColumns(); if (!decisionTableIsEditable || !decisionTableHasEditableColumns) { disableColumnsPage(); } else { enableColumnsPage(); } }

Target:
void columnsTabToggle(final GuidedDecisionTableView.Presenter decisionTablePresenter) { columnsTabToggle(isGuidedDecisionTableEditable(decisionTablePresenter)); }
Source:
protected org.ovirt.engine.core.common.businessentities.VM getVmPreview(Snapshot snapshot) { org.ovirt.engine.core.common.businessentities.VM vm = null; try { vm = getEntity(org.ovirt.engine.core.common.businessentities.VM.class, QueryType.GetVmConfigurationBySnapshot, new IdQueryParameters(asGuid(snapshot.getId())), null); } catch (WebFaultException wfe) { if (Response.Status.NOT_FOUND.getStatusCode() == wfe.getResponse().getStatus()) { return null; } } return vm; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getVmPreview(Snapshot snapshot) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity(org.ovirt.engine.core.common.businessentities.VM.class, QueryType.GetVmConfigurationBySnapshot, new IdQueryParameters(asGuid(snapshot.getId())), null); return vm; }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof FileAndName)) { return false; } FileAndName other = (FileAndName) obj; if (!NonNullUtils.equalsNullable(fTraceTypeId, other.fTraceTypeId)) { return false; } return NonNullUtils.equalsNullable(fFile, other.fFile); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof FileAndName)) { return false; } FileAndName other = (FileAndName) obj; if (!equalsNullable(fTraceTypeId, other.fTraceTypeId)) { return false; } if (!equalsNullable(fFile, other.fFile)) { return false; } return true; }
Source:
private void parsePath() { ImmutableList.Builder<SqlPathElement> builder = ImmutableList.builder(); String[] schemas = rawPath.split(",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)"); for (String schema : schemas) { String catalogName; String schemaName; SqlPathElement element; String[] individual = schema.split("\\.(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)"); if (individual.length > 1) { catalogName = individual[0]; schemaName = individual[1]; element = new SqlPathElement(catalogName, schemaName); } else { element = new SqlPathElement(schema); } builder.add(element); } this.parsedPath = builder.build(); }

Target:
private void parsePath() { checkState(rawPath.isPresent(), "rawPath must be present to parse"); SqlParser parser = new SqlParser(); List<PathElement> pathSpecification = parser.createPathSpecification(rawPath.get()).getPath(); this.parsedPath = pathSpecification.stream() .map(pathElement -> new SqlPathElement(pathElement.getCatalog(), pathElement.getSchema())) .collect(toImmutableList()); }
Source:
public void register(Class<? extends Converter<?>> converterClass) { Convert type = converterClass.getAnnotation(Convert.class); checkState(type != null, "The converter type %s should have the Convert annotation", converterClass.getName()); Class<? extends Converter<?>> other = findConverterType(type.value()); if (!other.equals(NullConverter.class)) { int priority = getConverterPriority(converterClass); int priorityOther = getConverterPriority(other); checkState(priority != priorityOther, "Converter %s have same priority than %s", converterClass, other); if (priority > priorityOther) { logger.debug("Overriding converter with because have more priority", other, converterClass); classes.remove(other); classes.add(converterClass); } } logger.debug("adding converter to {}", converterClass, type.value()); classes.add(converterClass); }

Target:
public void register(Class<? extends Converter<?>> converterClass) { Convert type = converterClass.getAnnotation(Convert.class); checkState(type != null, "The converter type %s should have the Convert annotation", converterClass.getName()); Class<? extends Converter<?>> currentConverter = findConverterType(type.value()); if (!currentConverter.equals(NullConverter.class)) { int priority = getConverterPriority(converterClass); int priorityCurrent = getConverterPriority(currentConverter); checkState(priority != priorityCurrent, "Converter %s have same priority than %s", converterClass, currentConverter); if (priority > priorityCurrent) { logger.debug("Overriding converter with because have more priority", currentConverter, converterClass); classes.remove(currentConverter); classes.add(converterClass); } else { logger.debug("Converter not registered because have less priority than {}", converterClass, currentConverter); } } logger.debug("adding converter to {}", converterClass, type.value()); classes.add(converterClass); }
Source:
private EmptyActionInput() { execPath = null; }

Target:
private EmptyActionInput()
Source:
public void testGetInstructorAccounts() throws Exception { int numOfInstructors = 4; createNewAccount(); List<AccountAttributes> instructorAccountsExpected = createInstructorAccounts(numOfInstructors); List<AccountAttributes> instructorAccountsActual = accountsDb.getInstructorAccounts(); assertEquals(numOfInstructors, instructorAccountsActual.size()); for (int i = 0; i < numOfInstructors; i++) { instructorAccountsExpected.get(i).createdAt = null; instructorAccountsExpected.get(i).studentProfile.modifiedDate = null; instructorAccountsActual.get(i).createdAt = null; instructorAccountsActual.get(i).studentProfile.modifiedDate = null; } AssertHelper.assertSameContentIgnoreOrder(instructorAccountsExpected, instructorAccountsActual); deleteInstructorAccounts(numOfInstructors); }

Target:
public void testGetInstructorAccounts() throws Exception { int numOfInstructors = 3; createNewAccount(); List<AccountAttributes> instructorAccountsExpected = createInstructorAccounts(numOfInstructors); List<AccountAttributes> instructorAccountsActual = accountsDb.getInstructorAccounts(); assertEquals(numOfInstructors, instructorAccountsActual.size()); for (int i = 0; i < numOfInstructors; i++) { instructorAccountsExpected.get(i).createdAt = null; instructorAccountsExpected.get(i).studentProfile.modifiedDate = null; instructorAccountsActual.get(i).createdAt = null; instructorAccountsActual.get(i).studentProfile.modifiedDate = null; } AssertHelper.assertSameContentIgnoreOrder(instructorAccountsExpected, instructorAccountsActual); deleteInstructorAccounts(numOfInstructors); }
Source:
public List<Action> getActions() { List<Action> actions = new Vector<>(super.getActions()); actions.addAll(transientActions); return Collections.unmodifiableList(actions); }

Target:
public List<Action> getActions() { List<Action> actions = new Vector<>(getPersistedActions()); actions.addAll(transientActions); return Collections.unmodifiableList(actions); }
Source:
public @Nonnull String filter(@Nonnull String input) { ContentMappings mappings = ContentMappings.get(); String filtered = input; List<String> searchList = new ArrayList<>(); List<String> replacementList = new ArrayList<>(); for (ContentMapping mapping : mappings) { searchList.add(mapping.getOriginal()); replacementList.add(mapping.getReplacement()); } if (!searchList.isEmpty()) { filtered = StringUtils.replaceEach(input, searchList.toArray(new String[]{}), replacementList.toArray(new String[]{})); } return filtered; }

Target:
public @Nonnull String filter(@Nonnull String input) { ContentMappings mappings = ContentMappings.get(); String filtered = input; List<String> searchList = new ArrayList<>(); List<String> replacementList = new ArrayList<>(); for (ContentMapping mapping : mappings) { searchList.add(mapping.getOriginal()); replacementList.add(mapping.getReplacement()); } if (!searchList.isEmpty()) { filtered = StringUtils.replaceEach(input, searchList.toArray(new String[0]), replacementList.toArray(new String[0])); } return filtered; }
Source:
public Task createInstance(TaskDefinition taskDefinition) throws SchedulerException { try { Class<?> taskClass = OpenmrsClassLoader.getInstance().loadClass(taskDefinition.getTaskClass()); Task task = new TaskThreadedInitializationWrapper((Task) taskClass.newInstance()); log.debug("initializing {}", taskClass.getName()); task.initialize(taskDefinition); return task; } catch (ClassNotFoundException cnfe) { log.error("OpenmrsClassLoader could not load class: {}. Probably due to a module not being loaded", taskDefinition.getTaskClass()); log.debug("Full error trace of ClassNotFoundException {}", cnfe); throw new SchedulerException("could not load class", cnfe); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug("Error creating new task for class " + taskDefinition.getTaskClass(), e); } throw new SchedulerException("error creating new task for class " + taskDefinition.getTaskClass(), e); } }

Target:
public Task createInstance(TaskDefinition taskDefinition) throws SchedulerException { try { Class<?> taskClass = OpenmrsClassLoader.getInstance().loadClass(taskDefinition.getTaskClass()); Task task = new TaskThreadedInitializationWrapper((Task) taskClass.newInstance()); log.debug("initializing {}", taskClass.getName()); task.initialize(taskDefinition); return task; } catch (ClassNotFoundException cnfe) { log.error("OpenmrsClassLoader could not load class: {}. Probably due to a module not being loaded", taskDefinition.getTaskClass()); log.debug("Full error trace of ClassNotFoundException", cnfe); throw new SchedulerException("could not load class", cnfe); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug("Error creating new task for class " + taskDefinition.getTaskClass(), e); } throw new SchedulerException("error creating new task for class " + taskDefinition.getTaskClass(), e); } }
Source:
public boolean execute(final IDebugCommandRequest request) { if (request.getElements().length == 0) { request.done(); return false; } getContainerDMContexts(request.getElements(), new DataRequestMonitor<IContainerDMContext[]>(fExecutor, null) { @Override protected void handleCompleted() { if (!isSuccess()) { request.setStatus(getStatus()); request.done(); } else if (getData().length == 0){ request.done(); } else { disconnect(getData(), new ImmediateRequestMonitor() { @Override protected void handleCompleted() { if (!isSuccess()) { request.setStatus(getStatus()); request.done(); } else { waitForTermination(request); } } }); } } }); return false; }

Target:
public boolean execute(final IDebugCommandRequest request) { if (request.getElements().length == 0) { request.done(); return false; } getContainerDMContexts(request.getElements(), new DataRequestMonitor<IContainerDMContext[]>(fExecutor, null) { @Override protected void handleCompleted() { if (!isSuccess()) { request.setStatus(getStatus()); request.done(); } else { disconnect(getData(), new ImmediateRequestMonitor() { @Override protected void handleCompleted() { if (!isSuccess()) { request.setStatus(getStatus()); request.done(); } else { waitForTermination(request); } } }); } } }); return false; }
Source:
public void fluent_http() throws Exception { File litsDifferencesFile = FileLocation.of("target/differences").getFile(); File pomFile = FileLocation.of("../sources/fluent-http/pom.xml").getFile(); MavenBuild mavenBuild = MavenBuild.create().setPom(pomFile).setCleanPackageSonarGoals().addArgument("-DskipTests") .setProfile("rules") .setProperty("sonar.cpd.skip", "true") .setProperty("sonar.skipPackageDesign", "true") .setProperty("sonar.analysis.mode", "preview") .setProperty("sonar.issuesReport.html.enable", "true") .setProperty("dump.old", FileLocation.of("src/test/resources/fluent-http").getFile().getAbsolutePath()) .setProperty("dump.new", FileLocation.of("target/actual/fluent-http").getFile().getAbsolutePath()) .setProperty("lits.differences", litsDifferencesFile.getAbsolutePath()); orchestrator.executeBuild(mavenBuild); assertThat(Files.toString(litsDifferencesFile, StandardCharsets.UTF_8)).isEmpty(); }

Target:
public void fluent_http() throws Exception { test_project("fluent-http"); }
Source:
protected TransactionalEditingDomain getTableEditingDomain() { ServicesRegistry registry = null; if(null != getTableManager().getTable().eResource()){ try { registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(getTableManager().getTable()); return registry.getService(TransactionalEditingDomain.class); } catch (final ServiceException e) { Activator.log.error(Messages.NattableModelManager_ServiceRegistryNotFound, e); } } return null; }

Target:
protected TransactionalEditingDomain getTableEditingDomain() { ServicesRegistry registry = null; if(null != getTableManager() && null != getTableManager().getTable() && null != getTableManager().getTable().eResource()){ try { registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(getTableManager().getTable()); return registry.getService(TransactionalEditingDomain.class); } catch (final ServiceException e) { Activator.log.error(Messages.NattableModelManager_ServiceRegistryNotFound, e); } } return null; }
Source:
public void asyncCreateLedgerAdv(final int ensSize, final int writeQuorumSize, final int ackQuorumSize, final DigestType digestType, final byte[] passwd, final CreateCallback cb, final Object ctx, final Map<String, byte[]> customMetadata) { if (writeQuorumSize < ackQuorumSize) { throw new IllegalArgumentException("Write quorum must be larger than ack quorum"); } closeLock.readLock().lock(); try { if (closed) { cb.createComplete(BKException.Code.ClientClosedException, null, ctx); return; } new LedgerCreateOp(BookKeeper.this, ensSize, writeQuorumSize, ackQuorumSize, digestType, passwd, cb, ctx, customMetadata, EnumSet.noneOf(WriteFlag.class)) .initiateAdv((long)(-1)); } finally { closeLock.readLock().unlock(); } }

Target:
public void asyncCreateLedgerAdv(final int ensSize, final int writeQuorumSize, final int ackQuorumSize, final DigestType digestType, final byte[] passwd, final CreateCallback cb, final Object ctx, final Map<String, byte[]> customMetadata) { if (writeQuorumSize < ackQuorumSize) { throw new IllegalArgumentException("Write quorum must be larger than ack quorum"); } closeLock.readLock().lock(); try { if (closed) { cb.createComplete(BKException.Code.ClientClosedException, null, ctx); return; } new LedgerCreateOp(BookKeeper.this, ensSize, writeQuorumSize, ackQuorumSize, digestType, passwd, cb, ctx, customMetadata, EnumSet.noneOf(WriteFlag.class)) .initiateAdv(-1L); } finally { closeLock.readLock().unlock(); } }
Source:
public static void main(String[] args) throws InterruptedException { String connectionString = "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};" + "SharedAccessKey={key}"; ServiceBusSessionReceiverAsyncClient sessionReceiver = new ServiceBusClientBuilder() .connectionString(connectionString) .sessionReceiver() .receiveMode(ServiceBusReceiveMode.PEEK_LOCK) .queueName("<<queue-name>>") .buildAsyncClient(); Mono<ServiceBusReceiverAsyncClient> receiverMono = sessionReceiver.acceptSession("greetings-id"); Disposable subscription = receiverMono.flatMapMany(receiver -> receiver.receiveMessages()) .subscribe(message -> { System.out.printf("Session: %s. Sequence #: %s. Contents: %s%n", message.getSessionId(), message.getSequenceNumber(), message.getBody()); }, error -> System.err.println("Error occurred: " + error)); TimeUnit.SECONDS.sleep(10); subscription.dispose(); sessionReceiver.close(); }

Target:
public static void main(String[] args) throws InterruptedException { String connectionString = "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};" + "SharedAccessKey={key}"; ServiceBusSessionReceiverAsyncClient sessionReceiver = new ServiceBusClientBuilder() .connectionString(connectionString) .sessionReceiver() .receiveMode(ServiceBusReceiveMode.PEEK_LOCK) .queueName("<<queue-name>>") .buildAsyncClient(); Mono<ServiceBusReceiverAsyncClient> receiverMono = sessionReceiver.acceptSession("greetings-id"); Disposable subscription = Flux.usingWhen(receiverMono, receiver -> receiver.receiveMessages(), receiver -> Mono.fromRunnable(() -> receiver.close())) .subscribe(message -> { System.out.printf("Session: %s. Sequence #: %s. Contents: %s%n", message.getSessionId(), message.getSequenceNumber(), message.getBody()); }, error -> System.err.println("Error occurred: " + error)); TimeUnit.SECONDS.sleep(10); subscription.dispose(); sessionReceiver.close(); }
Source:
private int getEventAttributeLocation(InputMappingAttribute inputMappingAttribute, StreamDefinition streamDefinition) { int attributeLocation = 0; if (EventReceiverUtil.isMetaAttribute(inputMappingAttribute.getToElementKey())) { for (Attribute metaAttribute : streamDefinition.getMetaData()) { if ((EventReceiverConstants.META_DATA_PREFIX).concat(metaAttribute.getName()).equals(inputMappingAttribute.getToElementKey())) { return attributeLocation; } attributeLocation++; } } else if (EventReceiverUtil.isCorrelationAttribute(inputMappingAttribute.getToElementKey())) { for (Attribute correlationData : streamDefinition.getCorrelationData()) { if (EventReceiverConstants.CORRELATION_DATA_PREFIX.concat(correlationData.getName()).equals(inputMappingAttribute.getToElementKey())) { if (streamDefinition.getMetaData() != null) { attributeLocation += streamDefinition.getMetaData().size(); } return attributeLocation; } attributeLocation++; } } else { for (Attribute payloadData : streamDefinition.getPayloadData()) { if (payloadData.getName().equals(inputMappingAttribute.getToElementKey())) { if (streamDefinition.getMetaData() != null) { attributeLocation += streamDefinition.getMetaData().size(); } if (streamDefinition.getCorrelationData() != null) { attributeLocation += streamDefinition.getCorrelationData().size(); } return attributeLocation; } attributeLocation++; } } return -1; }

Target:
private int getEventAttributeLocation(InputMappingAttribute inputMappingAttribute, StreamDefinition streamDefinition) { int attributeLocation = 0; int metaSize = streamDefinition.getMetaData() != null ? streamDefinition.getMetaData().size() : 0; int correlationSize = streamDefinition.getCorrelationData() != null ? streamDefinition.getCorrelationData().size() : 0; if (EventReceiverUtil.isMetaAttribute(inputMappingAttribute.getToElementKey())) { for (Attribute metaAttribute : streamDefinition.getMetaData()) { if ((EventReceiverConstants.META_DATA_PREFIX).concat(metaAttribute.getName()).equals(inputMappingAttribute.getToElementKey())) { return attributeLocation; } attributeLocation++; } } else if (EventReceiverUtil.isCorrelationAttribute(inputMappingAttribute.getToElementKey())) { for (Attribute correlationData : streamDefinition.getCorrelationData()) { if (EventReceiverConstants.CORRELATION_DATA_PREFIX.concat(correlationData.getName()).equals(inputMappingAttribute.getToElementKey())) { return attributeLocation + metaSize; } attributeLocation++; } } else { for (Attribute payloadData : streamDefinition.getPayloadData()) { if (payloadData.getName().equals(inputMappingAttribute.getToElementKey())) { return attributeLocation + metaSize + correlationSize; } attributeLocation++; } } return -1; }
Source:
public void removeChangeListeners() { SharedRealm sharedRealm = getSharedRealm(looperThread.realmConfiguration); Integer dummyObserver = 1; looperThread.keepStrongReference.add(dummyObserver); sharedRealm.realmNotifier.addChangeListener(dummyObserver, new RealmChangeListener<Integer>() { @Override public void onChange(Integer dummy) { fail(); } }); sharedRealm.realmNotifier.addChangeListener(sharedRealm, new RealmChangeListener<SharedRealm>() { @Override public void onChange(SharedRealm sharedRealm) { looperThread.testComplete(); } }); sharedRealm.realmNotifier.removeChangeListeners(dummyObserver); new Thread(new Runnable() { @Override public void run() { SharedRealm sharedRealm = getSharedRealm(looperThread.realmConfiguration); sharedRealm.beginTransaction(); sharedRealm.commitTransaction(); sharedRealm.close(); } }).start(); }

Target:
public void removeChangeListeners() { SharedRealm sharedRealm = getSharedRealm(looperThread.realmConfiguration); Integer dummyObserver = 1; looperThread.keepStrongReference.add(dummyObserver); sharedRealm.realmNotifier.addChangeListener(dummyObserver, new RealmChangeListener<Integer>() { @Override public void onChange(Integer dummy) { fail(); } }); sharedRealm.realmNotifier.addChangeListener(sharedRealm, new RealmChangeListener<SharedRealm>() { @Override public void onChange(SharedRealm sharedRealm) { looperThread.testComplete(); } }); sharedRealm.realmNotifier.removeChangeListeners(dummyObserver); makeRemoteChanges(looperThread.realmConfiguration); }
Source:
public void findEncounter_shouldThrowIllegalArgumentExceptionIfGivenVisitIsNull() throws Exception { EncounterParameters encounterParameters = EncounterParameters.instance() .setEncounterType(radiologyProperties.getRadiologyOrderEncounterType()) .setEncounterUuid(VOIDED_ENCOUNTER_UUID); Visit visit = null; expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("visit is required"); radiologyEncounterMatcher.findEncounter(visit, encounterParameters); }

Target:
public void findEncounter_shouldThrowIllegalArgumentExceptionIfGivenVisitIsNull() throws Exception { EncounterParameters encounterParameters = EncounterParameters.instance() .setEncounterType(radiologyProperties.getRadiologyOrderEncounterType()) .setEncounterUuid(VOIDED_ENCOUNTER_UUID); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("visit is required"); radiologyEncounterMatcher.findEncounter(null, encounterParameters); }
Source:
private void scanGuiceModules(Set<Class<?>> scriptClasses) throws IOException { try { Class<?> sysModuleBaseClass = Module.class; Class<?> httpModuleBaseClass = Class.forName("com.google.inject.servlet.ServletModule"); Class<?> sshModuleBaseClass = Class.forName("com.google.gerrit.sshd.CommandModule"); for (Class<?> scriptClass : scriptClasses) { if (sshModuleBaseClass.isAssignableFrom(scriptClass)) { sshModule = ((Class<? extends Module>) scriptClass); } else if (httpModuleBaseClass.isAssignableFrom(scriptClass)) { httpModule = ((Class<? extends Module>) scriptClass); } else if (sysModuleBaseClass.isAssignableFrom(scriptClass)) { sysModule = ((Class<? extends Module>) scriptClass); } } } catch (ClassNotFoundException e) { throw new IOException( "Cannot find base Gerrit classes for Guice Plugin Modules", e); } }

Target:
private void scanGuiceModules(Set<Class<?>> scriptClasses) throws IOException { try { Class<?> sysModuleBaseClass = Module.class; Class<?> httpModuleBaseClass = Class.forName("com.google.inject.servlet.ServletModule"); Class<?> sshModuleBaseClass = Class.forName("com.google.gerrit.sshd.CommandModule"); for (Class<?> scriptClass : scriptClasses) { String scriptClassName = scriptClass.getName(); if (sshModuleBaseClass.isAssignableFrom(scriptClass)) { sshModuleClassName = scriptClassName; } else if (httpModuleBaseClass.isAssignableFrom(scriptClass)) { httpModuleClassName = scriptClassName;; } else if (sysModuleBaseClass.isAssignableFrom(scriptClass)) { sysModuleClassName = scriptClassName;; } } } catch (ClassNotFoundException e) { throw new IOException( "Cannot find base Gerrit classes for Guice Plugin Modules", e); } }
Source:
public static void testGetCentresByBranch() throws MambuApiException { methodName = new Object() {}.getClass().getEnclosingMethod().getName(); System.out.println(methodName = "\nIn " + methodName); OrganizationService organizationService = MambuAPIFactory.getOrganizationService(); String branchId = BRANCH_ID; String offset = "0"; String limit = "500"; System.out.println( "\nIn testGetCentresByBranch" + " BranchID=" + branchId + " Offset=" + offset + " Limit=" + limit); Date d1 = new Date(); List<Centre> centres = organizationService.getCentres(branchId, offset, limit); Date d2 = new Date(); long diff = d2.getTime() - d1.getTime(); System.out.println("Total Centres=" + centres.size() + " for branch=" + branchId + ". Total time=" + diff); for (Centre centre : centres) { System.out.println(" Name=" + centre.getName() + "\tId=" + centre.getId()); } System.out.println(); }

Target:
public static void testGetCentresByBranch() throws MambuApiException { methodName = new Object() {}.getClass().getEnclosingMethod().getName(); System.out.println(methodName = "\nIn " + methodName); OrganizationService organizationService = MambuAPIFactory.getOrganizationService(); String branchId = BRANCH_ID; String offset = "0"; String limit = "500"; System.out.println("\nIn " + methodName + " BranchID=" + branchId + " Offset=" + offset + " Limit=" + limit); Date d1 = new Date(); List<Centre> centres = organizationService.getCentres(branchId, offset, limit); Date d2 = new Date(); long diff = d2.getTime() - d1.getTime(); System.out.println("Total Centres=" + centres.size() + " for branch=" + branchId + ". Total time=" + diff); for (Centre centre : centres) { System.out.println(" Name=" + centre.getName() + "\tId=" + centre.getId()); } System.out.println(); }
Source:
public void checkEntryPermissions(final Optional<User> user, final Entry<? extends Entry, ? extends Version> entry) { if (!entry.getIsPublished()) { if (user.isEmpty()) { throw new CustomWebApplicationException("This entry is not published.", HttpStatus.SC_UNAUTHORIZED); } checkUser(user.get(), entry); } }

Target:
public void checkEntryPermissions(final Optional<User> user, final Entry<? extends Entry, ? extends Version> entry) { if (!entry.getIsPublished()) { if (user.isEmpty()) { throw new CustomWebApplicationException("This entry is not published.", HttpStatus.SC_NOT_FOUND); } checkUser(user.get(), entry); } }
Source:
protected void moveContentToColdStorage(DocumentModel documentModel) throws OperationException, IOException { assertFalse(documentModel.hasFacet(COLD_STORAGE)); try (OperationContext context = new OperationContext(session)) { context.setInput(documentModel); DocumentModel updatedDocModel = (DocumentModel) automationService.run(context, MoveToColdStorage.ID, Map.of()); Blob fileContent = (Blob) updatedDocModel.getPropertyValue(FILE_CONTENT_PROPERTY); Blob coldStorageContent = (Blob) updatedDocModel.getPropertyValue(COLD_STORAGE_CONTENT_PROPERTY); assertEquals(documentModel.getRef(), updatedDocModel.getRef()); assertTrue(updatedDocModel.hasFacet(COLD_STORAGE)); assertEquals(DUMMY_THUMBNAIL_CONTENT, fileContent.getString()); assertEquals(FILE_CONTENT, coldStorageContent.getString()); } }

Target:
protected void moveContentToColdStorage(DocumentModel documentModel) throws OperationException, IOException { try (OperationContext context = new OperationContext(session)) { context.setInput(documentModel); DocumentModel updatedDocModel = (DocumentModel) automationService.run(context, MoveToColdStorage.ID); Blob fileContent = (Blob) updatedDocModel.getPropertyValue(FILE_CONTENT_PROPERTY); Blob coldStorageContent = (Blob) updatedDocModel.getPropertyValue(COLD_STORAGE_CONTENT_PROPERTY); assertEquals(documentModel.getRef(), updatedDocModel.getRef()); assertTrue(updatedDocModel.hasFacet(COLD_STORAGE)); assertEquals(DUMMY_THUMBNAIL_CONTENT, fileContent.getString()); assertEquals(FILE_CONTENT, coldStorageContent.getString()); } }
Source:
private void initializeScriptingMarkerSource() { if (TmfTraceManager.getInstance().getActiveTrace() != null) { ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); for (IMarkerEventSource source : TmfTraceAdapterManager.getAdapters(trace, IMarkerEventSource.class)) { if (source.getClass() == ScriptingMarkerSource.class) { fTraceMarkersList = new ArrayList<>(); fSource = (ScriptingMarkerSource) source; fSource.initializeAdapterMarkersLists(); fSourceStatus = 1; return; } } } else { System.out.println(INVALID_TRACE); return; } }

Target:
private void initializeScriptingMarkerSource() { ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace != null) { for (IMarkerEventSource source : TmfTraceAdapterManager.getAdapters(trace, IMarkerEventSource.class)) { if (source.getClass() == ScriptingMarkerSource.class) { fTraceMarkersList = new ArrayList<>(); fSource = (ScriptingMarkerSource) source; fSource.initializeAdapterMarkersLists(); return; } } } else { System.out.println(INVALID_TRACE); return; } }
Source:
public long read() { long value = nanos.getAndAdd(0); return value; }

Target:
public long read() { return nanos.get(); }
Source:
protected Subject createSubject(final CallbackProperties properties, final X509Certificate certificate, final PublicKey publicKey) throws SAMLComponentBuilderException { String x509Name = properties.getUsername(); if ((NullChecker.isNullish(x509Name) || !checkDistinguishedName(x509Name)) && null != certificate && null != certificate.getSubjectDN()) { x509Name = certificate.getSubjectDN().getName(); } return createSubject(x509Name, publicKey); }

Target:
protected Subject createSubject(final CallbackProperties properties, final X509Certificate certificate, final PublicKey publicKey) throws SAMLComponentBuilderException { String x509Name = properties.getUsername(); if ((NullChecker.isNullish(x509Name) || !checkDistinguishedName(x509Name)) && null != certificate && null != certificate.getSubjectDN()) { x509Name = certificate.getSubjectDN().getName(); } return OpenSAML2ComponentBuilder.getInstance().createSubject(x509Name, publicKey); }