auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testRewrite() { tester().assertThat(new TransformCorrelatedSingleRowSubqueryToProject()) .on(p -> p.lateral( ImmutableList.of(p.symbol("l_nationkey")), p.tableScan(new TableHandle( new ConnectorId("local"), <START> new TpchTableHandle("nation", TINY_SCALE_FACTOR), <END> TestingTransactionHandle.create(), Optional.of(TestingHandle.INSTANCE)), ImmutableList.of(p.symbol("l_nationkey")), ImmutableMap.of(p.symbol("l_nationkey"), new TpchColumnHandle("nationkey", BIGINT))), p.project( Assignments.of(p.symbol("l_expr2"), expression("l_nationkey + 1")), p.values( ImmutableList.of(), ImmutableList.of(ImmutableList.of()))))) .matches(project( ImmutableMap.of( ("l_expr2"), PlanMatchPattern.expression("l_nationkey + 1"), "l_nationkey", PlanMatchPattern.expression("l_nationkey")), tableScan("nation", ImmutableMap.of("l_nationkey", "nationkey")))); }</code><technical_language>TpchTransactionHandle.INSTANCE TestingTransactionHandle.create() here? I left this question for @arhimondr wrote TestingTransactionHandle ;)</technical_language>

Target:
public void testRewrite() { tester().assertThat(new TransformCorrelatedSingleRowSubqueryToProject()) .on(p -> p.lateral( ImmutableList.of(p.symbol("l_nationkey")), p.tableScan(new TableHandle( new ConnectorId("local"), new TpchTableHandle("nation", TINY_SCALE_FACTOR), TestingTransactionHandle.create(), Optional.empty()), ImmutableList.of(p.symbol("l_nationkey")), ImmutableMap.of(p.symbol("l_nationkey"), new TpchColumnHandle("nationkey", BIGINT))), p.project( Assignments.of(p.symbol("l_expr2"), expression("l_nationkey + 1")), p.values( ImmutableList.of(), ImmutableList.of(ImmutableList.of()))))) .matches(project( ImmutableMap.of( ("l_expr2"), PlanMatchPattern.expression("l_nationkey + 1"), "l_nationkey", PlanMatchPattern.expression("l_nationkey")), tableScan("nation", ImmutableMap.of("l_nationkey", "nationkey")))); }
Source:
<code>public void clientCallback(final ClientResponse response) throws Exception { byte status = response.getStatus(); if (status == ClientResponse.SUCCESS) { <START> if (m_csvLine instanceof ImportSuccessCallback) { <END> m_es.execute(new Runnable() { @Override public void run() { try { m_csvLine.success(response); } catch (Exception e) { m_log.error("Exception in success client callback", e); } } }); } } else { m_failedCount.incrementAndGet(); m_errHandler.handleError(m_csvLine, response, response.getStatusString()); } long currentCount = m_processedCount.incrementAndGet(); if (currentCount % m_reportEveryNRows == 0) { m_log.info("Inserted " + (currentCount - m_failedCount.get()) + " rows"); } }</code><technical_language>Instead of instance add a boolean m_reportSuccess cleaner</technical_language>

Target:
public void clientCallback(final ClientResponse response) throws Exception { byte status = response.getStatus(); if (status == ClientResponse.SUCCESS) { if (m_callbackExecutor != null && m_successCallback != null) { m_callbackExecutor.execute(new Runnable() { @Override public void run() { m_successCallback.success(m_csvLine, response); } }); } } else { m_failedCount.incrementAndGet(); m_errHandler.handleError(m_csvLine, response, response.getStatusString()); } long currentCount = m_processedCount.incrementAndGet(); if (currentCount % m_reportEveryNRows == 0) { m_log.info("Inserted " + (currentCount - m_failedCount.get()) + " rows"); } }
Source:
<code>public boolean isOutputEmpty() { if (this.rows == null || this.rows.size() <= 0) { <START> throw new IllegalStateException("Internal memory corrupted! Could not be Null or empty!"); <END> } return this.rows.size() <= 1 && this.rows.contains(OUTPUT_EMPTY_MARK); }</code><technical_language>"Internal memory corrupted!" This is a bit frightening in java, mention memory state (except if checking java memory state). say: "Output empty"</technical_language>

Target:
public boolean isOutputEmpty() { return rows.size() <= 0; }
Source:
<code>public List<String> componentPathsSelector(Module module, String group, int index ){ List<String> result = new ArrayList<String>(); if (!JOB.equals(module.getType())) { return result; } if (module.getProperties().containsKey(TRIGGER)) { result.add(REGISTRAR_WITH_TRIGGER_REF); } <START> else if (module.getProperties().containsKey("cron")) { <END> result.add(REGISTRAR_WITH_CRON); } else { result.add(REGISTRAR); } return result; }</code><technical_language>CRON constant</technical_language>

Target:
public List<String> componentPathsSelector(Module module, String group, int index ){ List<String> result = new ArrayList<String>(); if (!JOB.equals(module.getType())) { return result; } if (module.getProperties().containsKey(TRIGGER)) { result.add(REGISTRAR_WITH_TRIGGER_REF); } else if (module.getProperties().containsKey(CRON)) { result.add(REGISTRAR_WITH_CRON); } else if (module.getProperties().containsKey(FIXED_DELAY)) { result.add(REGISTRAR_WITH_FIXED_DELAY); } else { result.add(REGISTRAR); } return result; }
Source:
<code>public static Set<File> findAllViewFilesInWorkspace(SubMonitor monitor) { final SubMonitor subMonitor = SubMonitor.convert(monitor, 100); final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); final int projects = root.getProjects().length; <START> final int stepSize = 100 / projects; <END> try { return collectFiles(root, new Predicate<IFile>() { @Override public boolean apply(IFile input) { return input.getFileExtension().equals("view"); } }, subMonitor, stepSize); } catch (final CoreException ex) { return new LinkedHashSet<File>(); } }</code><technical_language>This 0 if more 100 projects. I suggest number of projects for subMonitor simply tick for project, e.g. final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); final int numberOfProjects = root.getProjects().length; final SubMonitor subMonitor = SubMonitor.convert(monitor, numberOfProjects); remove stepSize variable parameter</technical_language>

Target:
public static Set<IFile> findAllViewFilesInWorkspace(SubMonitor monitor) { final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); final SubMonitor subMonitor = SubMonitor.convert(monitor, root.getProjects().length); try { return collectViewFiles(root, subMonitor); } catch (final CoreException ex) { return new LinkedHashSet<IFile>(); } }
Source:
<code>public double apply(float[] itemVector) { <START> double total = 0.0; <END> for (double[] userFeatureVector : userFeaturesVectorsList) { total += VectorMath.dot(userFeatureVector, itemVector); } return total / userFeaturesVectorsList.size(); }</code><technical_language>profile this if overhead for one-user case is noticeable. This creating accessing a List iterator() time. If array used. I bother I this is a hot spot</technical_language>

Target:
public double apply(float[] itemVector) { double total = 0.0; for (double[] userFeatureVector : userFeaturesVectors) { total += VectorMath.dot(userFeatureVector, itemVector); } return total / userFeaturesVectors.length; }
Source:
<code>protected @Nullable Pair<ICallStackElement, AggregatedCallSite> getProfiledStackTrace(@NonNull ITmfEvent event) { Map<String, Collection<Object>> callStack = getCallStack(event); if (callStack.isEmpty()) { return null; } ICallStackElement element = getElement(event); Collection<Object> kernelCs = callStack.get(KERNEL_STACK_NAME); if (kernelCs == null) { kernelCs = Collections.emptyList(); } Collection<Object> userCs = callStack.get(USER_STACK_NAME); if (userCs == null) { userCs = Collections.emptyList(); } if (kernelCs.size() + userCs.size() == 0) { long[] stack = new long[1]; stack[0] = 0; return new Pair<>(element, getCallSite(element, stack, event.getTimestamp().getValue())); } long[] stack = new long[userCs.size() + kernelCs.size()]; int i = 0; for (Object call : userCs) { <START> stack[i] = (long) call; <END> i++; } for (Object call : kernelCs) { stack[i] = (long) call; i++; } return new Pair<>(element, getCallSite(element, stack, event.getTimestamp().getValue())); }</code><technical_language>Instanceof checks 100% long. :)</technical_language>

Target:
protected @Nullable Pair<ICallStackElement, AggregatedCallSite> getProfiledStackTrace(@NonNull ITmfEvent event) { Map<String, Collection<Object>> callStack = getCallStack(event); if (callStack.isEmpty()) { return null; } ICallStackElement element = getElement(event); Collection<Object> kernelCs = callStack.get(KERNEL_STACK_NAME); if (kernelCs == null) { kernelCs = Collections.emptyList(); } Collection<Object> userCs = callStack.get(USER_STACK_NAME); if (userCs == null) { userCs = Collections.emptyList(); } if (kernelCs.size() + userCs.size() == 0) { long[] stack = new long[1]; stack[0] = 0; return new Pair<>(element, getCallSite(element, stack, event.getTimestamp().getValue())); } long[] stack = new long[userCs.size() + kernelCs.size()]; int i = 0; for (Object call : userCs) { stack[i] = (call instanceof Long) ? (long) call : UNDEFINED_SYMBOL; i++; } for (Object call : kernelCs) { stack[i] = (call instanceof Long) ? (long) call : UNDEFINED_SYMBOL; i++; } return new Pair<>(element, getCallSite(element, stack, event.getTimestamp().getValue())); }
Source:
<code>public Response activate(Action action) { HotPlugDiskToVmParameters params = new HotPlugDiskToVmParameters(((BackendDisksResource) collection).parentId, <START> Guid.createGuidFromString(id)); <END> return performAction(VdcActionType.HotPlugDiskToVm, params); }</code><technical_language>Instead of Guid.createGuidFromString(id)), user 'guid' (the ID is saved a Guid for convenience)</technical_language>

Target:
public Response activate(Action action) { HotPlugDiskToVmParameters params = new HotPlugDiskToVmParameters(((BackendDisksResource) collection).parentId, guid); return performAction(VdcActionType.HotPlugDiskToVm, params); }
Source:
<code>private List<List<ElementTag>> createSpecialSectionsForSectionRow(List<String> sectionNames, int sectionIndex) { List<List<ElementTag>> specialSections = new ArrayList<List<ElementTag>>(); for (int i = 0; i < sectionNames.size(); i += 3) { List<ElementTag> specialSectionGroup = new ArrayList<ElementTag>(); for (int j = 0; j < 3 && i + j < sectionNames.size(); j++) { String name = Const.ParamsNames.INSTRUCTOR_SECTION_GROUP + sectionIndex + Const.ParamsNames.INSTRUCTOR_SECTION + (i + j); if (isSectionSpecial()) { ElementTag checkbox = createCheckBox(sectionNames.get(i + j), name, sectionNames.get(i + j), <START> i + j == sectionIndex); <END> specialSectionGroup.add(checkbox); } else { ElementTag checkbox = createCheckBox(sectionNames.get(i + j), name, sectionNames.get(i + j), false); specialSectionGroup.add(checkbox); } } specialSections.add(specialSectionGroup); } return specialSections; }</code><technical_language>extract out <code>i + j == sectionIndex</code> explaining variable? current code is hard understand, try improve if can</technical_language>

Target:
private List<List<ElementTag>> createSpecialSectionsForSectionRow(List<String> sectionNames, int sectionIndex) { List<List<ElementTag>> specialSections = new ArrayList<List<ElementTag>>(); for (int i = 0; i < sectionNames.size(); i += 3) { List<ElementTag> specialSectionGroup = new ArrayList<ElementTag>(); for (int j = 0; j < 3 && i + j < sectionNames.size(); j++) { int positionOfNewSection = i + j; String name = Const.ParamsNames.INSTRUCTOR_SECTION_GROUP + sectionIndex + Const.ParamsNames.INSTRUCTOR_SECTION + positionOfNewSection; ElementTag checkbox; if (isSectionSpecial()) { boolean isPositionMatchedWithSection = positionOfNewSection == sectionIndex; checkbox = createCheckBox(sectionNames.get(positionOfNewSection), name, sectionNames.get(positionOfNewSection), isPositionMatchedWithSection); } else { checkbox = createCheckBox(sectionNames.get(positionOfNewSection), name, sectionNames.get(positionOfNewSection), false); } specialSectionGroup.add(checkbox); } specialSections.add(specialSectionGroup); } return specialSections; }
Source:
<code>public void testNoBuildRevision() throws Exception { FreeStyleProject prj = jRule.createFreeStyleProject(); prj.setScm(new GitSCM("<LINK_0>")); prj.getPublishersList().add(new GitHubCommitNotifier()); <START> Build b = prj.scheduleBuild2(0, new Cause.UserIdCause(), new BuildData()).get(); <END> jRule.assertBuildStatus(Result.FAILURE, b); jRule.assertLogContains(BuildDataHelper_NoLastRevisionError(), b); }</code><technical_language>broken in 2.0</technical_language>

Target:
public void testNoBuildRevision() throws Exception { FreeStyleProject prj = jRule.createFreeStyleProject(); prj.setScm(new GitSCM("<LINK_0>")); prj.getPublishersList().add(new GitHubCommitNotifier()); Build b = safelyGenerateBuild(prj); jRule.assertBuildStatus(Result.FAILURE, b); jRule.assertLogContains(BuildDataHelper_NoLastRevisionError(), b); }
Source:
<code>public JdbcTpchDataSource(TpchTable table, List<JDBCType> columns, double scaleFactor) { checkArgument(scaleFactor > 0.0, "scaleFactor should be greater than zero"); this.table = requireNonNull(table, "table is null"); <START> this.columnTypes = columns; <END> this.scaleFactor = scaleFactor; }</code><technical_language>ImmutableList.copyOf(...)</technical_language>

Target:
public JdbcTpchDataSource(TpchTable table, List<JDBCType> columns, double scaleFactor) { checkArgument(scaleFactor > 0.0, "scaleFactor should be greater than zero"); this.table = requireNonNull(table, "table is null"); this.columnTypes = ImmutableList.copyOf(columns); this.scaleFactor = scaleFactor; }
Source:
<code>public void createsPullComment() throws Exception { final String body = "test-body"; final String commit = "test-commit-id"; final String path = "test-path"; final int position = 4; final String response = pulls(body, commit, path, position).toString(); final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple(HttpURLConnection.HTTP_CREATED, response) ).next(new MkAnswer.Simple(HttpURLConnection.HTTP_OK, response)) <START> .start(); <END> final Pull pull = createPull(); final RtPullComments pullComments = new RtPullComments( new ApacheRequest(container.home()), pull ); try { final PullComment pullComment = pullComments.post( body, commit, path, position ); MatcherAssert.assertThat( container.take().method(), Matchers.equalTo(Request.POST) ); MatcherAssert.assertThat( new PullComment.Smart(pullComment).commitId(), Matchers.equalTo(commit) ); } finally { container.stop(); } }</code><technical_language>indentation problem. checkstyle complain it</technical_language>

Target:
public void createsPullComment() throws Exception { final String body = "test-body"; final String commit = "test-commit-id"; final String path = "test-path"; final int position = 4; final String response = pulls(body, commit, path, position).toString(); final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple(HttpURLConnection.HTTP_CREATED, response) ).next(new MkAnswer.Simple(HttpURLConnection.HTTP_OK, response)) .start(); final Pull pull = Mockito.mock(Pull.class); Mockito.doReturn(repo()).when(pull).repo(); final RtPullComments pullComments = new RtPullComments( new ApacheRequest(container.home()), pull ); try { final PullComment pullComment = pullComments.post( body, commit, path, position ); MatcherAssert.assertThat( container.take().method(), Matchers.equalTo(Request.POST) ); MatcherAssert.assertThat( new PullComment.Smart(pullComment).commitId(), Matchers.equalTo(commit) ); } finally { container.stop(); } }
Source:
<code>public void listenBreakBlock(BlockEvent.BreakEvent event) { <START> if ( ! ( event.block instanceof BlockSecurity ) ) <END> return; BlockSecurity self = (BlockSecurity) event.block; EntityPlayer breaker = event.getPlayer(); TileSecurity te = self.getTileEntity( event.world, event.x, event.y, event.z ); String owner = te.getOwnerName(); if ( owner.equals( breaker.getCommandSenderName() ) ) return; AELog.info( "[AE2] %s broke a security terminal owned by %s at (DIM%d, %d, %d, %d)", breaker.getDisplayName(), owner, event.world.getWorldInfo().getVanillaDimension(), event.x, event.y, event.z ); }</code><technical_language>I nit-picky for future expansion, is re-use more fields methods binding variables. If get a NPE, is easier identify variable NPE. variables</technical_language>

Target:
public void listenBreakBlock(BlockEvent.BreakEvent event) { if ( ! ( event.block instanceof BlockSecurity ) ) return; BlockSecurity self = (BlockSecurity) event.block; EntityPlayer breaker = event.getPlayer(); TileSecurity te = self.getTileEntity( event.world, event.x, event.y, event.z ); String owner = getOwnerNameForLog( te.getOwner() ); if ( owner.equals( breaker.getCommandSenderName() ) ) return; AELog.info( "[AE2] %s broke a security terminal owned by %s at (DIM%d, %d, %d, %d)", breaker.getDisplayName(), owner, event.world.getWorldInfo().getVanillaDimension(), event.x, event.y, event.z ); }
Source:
<code>private static boolean hasSiblings(DetailAST ast) { <START> return ast.getNextSibling() != null || ast.getParent().getFirstChild() != ast; <END> }</code><technical_language>I confused, this is changing number of children number of siblings? ast.getParent().getNumberOfChildren() != 1 ast.hasNextSibling() || ast.getParent().getFirstChild() != ast I grasping equality of this</technical_language>

Target:
private static boolean hasSiblings(DetailAST ast) { return ast.getPreviousSibling() != null || ast.getNextSibling() != null; }
Source:
<code>public static String streamToString(InputStream in) { try { Scanner s = new Scanner(in, "UTF-8"); s.useDelimiter("\\A"); String str = s.hasNext() ? s.next() : null; s.close(); return str; } finally { <START> close(in); <END> } }</code><technical_language>This applies other new close()s - in some places do IOUtils.closeQuietly() swallow exception. This a convention built time sync-android library. pros cons approach: in hand generally bad practice silently swallow exceptions, other hand helpful throw exceptions out API users especially do them</technical_language>

Target:
public static String streamToString(InputStream in) { try { return IOUtils.toString(in, "UTF-8"); } catch (IOException e) { throw new RuntimeException("Error reading stream.", e); } finally { close(in); } }
Source:
<code>public static <I> void checkIdType(I entityId) { final Class<?> idClass = entityId.getClass(); if (SUPPORTED_ID_TYPES.contains(idClass)) { return; } <START> final boolean isMessage = entityId instanceof Message; <END> if (!isMessage){ throw unsupportedIdType(idClass); } }</code><technical_language>conversation, please check for exact type</technical_language>

Target:
public static <I> void checkIdType(I entityId) { final Class<?> idClass = entityId.getClass(); if (supportedSimpleIdTypes.contains(idClass)) { return; } final boolean isMessage = entityId instanceof Message; if (!isMessage){ throw unsupportedIdType(idClass); } }
Source:
<code>public Optional<QualityGateData> getQualityGate(DbSession dbSession, OrganizationDto organization, long componentId) { Optional<Long> qualityGateId = dbClient.projectQgateAssociationDao().selectQGateIdByComponentId(dbSession, componentId); if (qualityGateId.isPresent()) { return Optional.of(new QualityGateData(getById(dbSession, qualityGateId.get()), false)); } else { QualityGateDto defaultQualityGate = dbClient.qualityGateDao().selectByOrganizationAndUuid(dbSession, organization, organization.getDefaultQualityGateUuid()); <START> if (defaultQualityGate == null) { <END> return Optional.empty(); } return Optional.of(new QualityGateData(defaultQualityGate, true)); } }</code><technical_language>fail this case</technical_language>

Target:
public QualityGateData getQualityGate(DbSession dbSession, OrganizationDto organization, long componentId) { Optional<Long> qualityGateId = dbClient.projectQgateAssociationDao().selectQGateIdByComponentId(dbSession, componentId); if (qualityGateId.isPresent()) { QualityGateDto qualityGate = checkFound(dbClient.qualityGateDao().selectById(dbSession, qualityGateId.get()), "No quality gate has been found for id %s", qualityGateId); return new QualityGateData(qualityGate, false); } else { QualityGateDto defaultQualityGate = dbClient.qualityGateDao().selectByOrganizationAndUuid(dbSession, organization, organization.getDefaultQualityGateUuid()); checkState(defaultQualityGate != null, "Unable to find the quality gate [%s] for organization [%s]", organization.getDefaultQualityGateUuid(), organization.getUuid()); return new QualityGateData(defaultQualityGate, true); } }
Source:
<code>protected void preValidateLaunchArguments(List<String> args) { if (args.contains("--json")) { String jsonFile = reqVal(args, "--json"); try { fileToJSON(jsonFile); } catch (ParserException ex) { errorMessage("Could not launch, syntax error in json file: " + jsonFile, CLIENT_ERROR); } catch (IOException e) { <START> errorMessage("Could not launch, syntax error in json file: " + jsonFile, CLIENT_ERROR); <END> } } if (args.contains("--yaml")) { String yamlFile = reqVal(args, "--yaml"); try { fileToJSON(yamlFile); } catch (ParserException ex) { errorMessage("Could not launch, syntax error in yaml file: " + yamlFile, CLIENT_ERROR); } catch (IOException e) { errorMessage("Could not launch, syntax error in yaml file: " + yamlFile, CLIENT_ERROR); } } }</code><technical_language>This fail if is argument --json; I want do here. call optVal do check if is null</technical_language>

Target:
protected void preValidateLaunchArguments(List<String> args) { List<String> argsCopy = new java.util.ArrayList(args); String jsonFile = optVal(argsCopy, "--json", null); String yamlFile = optVal(argsCopy, "--yaml", null); if (jsonFile != null) { try { fileToJSON(jsonFile); } catch (ParserException ex) { errorMessage("Could not launch, syntax error in json file: " + jsonFile, CLIENT_ERROR); } catch (Exception e) { LOG.error("Error prevalidating input file: " + jsonFile, e); } } if (yamlFile != null) { try { fileToJSON(yamlFile); } catch (ParserException ex) { errorMessage("Could not launch, syntax error in yaml file: " + yamlFile, CLIENT_ERROR); } catch (Exception e) { LOG.error("Error prevalidating input file: " + yamlFile, e); } } }
Source:
<code>protected void executeQueryCommand() { VDSBrokerFrontend vdsBroker = getVdsBroker(); <START> if (getDbFacade().getStorageDomainDao().getForStoragePool(getStorageDomainId(), getStoragePoolId()) == null) { <END> getQueryReturnValue().setExceptionString("Storage Domain does not exist in the Data Center"); getQueryReturnValue().setSucceeded(false); return; } VDSReturnValue imagesListResult = vdsBroker.RunVdsCommand(VDSCommandType.GetImagesList, new GetImagesListVDSCommandParameters(getStorageDomainId(), getStoragePoolId())); @SuppressWarnings("unchecked") List<Guid> imagesList = (List<Guid>) imagesListResult.getReturnValue(); List<DiskImage> fromDao = getDbFacade().getDiskImageDao().getAllSnapshotsForStorageDomain(getStorageDomainId()); for (DiskImage image : fromDao) { imagesList.remove(image.getId()); } List<Disk> unregisteredDisks = new ArrayList<Disk>(); for (Guid unregisteredDiskId : imagesList) { GetUnregisteredDiskQueryParameters unregQueryParams = new GetUnregisteredDiskQueryParameters( unregisteredDiskId, getStorageDomainId(), getStoragePoolId()); VdcQueryReturnValue unregQueryReturn = getBackend().runInternalQuery(VdcQueryType.GetUnregisteredDisk, unregQueryParams); if (unregQueryReturn.getSucceeded()) { unregisteredDisks.add(unregQueryReturn.<Disk>getReturnValue()); } else { log.error("Could not get populated disk, reason: " + unregQueryReturn.getExceptionString()); } } getQueryReturnValue().setReturnValue(unregisteredDisks); }</code><technical_language>check if extracted a common place</technical_language>

Target:
protected void executeQueryCommand() { VDSBrokerFrontend vdsBroker = getVdsBroker(); if (getDbFacade().getStorageDomainDao().getForStoragePool(getStorageDomainId(), getStoragePoolId()) == null) { getQueryReturnValue().setExceptionString(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST_IN_DATA_CENTER.toString()); getQueryReturnValue().setSucceeded(false); return; } VDSReturnValue imagesListResult = vdsBroker.RunVdsCommand(VDSCommandType.GetImagesList, new GetImagesListVDSCommandParameters(getStorageDomainId(), getStoragePoolId())); @SuppressWarnings("unchecked") List<Guid> imagesList = (List<Guid>) imagesListResult.getReturnValue(); List<DiskImage> fromDao = getDbFacade().getDiskImageDao().getAllSnapshotsForStorageDomain(getStorageDomainId()); for (DiskImage image : fromDao) { imagesList.remove(image.getId()); } List<Disk> unregisteredDisks = new ArrayList<Disk>(); for (Guid unregisteredDiskId : imagesList) { GetUnregisteredDiskQueryParameters unregQueryParams = new GetUnregisteredDiskQueryParameters( unregisteredDiskId, getStorageDomainId(), getStoragePoolId()); VdcQueryReturnValue unregQueryReturn = getBackend().runInternalQuery(VdcQueryType.GetUnregisteredDisk, unregQueryParams); if (unregQueryReturn.getSucceeded()) { unregisteredDisks.add(unregQueryReturn.<Disk>getReturnValue()); } else { log.error("Could not get populated disk, reason: " + unregQueryReturn.getExceptionString()); } } getQueryReturnValue().setReturnValue(unregisteredDisks); }
Source:
<code>public void evaluate_shouldReturnAllPatientsTakingSpecifiedDrugBeforeDate() throws Exception { List drugSetList = new ArrayList<Concept>(); drugSetList.add(new Concept(88)); cohortDefinition.setDrugSets(drugSetList); cohortDefinition.setActivatedOnOrBefore(DateUtil.getDateTime(2008, 8, 2)); Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); <START> System.out.println("Taking Particular Drug in Date Range" + cohort.getMemberIds() + " " + cohortDefinition); <END> Assert.assertTrue(cohort.contains(2)); }</code><technical_language>a this? <LINK_0></technical_language>

Target:
public void evaluate_shouldReturnAllPatientsTakingSpecifiedDrugBeforeDate() throws Exception { List drugSetList = new ArrayList<Concept>(); drugSetList.add(new Concept(88)); cohortDefinition.setDrugSets(drugSetList); cohortDefinition.setActivatedOnOrBefore(DateUtil.getDateTime(2008, 8, 2)); Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); Assert.assertTrue(cohort.contains(2)); }
Source:
<code>protected DDMStructure(Parcel in, ClassLoader classLoader) { Parcelable[] array = in.readParcelableArray(Field.class.getClassLoader()); fields = new ArrayList(Arrays.asList(array)); locale = (Locale) in.readSerializable(); name = in.readString(); <START> description = in.readString(); <END> }</code><technical_language>new fields added here, right</technical_language>

Target:
protected DDMStructure(Parcel in, ClassLoader classLoader) { Parcelable[] fieldsArray = in.readParcelableArray(Field.class.getClassLoader()); fields = new ArrayList(Arrays.asList(fieldsArray)); locale = (Locale) in.readSerializable(); name = in.readString(); description = in.readString(); Parcelable[] pagesArray = in.readParcelableArray(FormPage.class.getClassLoader()); pages = new ArrayList(Arrays.asList(pagesArray)); successPage = in.readParcelable(SuccessPage.class.getClassLoader()); }
Source:
<code>public DirectDebitPaymentLinksBuilder withEvents(URI events) { <START> this.events = new Link(events.toString(), GET);; <END> return this; }</code><technical_language>extra ; end of line</technical_language>

Target:
public DirectDebitPaymentLinksBuilder withEvents(URI events) { this.events = new Link(events.toString(), GET); return this; }
Source:
<code>protected void removeHtmlClass(final String className) { <START> if (!(this.htmlClassList == null || Util.empty(className))) { <END> this.htmlClassList.remove(className); } }</code><technical_language>I tend code this wrapping negative....this.htmlClassList != null && !Util.empty(className)...but is me</technical_language>

Target:
protected void removeHtmlClass(final String className) { if (this.htmlClasses != null && !Util.empty(className)) { this.htmlClasses.remove(className); } }
Source:
<code>protected CloseableIterator<GenericRecord> intermediateRowIterator() throws IOException { final Closer closer = Closer.create(); final byte[] buffer = new byte[InputEntity.DEFAULT_FETCH_BUFFER_SIZE]; final InputEntity.CleanableFile file = closer.register(source.fetch(temporaryDirectory, buffer)); final Schema writerSchema = dataFileSchema(file.file()); if (readerSchema == null) { readerSchema = writerSchema; } final GenericDatumReader<GenericRecord> datumReader = new GenericDatumReader<>(writerSchema, readerSchema); <START> final DataFileReader<GenericRecord> dataFileReader = new DataFileReader<>(file.file(), datumReader); <END> return new CloseableIterator<GenericRecord>() { @Override public boolean hasNext() { return dataFileReader.hasNext(); } @Override public GenericRecord next() { return dataFileReader.next(); } @Override public void close() throws IOException { closer.close(); } }; }</code><technical_language>dataFileReader registered closer</technical_language>

Target:
protected CloseableIterator<GenericRecord> intermediateRowIterator() throws IOException { final Closer closer = Closer.create(); final byte[] buffer = new byte[InputEntity.DEFAULT_FETCH_BUFFER_SIZE]; try { final InputEntity.CleanableFile file = closer.register(source.fetch(temporaryDirectory, buffer)); final GenericDatumReader<GenericRecord> datumReader = new GenericDatumReader<>(); final DataFileReader<GenericRecord> dataFileReader = new DataFileReader<>(file.file(), datumReader); final Schema writerSchema = dataFileReader.getSchema(); if (readerSchema == null) { readerSchema = writerSchema; } datumReader.setSchema(writerSchema); datumReader.setExpected(readerSchema); closer.register(dataFileReader); return new CloseableIterator<GenericRecord>() { @Override public boolean hasNext() { return dataFileReader.hasNext(); } @Override public GenericRecord next() { return dataFileReader.next(); } @Override public void close() throws IOException { closer.close(); } }; } catch (Exception e) { closer.close(); throw new RuntimeException(e); } }
Source:
<code>public void addExistingModelElements2() { final EClass foo = (EClass) testPackage.getEClassifier("Foo"); final EStructuralFeature state = foo.getEStructuralFeature("state"); final EClassifier intType = typesPackage.getEClassifier("int"); final EObjectSelectionStrategy canary = mock(EObjectSelectionStrategy.class); when(canary.collectExistingObjects(any(EObject.class), any(EReference.class), anyCollectionOf(EObject.class))) .then(new Answer<Collection<EObject>>() { @SuppressWarnings("unchecked") @Override public Collection<EObject> answer(InvocationOnMock invocation) throws Throwable { return (Collection<EObject>) invocation.getArguments()[2]; } }); <START> factory.addEObjectSelectionStrategyProvider(provider(canary)); <END> final boolean[] doIt = { true }; Display.getDefault().asyncExec(selectFirstElementInDialog(doIt)); fixture.addExistingModelElements(state, EcorePackage.Literals.ETYPED_ELEMENT__ETYPE); doIt[0] = false; verify(canary).collectExistingObjects(eq(state), eq(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE), anyCollectionOf(EObject.class)); assertThat(state.getEType(), is(intType)); assertThat(state.getLowerBound(), is(1)); verifyNoMoreInteractions(openStrategy); }</code><technical_language>change I explain hang is this. Instead of adding strategy service factory now. jenkins produces a deadlock</technical_language>

Target:
public void addExistingModelElements2() { final EClass foo = (EClass) testPackage.getEClassifier("Foo"); final EStructuralFeature state = foo.getEStructuralFeature("state"); final EClassifier intType = typesPackage.getEClassifier("int"); final EObjectSelectionStrategy canary = mock(EObjectSelectionStrategy.class); when(canary.collectExistingObjects(any(EObject.class), any(EReference.class), anyCollectionOf(EObject.class))) .then(new Answer<Collection<EObject>>() { @SuppressWarnings("unchecked") @Override public Collection<EObject> answer(InvocationOnMock invocation) throws Throwable { return (Collection<EObject>) invocation.getArguments()[2]; } }); register(vendor(canary)); final boolean[] doIt = { true }; Display.getDefault().asyncExec(selectFirstElementInDialog(doIt)); fixture.addExistingModelElements(state, EcorePackage.Literals.ETYPED_ELEMENT__ETYPE); doIt[0] = false; verify(canary).collectExistingObjects(eq(state), eq(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE), anyCollectionOf(EObject.class)); assertThat(state.getEType(), is(intType)); assertThat(state.getLowerBound(), is(1)); verifyNoMoreInteractions(openStrategy); }
Source:
<code>public static IStatus removeXmlFile(File toDelete) { boolean valid = xmlFileIsActive(toDelete); if(valid) { <START> xmlFiles.remove(toDelete); <END> File folder = getXmlFilesPath().toFile(); File[] files = folder.listFiles(); for(int i = 0; i < files.length; i++) { if(files[i].getName().equals(toDelete.getName())) { files[i].delete(); } } return Status.OK_STATUS; } return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The XML file is not an active XML Analysis"); }</code><technical_language>implement export feature</technical_language>

Target:
public static IStatus removeXmlFile(File toDelete) { if(!xmlFileIsActive(toDelete)) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The XML file is not an active XML Analysis"); } toDelete.delete(); return Status.OK_STATUS; }
Source:
<code>public void open() throws TTransportException { <START> throw new RuntimeException("Not implemented"); <END> }</code><technical_language>standard java NotSupportedException</technical_language>

Target:
public void open() throws TTransportException { throw new UnsupportedOperationException(); }
Source:
<code>public static Map<String, String> getFilteredExecutionInfo(Object executionRequirementsUnchecked, Rule rule) throws EvalException { <START> Map<String, String> executionInfo = Maps.newLinkedHashMap(); <END> executionInfo.putAll(getExecutionInfoFromTags(rule)); if (executionRequirementsUnchecked != Runtime.NONE) { executionInfo.putAll(TargetUtils.filter( SkylarkDict.castSkylarkDictOrNoneToDict( executionRequirementsUnchecked, String.class, String.class, "execution_requirements"))); } return executionInfo; }</code><technical_language>LinkedHashMap opposed immutablemap</technical_language>

Target:
public static ImmutableMap<String, String> getFilteredExecutionInfo(Object executionRequirementsUnchecked, Rule rule) throws EvalException { Map<String, String> executionInfoBuilder = new HashMap<>(); executionInfoBuilder.putAll(TargetUtils.filter( SkylarkDict.castSkylarkDictOrNoneToDict( executionRequirementsUnchecked, String.class, String.class, "execution_requirements"))); getExecutionInfo(rule).forEach(executionInfoBuilder::putIfAbsent); return ImmutableMap.copyOf(executionInfoBuilder); }
Source:
<code>public void testGetRequestParameterListNoResponseType() throws IOException { final Ds3DocSpecParser docSpecParser = new Ds3DocSpecParserImpl(new NameMapper()); final Ds3DocSpec docSpec = docSpecParser.getDocSpec(CCodeGenerator_Test.class.getResourceAsStream("/input/testCommandDocumentation.json")); <START> final ImmutableList<Parameter> paramList = RequestConverter.getParamList("", docSpec); <END> assertEquals(paramList.size(), 2); assertEquals(RequestHelper.paramListToString(paramList), "const ds3_client* client, const ds3_request* request"); }</code><technical_language>empty doc spec simpler ... = RequestConverter.getParamList("", new Ds3DocSpecEmptyImpl());</technical_language>

Target:
public void testGetRequestParameterListNoResponseType() throws IOException { final ImmutableList<Parameter> paramList = RequestConverter.getParamList("", new Ds3DocSpecEmptyImpl()); assertEquals(paramList.size(), 2); assertEquals(RequestHelper.paramListToString(paramList), "const ds3_client* client, const ds3_request* request"); }
Source:
<code>public long count(String name, String namePattern, HivePrincipal principal) { final CriteriaBuilder cb = criteriaBuilder(); final CriteriaQuery<Network> criteria = cb.createQuery(Network.class); final Root<Network> from = criteria.from(Network.class); final Predicate[] nameAndPrincipalPredicates = CriteriaHelper.networkListPredicates(cb, from, ofNullable(name), ofNullable(namePattern), ofNullable(principal)); criteria.where(nameAndPrincipalPredicates); final TypedQuery<Network> query = createQuery(criteria); <START> return query.getResultList().size(); <END> }</code><technical_language>Change getResultList().size() predicate count</technical_language>

Target:
public long count(String name, String namePattern, HivePrincipal principal) { final CriteriaBuilder cb = criteriaBuilder(); final CriteriaQuery<Long> criteria = cb.createQuery(Long.class); final Root<Network> from = criteria.from(Network.class); final Predicate[] nameAndPrincipalPredicates = CriteriaHelper.networkListPredicates(cb, from, ofNullable(name), ofNullable(namePattern), ofNullable(principal)); criteria.where(nameAndPrincipalPredicates); criteria.select(cb.count(from)); return count(criteria); }
Source:
<code>protected void performProfilesActions(final Guid networkGuid) { List<VnicProfileModel> profileModels = (List<VnicProfileModel>) getProfiles().getItems(); <START> List<VnicProfileModel> profileModelsToRemove = new ArrayList<VnicProfileModel>(profileModels); <END> profileModelsToRemove.removeAll(profileModels); final List<VnicProfileModel> profileModelsToAdd = new ArrayList<VnicProfileModel>(); for (VnicProfileModel profileModel : profileModels) { if (profileModel instanceof NewVnicProfileModel) { profileModelsToAdd.add(profileModel); } } startProgress(null); performVnicProfileAction(VdcActionType.RemoveVnicProfile, profileModelsToRemove, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { performVnicProfileAction(VdcActionType.AddVnicProfile, profileModelsToAdd, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { stopProgress(); cancel(); } }, networkGuid); } }, networkGuid); }</code><technical_language>I meant originalProfileModels profileModels, moment profileModelsToRemove end empty ArrayList</technical_language>

Target:
protected void performProfilesActions(final Guid networkGuid) { List<VnicProfileModel> profileModels = (List<VnicProfileModel>) getProfiles().getItems(); List<VnicProfileModel> profileModelsToRemove = new ArrayList<VnicProfileModel>(originalProfileModels); profileModelsToRemove.removeAll(profileModels); final List<VnicProfileModel> profileModelsToAdd = new ArrayList<VnicProfileModel>(); for (VnicProfileModel profileModel : profileModels) { if (profileModel instanceof NewVnicProfileModel) { profileModelsToAdd.add(profileModel); } } startProgress(null); performVnicProfileAction(VdcActionType.RemoveVnicProfile, profileModelsToRemove, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { performVnicProfileAction(VdcActionType.AddVnicProfile, profileModelsToAdd, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { stopProgress(); cancel(); } }, networkGuid); } }, networkGuid); }
Source:
<code>public CepOperator( final List<CepEventPattern<T>> cepEventPatterns, final long windowTime) { this.eventPatternList = new ArrayList<>(); this.eventPatternList.addAll(cepEventPatterns); this.eventPatternList.add(0, null); this.windowTime = windowTime; this.matchedEventStackList = new ArrayList<>(); for (int eventIndex = eventPatternList.size() - 1; true; eventIndex--) { if (!eventPatternList.get(eventIndex).isOptional()) { this.minFinalStateIndex = eventIndex; break; } else if (eventIndex == 1) { this.minFinalStateIndex = 1; break; } } this.proceedIndexList = new ArrayList<>(); for (int eventIndex = 0; eventIndex < eventPatternList.size(); eventIndex++) { int minIndex; int maxIndex; <START> if (eventIndex != 0 && eventPatternList.get(eventIndex).isTimes()) { <END> minIndex = eventIndex; maxIndex = eventIndex + 1; } else { minIndex = eventIndex + 1; maxIndex = minIndex; } for (int i = eventIndex + 1; i < eventPatternList.size() - 1; i++) { if (eventPatternList.get(i).isOptional()) { maxIndex++; } else { break; } } if (minIndex >= eventPatternList.size()) { minIndex = -1; maxIndex = -1; } else if (maxIndex >= eventPatternList.size()) { maxIndex = minIndex; } final Tuple2<Integer, Integer> proceedIndexTup = new Tuple2<>(minIndex, maxIndex); this.proceedIndexList.add(proceedIndexTup); } }</code><technical_language>time -> iteration? repetition? isTimes -> isIterated isRepeated</technical_language>

Target:
public CepOperator( final List<CepEventPattern<T>> cepEventPatterns, final long windowTime) { this.eventPatternList = new ArrayList<>(); this.eventPatternList.addAll(cepEventPatterns); this.eventPatternList.add(0, null); this.windowTime = windowTime; this.matchedEventStackList = new ArrayList<>(); for (int eventIndex = eventPatternList.size() - 1; true; eventIndex--) { if (!eventPatternList.get(eventIndex).isOptional()) { this.minFinalStateIndex = eventIndex; break; } else if (eventIndex == 1) { this.minFinalStateIndex = 1; break; } } this.proceedIndexList = new ArrayList<>(); for (int eventIndex = 0; eventIndex < eventPatternList.size(); eventIndex++) { int minIndex; int maxIndex; if (eventIndex != 0 && eventPatternList.get(eventIndex).isRepeated()) { minIndex = eventIndex; maxIndex = eventIndex + 1; } else { minIndex = eventIndex + 1; maxIndex = minIndex; } for (int i = eventIndex + 1; i < eventPatternList.size() - 1; i++) { if (eventPatternList.get(i).isOptional()) { maxIndex++; } else { break; } } if (minIndex >= eventPatternList.size()) { minIndex = -1; maxIndex = -1; } else if (maxIndex >= eventPatternList.size()) { maxIndex = minIndex; } final Tuple2<Integer, Integer> proceedIndexTup = new Tuple2<>(minIndex, maxIndex); this.proceedIndexList.add(proceedIndexTup); } }
Source:
<code>public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException { try { MinioClient s3Client = new MinioClient("<LINK_0>", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY"); boolean found = s3Client.bucketExists("my-bucketname"); if (found) { System.out.println("my-bucketname already exists"); } else { s3Client.makeBucket("my-bucketname", null, true); System.out.println( "my-bucketname is created successfully with object lock functionality enabled."); } ObjectLockConfiguration config = new ObjectLockConfiguration(RetentionMode.COMPLIANCE, new RetentionDurationDays(100)); s3Client.setDefaultRetention("my-bucketname", config); ObjectLockConfiguration bucketConfig = s3Client.getDefaultRetention("my-bucketname"); System.out.println("Default retention configuration of bucket"); System.out.println("Mode: " + bucketConfig.mode()); System.out.println( <START> "Duration: " + bucketConfig.duration().duration() + " " + bucketConfig.duration().unit()); <END> } catch (MinioException e) { System.out.println("Error occurred: " + e); } }</code><technical_language>this bucketConfig.duration() instead of bucketConfig.duration().duration()</technical_language>

Target:
public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException { try { MinioClient s3Client = new MinioClient("<LINK_0>", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY"); boolean found = s3Client.bucketExists("my-bucketname"); if (found) { System.out.println("my-bucketname already exists"); } else { s3Client.makeBucket("my-bucketname", null, true); System.out.println( "my-bucketname is created successfully with object lock functionality enabled."); } ObjectLockConfiguration config = new ObjectLockConfiguration(RetentionMode.COMPLIANCE, new RetentionDurationDays(100)); s3Client.setDefaultRetention("my-bucketname", config); ObjectLockConfiguration bucketConfig = s3Client.getDefaultRetention("my-bucketname"); System.out.println("Default retention configuration of bucket"); System.out.println("Mode: " + bucketConfig.mode()); System.out.println("Duration: " + bucketConfig.duration()); } catch (MinioException e) { System.out.println("Error occurred: " + e); } }
Source:
<code>public String getPrimaryIpv4HostAddress() { String primaryIP; String[] addrString = primaryAddress.split("/"); if (addrString.length > 1) { String ip = getIPv4inSubnet(primaryAddress); if (ip == null) { LOGGER.warn("Error in IP configuration, will continue to use first interface"); primaryIP = NetUtil.getLocalIpv4HostAddress(); } else { primaryIP = ip; } } else { primaryIP = addrString[0]; } <START> return primaryIP; <END> }</code><technical_language>convince IDE primaryIP is null here</technical_language>

Target:
public String getPrimaryIpv4HostAddress() { String primaryIP; String[] addrString = primaryAddress.split("/"); if (addrString.length > 1) { String ip = getIPv4inSubnet(primaryAddress); if (ip == null) { LOGGER.warn("Invalid address '{}', will use first interface instead.", primaryAddress); primaryIP = getFirstLocalIPv4Address(); } else { primaryIP = ip; } } else { primaryIP = addrString[0]; } return primaryIP; }
Source:
<code><START> public static boolean getShowGutenbergInfoPopupForTheNewPosts(PrefKey key, String siteURL) { <END> if (TextUtils.isEmpty(siteURL)) { return false; } Set<String> urls; try { urls = prefs().getStringSet(key.name(), null); } catch (ClassCastException exp) { return false; } boolean flag = false; if (urls != null) { if (urls.contains(siteURL)) { flag = true; setShowGutenbergInfoPopupForTheNewPosts(siteURL, false); } } return flag; }</code><technical_language>I wonder, setShowGutenbergInfoPopupForTheNewPosts() call in line 646 need adopt a "PrefKey" param well? a bit confused codepaths but, flag is true, try clear Phase 1 flag only</technical_language>

Target:
private static boolean getShowGutenbergInfoPopupForTheNewPosts(PrefKey key, String siteURL) { if (TextUtils.isEmpty(siteURL)) { return false; } Set<String> urls; try { urls = prefs().getStringSet(key.name(), null); } catch (ClassCastException exp) { return false; } boolean flag = false; if (urls != null) { if (urls.contains(siteURL)) { flag = true; setShowGutenbergInfoPopupForTheNewPosts(key, siteURL, false); } } return flag; }
Source:
<code>public void receive_request(ServerRequestInfo serverRequestInfo) throws ForwardRequest { if (openTracingService == null) { return; } <START> Tracer tracer = openTracingService.getTracer(PAYARA_CORBA_RMI_TRACER_NAME); <END> if (tracer == null) { return; } ServiceContext serviceContext = serverRequestInfo.get_request_service_context(OPENTRACING_IIOP_ID); if (serviceContext == null) { return; } ByteArrayInputStream bis = new ByteArrayInputStream(serviceContext.context_data); OpenTracingIiopTextMap openTracingIiopTextMap = null; try (ObjectInput in = new OpenTracingIiopObjectInputStream(bis)) { openTracingIiopTextMap = (OpenTracingIiopTextMap) in.readObject(); } catch (IOException | ClassNotFoundException exception) { throw new ForwardRequest(exception.getMessage(), serverRequestInfo); } Tracer.SpanBuilder spanBuilder = tracer.buildSpan("rmi") .withTag(Tags.COMPONENT.getKey(), "ejb"); if (openTracingIiopTextMap != null) { SpanContext spanContext = tracer.extract(Format.Builtin.TEXT_MAP, openTracingIiopTextMap); spanBuilder.asChildOf(spanContext); } spanBuilder.startActive(true).span(); }</code><technical_language>Is a reason do this in constructor</technical_language>

Target:
public void receive_request(ServerRequestInfo serverRequestInfo) throws ForwardRequest { if (!tracerAvailable()) { return; } ServiceContext serviceContext = serverRequestInfo.get_request_service_context(OPENTRACING_IIOP_ID); if (serviceContext == null) { return; } OpenTracingIiopTextMap openTracingIiopTextMap = null; try (ByteArrayInputStream bis = new ByteArrayInputStream(serviceContext.context_data); ObjectInput in = new OpenTracingIiopObjectInputStream(bis)) { openTracingIiopTextMap = (OpenTracingIiopTextMap) in.readObject(); } catch (IOException | ClassNotFoundException exception) { throw new ForwardRequest(exception.getMessage(), serverRequestInfo); } Tracer.SpanBuilder spanBuilder = tracer.buildSpan("rmi") .withTag(Tags.COMPONENT.getKey(), "ejb"); if (openTracingIiopTextMap != null) { SpanContext spanContext = tracer.extract(Format.Builtin.TEXT_MAP, openTracingIiopTextMap); spanBuilder.asChildOf(spanContext); } spanBuilder.startActive(true).span(); }