auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void parseMapFileEntry(String repoSpecificentry, Properties overrideTags, Map entryInfos) throws CoreException { String[] arguments = Utils.getArrayFromStringWithBlank(repoSpecificentry, SEPARATOR); Map<String,String> table = new HashMap<String,String>(); for (int i = 0; i < arguments.length; i++) { String arg = arguments[i]; int index = arg.indexOf('='); if (index == -1) { String message = NLS.bind(Messages.error_incorrectDirectoryEntryKeyValue, entryInfos.get(KEY_ELEMENT_NAME)); throw new CoreException(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, 1, message, null)); } String key = arg.substring(0, index); String value = arg.substring(index + 1); table.put(key, value); } if (!table.containsKey(KEY_REPO)) { String message = NLS.bind(Messages.error_directoryEntryRequiresRepo, entryInfos.get(KEY_ELEMENT_NAME)); throw new CoreException(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, 1, message, null)); } String overrideTag = overrideTags != null ? overrideTags.getProperty(OVERRIDE_TAG) : null; entryInfos.put(IFetchFactory.KEY_ELEMENT_TAG, (overrideTag != null && overrideTag.trim().length() != 0 ? overrideTag : table.get(IFetchFactory.KEY_ELEMENT_TAG))); entryInfos.put(KEY_REPO, table.get(KEY_REPO)); if (table.get(KEY_PATH) != null) entryInfos.put(KEY_PATH, new Path((String) table.get(KEY_PATH)).makeRelative().removeTrailingSeparator().toString()); entryInfos.put(KEY_PREBUILT, table.get(KEY_PREBUILT)); addProjectReference(entryInfos); }

Target:
public void parseMapFileEntry(String repoSpecificentry, Properties overrideTags, Map entryInfos) throws CoreException { final String[] arguments = Utils.getArrayFromStringWithBlank( repoSpecificentry, SEPARATOR); final Map<String, String> table = new HashMap<String, String>(); for (int i = 0; i < arguments.length; i++) { final String arg = arguments[i]; final int index = arg.indexOf('='); if (index == -1) { final String message = NLS.bind( Messages.error_incorrectDirectoryEntryKeyValue, entryInfos.get(KEY_ELEMENT_NAME)); throw new CoreException(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, 1, message, null)); } final String key = arg.substring(0, index); final String value = arg.substring(index + 1); table.put(key, value); } if (!table.containsKey(KEY_REPO)) { final String message = NLS.bind( Messages.error_directoryEntryRequiresRepo, entryInfos.get(KEY_ELEMENT_NAME)); throw new CoreException(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, 1, message, null)); } final String overrideTag = overrideTags != null ? overrideTags .getProperty(OVERRIDE_TAG) : null; entryInfos .put(IFetchFactory.KEY_ELEMENT_TAG, (overrideTag != null && overrideTag.trim().length() != 0 ? overrideTag : table.get(IFetchFactory.KEY_ELEMENT_TAG))); entryInfos.put(KEY_REPO, table.get(KEY_REPO)); if (table.get(KEY_PATH) != null) entryInfos.put(KEY_PATH, new Path(table.get(KEY_PATH)) .makeRelative().removeTrailingSeparator().toString()); entryInfos.put(KEY_PREBUILT, table.get(KEY_PREBUILT)); addProjectReference(entryInfos); }
Source:
protected Scope visitUnnest(Unnest node, Optional<Scope> scope) { ImmutableList.Builder<Field> outputFields = ImmutableList.builder(); for (Expression expression : node.getExpressions()) { ExpressionAnalysis expressionAnalysis = analyzeExpression(expression, createScope(scope)); Type expressionType = expressionAnalysis.getType(expression); if (expressionType instanceof ArrayType) { Type elementType = ((ArrayType) expressionType).getElementType(); if (elementType instanceof RowType) { outputFields.addAll( elementType.getTypeParameters().stream() .map(type -> Field.newUnqualified(Optional.empty(), type)) .collect(toImmutableList())); } else { outputFields.add(Field.newUnqualified(Optional.empty(), elementType)); } } else if (expressionType instanceof MapType) { outputFields.add(Field.newUnqualified(Optional.empty(), ((MapType) expressionType).getKeyType())); outputFields.add(Field.newUnqualified(Optional.empty(), ((MapType) expressionType).getValueType())); } else { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Cannot unnest type: " + expressionType); } } if (node.isWithOrdinality()) { outputFields.add(Field.newUnqualified(Optional.empty(), BIGINT)); } return createAndAssignScope(node, scope, outputFields.build()); }

Target:
protected Scope visitUnnest(Unnest node, Optional<Scope> scope) { ImmutableList.Builder<Field> outputFields = ImmutableList.builder(); for (Expression expression : node.getExpressions()) { ExpressionAnalysis expressionAnalysis = analyzeExpression(expression, createScope(scope)); Type expressionType = expressionAnalysis.getType(expression); if (expressionType instanceof ArrayType) { Type elementType = ((ArrayType) expressionType).getElementType(); if (!SystemSessionProperties.isLegacyUnnest(session) && elementType instanceof RowType) { elementType.getTypeParameters().stream() .map(type -> Field.newUnqualified(Optional.empty(), type)) .forEach(outputFields::add); } else { outputFields.add(Field.newUnqualified(Optional.empty(), elementType)); } } else if (expressionType instanceof MapType) { outputFields.add(Field.newUnqualified(Optional.empty(), ((MapType) expressionType).getKeyType())); outputFields.add(Field.newUnqualified(Optional.empty(), ((MapType) expressionType).getValueType())); } else { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Cannot unnest type: " + expressionType); } } if (node.isWithOrdinality()) { outputFields.add(Field.newUnqualified(Optional.empty(), BIGINT)); } return createAndAssignScope(node, scope, outputFields.build()); }
Source:
public String toEnrollmentString() { StringBuilder enrollmentString = new StringBuilder(); String enrollmentStringSeparator = "|"; enrollmentString.append(this.section).append(enrollmentStringSeparator) .append(this.team).append(enrollmentStringSeparator) .append(this.name).append(enrollmentStringSeparator) .append(this.email).append(enrollmentStringSeparator) .append(this.comments); return enrollmentString.toString(); }

Target:
public String toEnrollmentString() { String enrollmentStringSeparator = "|"; return this.section + enrollmentStringSeparator + this.team + enrollmentStringSeparator + this.name + enrollmentStringSeparator + this.email + enrollmentStringSeparator + this.comments; }
Source:
public int maxDepth( Envelope referenceEnvelope, Envelope range, int nbrDim, int maxLevel ) { double searchRatio = range.getArea() / referenceEnvelope.getArea(); final int i = (int) (Math.log( searchRatio ) / Math.log( Math.pow( 2, nbrDim ) )) + extraLevels; return i; }

Target:
public int maxDepth( Envelope referenceEnvelope, Envelope range, int nbrDim, int maxLevel ) { double searchRatio = range.getArea() / referenceEnvelope.getArea(); return (int) (Math.log( searchRatio ) / Math.log( Math.pow( 2, nbrDim ) )) + extraLevels; }
Source:
public void loadConfiguration(@Observes ManagerStarted event) { final InputStream input = FileUtils.loadArquillianXml(ARQUILLIAN_XML_PROPERTY, ARQUILLIAN_XML_DEFAULT); final ArquillianDescriptor descriptor = resolveDescriptor(input); final PropertiesParser propertiesParser = new PropertiesParser(); propertiesParser.addProperties( descriptor, FileUtils.loadArquillianProperties(ARQUILLIAN_PROP_PROPERTY, ARQUILLIAN_PROP_DEFAULT)); Properties envProperties = new Properties(); envProperties.putAll(systemEnvironmentVars); propertiesParser.addProperties(descriptor, envProperties); ArquillianDescriptor resolvedDesc = descriptor; final List<ConfigurationPlaceholderResolver> configurationPlaceholderResolvers = new ArrayList<ConfigurationPlaceholderResolver>(serviceLoaderInstance.get().all(ConfigurationPlaceholderResolver.class)); Collections.sort(configurationPlaceholderResolvers, new Comparator<ConfigurationPlaceholderResolver>() { public int compare(ConfigurationPlaceholderResolver o1, ConfigurationPlaceholderResolver o2) { Integer a = o1.precedence(); Integer b = o2.precedence(); return b.compareTo(a); } }); for (ConfigurationPlaceholderResolver configurationPlaceholderResolver : configurationPlaceholderResolvers) { resolvedDesc = configurationPlaceholderResolver.resolve(resolvedDesc); } descriptorInst.set(resolvedDesc); }

Target:
public void loadConfiguration(@Observes ManagerStarted event) { final InputStream input = FileUtils.loadArquillianXml(ARQUILLIAN_XML_PROPERTY, ARQUILLIAN_XML_DEFAULT); final ArquillianDescriptor descriptor = resolveDescriptor(input); final PropertiesParser propertiesParser = new PropertiesParser(); propertiesParser.addProperties( descriptor, FileUtils.loadArquillianProperties(ARQUILLIAN_PROP_PROPERTY, ARQUILLIAN_PROP_DEFAULT)); Properties envProperties = new Properties(); envProperties.putAll(systemEnvironmentVars); propertiesParser.addProperties(descriptor, envProperties); ArquillianDescriptor resolvedDesc = descriptor; final List<ConfigurationPlaceholderResolver> configurationPlaceholderResolvers = loadAndOrderPlaceholderResolvers(); for (ConfigurationPlaceholderResolver configurationPlaceholderResolver : configurationPlaceholderResolvers) { resolvedDesc = configurationPlaceholderResolver.resolve(resolvedDesc); } descriptorInst.set(resolvedDesc); }
Source:
private void enqueueExceptionHandlers(Type exceptionType, ProgramState ps) { programPosition.block.successors().stream() .map(b -> (BytecodeCFG.Block) b) .filter(BytecodeCFG.Block::isCatchBlock) .filter(b -> b.isUncaughtException() || exceptionType == null || exceptionType.isSubtypeOf(b.getExceptionType(semanticModel)) || b.getExceptionType(semanticModel).isSubtypeOf(exceptionType)) .forEach(b -> enqueue(new ProgramPoint(b), ps)); }

Target:
private void enqueueExceptionHandlers(Type exceptionType, ProgramState ps) { programPosition.block.successors().stream() .map(b -> (BytecodeCFG.Block) b) .filter(BytecodeCFG.Block::isCatchBlock) .filter(b -> isExceptionHandledByBlock(exceptionType, b)) .forEach(b -> enqueue(new ProgramPoint(b), ps)); }
Source:
public void testTrackFiles() throws Exception { final ArrayList<IFile> files = new ArrayList<IFile>(); assertEquals("Index should be empty", 0, repository1.getRepository() .getIndex().getMembers().length); project.accept(new IResourceVisitor() { public boolean visit(IResource resource) throws CoreException { if (resource instanceof IFile) files.add((IFile) resource); return true; } }); IFile[] fileArr = files.toArray(new IFile[files.size()]); TrackOperation trop = new TrackOperation(fileArr); trop.execute(new NullProgressMonitor()); assertEquals("Index should have two entries", 2, repository1 .getRepository().getIndex().getMembers().length); UntrackOperation utop = new UntrackOperation(Arrays.asList(fileArr)); utop.execute(new NullProgressMonitor()); assertEquals("Index should be empty", 0, repository1.getRepository() .getIndex().getMembers().length); }

Target:
public void testTrackFiles() throws Exception { final ArrayList<IFile> files = new ArrayList<IFile>(); DirCache cache = DirCache.read(repository1.getRepository()); assertEquals("Wrong cache entry count", 0, cache.getEntryCount()); project.accept(new IResourceVisitor() { public boolean visit(IResource resource) throws CoreException { if (resource instanceof IFile) files.add((IFile) resource); return true; } }); IFile[] fileArr = files.toArray(new IFile[files.size()]); TrackOperation trop = new TrackOperation(fileArr); trop.execute(new NullProgressMonitor()); cache.read(); assertEquals("Wrong cache entry count", 2, cache.getEntryCount()); UntrackOperation utop = new UntrackOperation(Arrays.asList(fileArr)); utop.execute(new NullProgressMonitor()); cache.read(); assertEquals("Wrong cache entry count", 0, cache.getEntryCount()); }
Source:
public boolean provides(IDiagramElementEditPart editPart) { boolean provides = false; if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) { View view = (View) editPart.getModel(); if (view != null) { EObject model = view.getElement(); provides = model instanceof DNode || model instanceof DDiagramElementContainer; if (!(view instanceof Edge) && !view.isSetElement()) { provides = false; } EditDomain ed = editPart.getViewer().getEditDomain(); if (!(ed instanceof DiagramEditDomain)) { provides = false; } } } return provides; }

Target:
public boolean provides(IDiagramElementEditPart editPart) { boolean provides = false; if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) { View view = (View) editPart.getModel(); if (view != null) { if (view instanceof Edge || view.isSetElement()) { EditDomain ed = editPart.getViewer().getEditDomain(); if (ed instanceof DiagramEditDomain) { EObject model = view.getElement(); provides = model instanceof DNode || model instanceof DDiagramElementContainer; } } } } return provides; }
Source:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)) .setCheckpointFrequency(500L)); cfg.setCacheConfiguration( new CacheConfiguration<>() .setName(DEFAULT_CACHE_NAME) .setIndexedTypes(Integer.class, Integer.class)); return cfg; }

Target:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true))); cfg.setCacheConfiguration( new CacheConfiguration<>() .setName(DEFAULT_CACHE_NAME) .setIndexedTypes(Integer.class, Integer.class)); failureHnd = new TestStopNodeFailureHandler(); cfg.setFailureHandler(failureHnd); return cfg; }
Source:
public TypeSet types() { final Optional<Symbol> symbol = symbol(); if (symbol.isPresent()) { return symbol.get().types(); } else { return types.immutableCopy(); } }

Target:
public TypeSet types() { return symbol().map(Symbol::types).orElse(types.immutableCopy()); }
Source:
public void recognise() throws Exception { TensorflowRESTVideoRecogniser recogniser = new TensorflowRESTVideoRecogniser(); recogniser.initialize(new HashMap<String, Param>()); try (InputStream stream = getClass().getClassLoader().getResourceAsStream("test-documents/testVideoMp4.mp4")) { List<RecognisedObject> objects = recogniser.recognise(stream, new DefaultHandler(), new Metadata(), new ParseContext()); Assert.assertTrue(objects.size() > 0); Set<String> objectLabels = new HashSet<>(); for (RecognisedObject object : objects) { objectLabels.add(object.getLabel()); System.out.println(object.getLabel()); } Assert.assertTrue(objectLabels.size() > 0); } }

Target:
public void recognise() throws Exception { TensorflowRESTVideoRecogniser recogniser = new TensorflowRESTVideoRecogniser(); recogniser.initialize(new HashMap<String, Param>()); try (InputStream stream = getClass().getClassLoader().getResourceAsStream("test-documents/testVideoMp4.mp4")) { List<RecognisedObject> objects = recogniser.recognise(stream, new DefaultHandler(), new Metadata(), new ParseContext()); Assert.assertTrue(objects.size() > 0); Set<String> objectLabels = new HashSet<>(); for (RecognisedObject object : objects) { objectLabels.add(object.getLabel()); } Assert.assertTrue(objectLabels.size() > 0); } }
Source:
public boolean isValid(Object path, ConstraintValidatorContext context) { if (path == null) { return true; } if (path instanceof String) { return Files.exists(Paths.get((String) path)); } if (path instanceof Path) { return ((Path) path).toFile().exists(); } if (path instanceof File) { return ((File) path).exists(); } context.disableDefaultConstraintViolation(); context.buildConstraintViolationWithTemplate(format("could not validate value of type %s", path.getClass().getSimpleName())) .addConstraintViolation(); return false; }

Target:
public boolean isValid(Object path, ConstraintValidatorContext context) { if (path == null) { return true; } boolean fileExists = exists(path); if (!fileExists) { context.disableDefaultConstraintViolation(); context.buildConstraintViolationWithTemplate("file does not exist: " + path) .addConstraintViolation(); } return fileExists; }
Source:
public void delete() throws CentralRepoException { String deleteSQL = "UPDATE personas SET status_id = " + PersonaStatus.DELETED.status_id + " WHERE id = " + this.id; CentralRepository.getInstance().executeUpdateSQL(deleteSQL); }

Target:
public void delete() throws CentralRepoException { String deleteSQL = "UPDATE personas SET status_id = " + PersonaStatus.DELETED.status_id + " WHERE id = " + this.id; CentralRepository cr = CentralRepository.getInstance(); if (cr != null) { cr.executeDeleteSQL(deleteSQL); } }
Source:
private List<ReplicaSet> getReplicaSetByLabel(String key, String value) { List<ReplicaSet> replicaSets; try (OpenShiftClient openShiftClient = new DefaultOpenShiftClient()) { replicaSets = openShiftClient.extensions() .replicaSets() .inNamespace(openShiftCheProjectName) .withLabel(key, value) .list().getItems(); return replicaSets; } }

Target:
private List<ReplicaSet> getReplicaSetByLabel(String key, String value) { try (OpenShiftClient openShiftClient = new DefaultOpenShiftClient()) { List<ReplicaSet> replicaSets = openShiftClient.extensions() .replicaSets() .inNamespace(openShiftCheProjectName) .withLabel(key, value) .list().getItems(); return replicaSets; } }
Source:
private ArrayList<GenericColumnSerializer> setupMetricsWriters( final IOPeon ioPeon, final List<String> mergedMetrics, final Map<String, ValueType> metricsValueTypes, final Map<String, String> metricTypeNames, final IndexSpec indexSpec ) throws IOException { ArrayList<GenericColumnSerializer> metWriters = Lists.newArrayListWithCapacity(mergedMetrics.size()); final CompressedObjectStrategy.CompressionStrategy metCompression = indexSpec.getMetricCompressionStrategy(); final CompressionFactory.LongEncodingFormat metEncoding = indexSpec.getMetricLongEncodingFormat(); for (String metric : mergedMetrics) { ValueType type = metricsValueTypes.get(metric); GenericColumnSerializer writer; switch (type) { case LONG: writer = LongColumnSerializer.create(ioPeon, metric, metCompression, metEncoding); break; case FLOAT: writer = FloatColumnSerializer.create(ioPeon, metric, metCompression); break; case COMPLEX: final String typeName = metricTypeNames.get(metric); ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(typeName); if (serde == null) { throw new ISE("Unknown type[%s]", typeName); } writer = ComplexColumnSerializer.create(ioPeon, metric, serde); break; default: throw new ISE("Unknown type[%s]", type); } writer.open(); metWriters.add(writer); } return metWriters; }

Target:
private ArrayList<GenericColumnSerializer> setupMetricsWriters( final IOPeon ioPeon, final List<String> mergedMetrics, final Map<String, ValueType> metricsValueTypes, final Map<String, String> metricTypeNames, final IndexSpec indexSpec ) throws IOException { ArrayList<GenericColumnSerializer> metWriters = Lists.newArrayListWithCapacity(mergedMetrics.size()); final CompressedObjectStrategy.CompressionStrategy metCompression = indexSpec.getMetricCompression(); final CompressionFactory.LongEncodingStrategy longEncoding = indexSpec.getLongEncoding(); for (String metric : mergedMetrics) { ValueType type = metricsValueTypes.get(metric); GenericColumnSerializer writer; switch (type) { case LONG: writer = LongColumnSerializer.create(ioPeon, metric, metCompression, longEncoding); break; case FLOAT: writer = FloatColumnSerializer.create(ioPeon, metric, metCompression); break; case COMPLEX: final String typeName = metricTypeNames.get(metric); ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(typeName); if (serde == null) { throw new ISE("Unknown type[%s]", typeName); } writer = ComplexColumnSerializer.create(ioPeon, metric, serde); break; default: throw new ISE("Unknown type[%s]", type); } writer.open(); metWriters.add(writer); } return metWriters; }
Source:
private void setNonOperational(VDS server) { Map<String, String> customValues = new HashMap<String, String>(); customValues.put(GlusterConstants.COMMAND, "gluster peer probe"); customValues.put(GlusterConstants.SERVER, server.getHostName()); SetNonOperationalVdsParameters nonOpParams = new SetNonOperationalVdsParameters(server.getId(), NonOperationalReason.GLUSTER_COMMAND_FAILED, customValues); nonOpParams.setSaveToDb(true); Backend.getInstance().runInternalAction(VdcActionType.SetNonOperationalVds, nonOpParams, ExecutionHandler.createInternalJobContext()); }

Target:
private void setNonOperational(VDS server) { Map<String, String> customValues = new HashMap<String, String>(); customValues.put(GlusterConstants.COMMAND, "gluster peer probe"); SetNonOperationalVdsParameters nonOpParams = new SetNonOperationalVdsParameters(server.getId(), NonOperationalReason.GLUSTER_COMMAND_FAILED, customValues); nonOpParams.setSaveToDb(true); Backend.getInstance().runInternalAction(VdcActionType.SetNonOperationalVds, nonOpParams, ExecutionHandler.createInternalJobContext()); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view; if (isCoursewareAccessible) { view = inflater.inflate(R.layout.fragment_course_dashboard, container, false); courseTextName = (TextView) view.findViewById(R.id.course_detail_name); courseTextDetails = (TextView) view.findViewById(R.id.course_detail_extras); headerImageView = (ImageView) view.findViewById(R.id.header_image_view); parent = (LinearLayout) view.findViewById(R.id.dashboard_detail); shareIcon = (TextView) view.findViewById(R.id.course_detail_share); Typeface font = Typeface.createFromAsset(getResources().getAssets(), "fonts/fontawesome-webfont-4.3.0.ttf"); shareIcon.setTypeface(font); } else { view = inflater.inflate(R.layout.fragment_course_dashboard_disabled, container, false); errorText = (TextView) view.findViewById(R.id.error_msg); } return view; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view; if (isCoursewareAccessible) { view = inflater.inflate(R.layout.fragment_course_dashboard, container, false); courseTextName = (TextView) view.findViewById(R.id.course_detail_name); courseTextDetails = (TextView) view.findViewById(R.id.course_detail_extras); headerImageView = (ImageView) view.findViewById(R.id.header_image_view); parent = (LinearLayout) view.findViewById(R.id.dashboard_detail); shareButton = (IconButton) view.findViewById(R.id.course_detail_share); } else { view = inflater.inflate(R.layout.fragment_course_dashboard_disabled, container, false); errorText = (TextView) view.findViewById(R.id.error_msg); } return view; }
Source:
public CoordinatorConfig(VerifiableProperties verifiableProperties) { this.hostname = verifiableProperties.getString("coordinator.hostname"); this.datacenterName = verifiableProperties.getString("coordinator.datacenter.name"); this.requesterPoolSize = verifiableProperties.getIntInRange("coordinator.requester.pool.size", 100, 1, Integer.MAX_VALUE); this.operationTimeoutMs = verifiableProperties.getIntInRange("coordinator.operation.timeout.ms", 2000, 1, Integer.MAX_VALUE); this.connectionPoolFactory = verifiableProperties.getString("coordinator.connection.pool.factory", "com.github.ambry.network.BlockingChannelConnectionPoolFactory"); this.connectionPoolCheckoutTimeoutMs = verifiableProperties.getIntInRange("coordinator.connection.pool.checkout.timeout.ms", 1000, 1, 5000); this.crossDCProxyCallEnable = verifiableProperties.getBoolean("coordinator.cross.dc.proxy.call.enable", true); this.sslEnabledColos = verifiableProperties.getString("coordinator.ssl.enbaled.colos", ""); }

Target:
public CoordinatorConfig(VerifiableProperties verifiableProperties) { this.hostname = verifiableProperties.getString("coordinator.hostname"); this.datacenterName = verifiableProperties.getString("coordinator.datacenter.name"); this.requesterPoolSize = verifiableProperties.getIntInRange("coordinator.requester.pool.size", 100, 1, Integer.MAX_VALUE); this.operationTimeoutMs = verifiableProperties.getIntInRange("coordinator.operation.timeout.ms", 2000, 1, Integer.MAX_VALUE); this.connectionPoolFactory = verifiableProperties.getString("coordinator.connection.pool.factory", "com.github.ambry.network.BlockingChannelConnectionPoolFactory"); this.connectionPoolCheckoutTimeoutMs = verifiableProperties.getIntInRange("coordinator.connection.pool.checkout.timeout.ms", 1000, 1, 5000); this.crossDCProxyCallEnable = verifiableProperties.getBoolean("coordinator.cross.dc.proxy.call.enable", true); this.sslEnabledDatacenters = verifiableProperties.getString("coordinator.ssl.enabled.datacenters", ""); }
Source:
public MVTable(CreateTableData data, MVTableEngine.Store store) { super(data); nextAnalyze = database.getSettings().analyzeAuto; changesUnitilAnalyze = nextAnalyze <= 0 ? null : new AtomicInteger(nextAnalyze); this.store = store; this.transactionStore = store.getTransactionStore(); this.isHidden = data.isHidden; boolean b = false; for (Column col : getColumns()) { if (DataType.isLargeObject(col.getType())) { b = true; break; } } containsLargeObject = b; traceLock = database.getTrace(Trace.LOCK); }

Target:
public MVTable(CreateTableData data, MVTableEngine.Store store) { super(data); nextAnalyze = database.getSettings().analyzeAuto; changesUnitlAnalyze = nextAnalyze <= 0 ? null : new AtomicInteger(nextAnalyze); this.store = store; this.transactionStore = store.getTransactionStore(); this.isHidden = data.isHidden; boolean b = false; for (Column col : getColumns()) { if (DataType.isLargeObject(col.getType())) { b = true; break; } } containsLargeObject = b; traceLock = database.getTrace(Trace.LOCK); }
Source:
public void blobStoreHardDeleteTestBlobV1() throws MessageFormatException, IOException { blobStoreHardDeleteTestUtil(MessageFormatRecord.Blob_Version_V1); }

Target:
public void blobStoreHardDeleteTestBlobV1() throws MessageFormatException, IOException { short[] blobVersions = new short[5]; BlobType[] blobTypes = new BlobType[5]; for (int i = 0; i < 5; i++) { blobVersions[i] = MessageFormatRecord.Blob_Version_V1; blobTypes[i] = BlobType.DataBlob; } blobStoreHardDeleteTestUtil(blobVersions, blobTypes); }
Source:
public void testChatStateListeners() throws Exception { ChatStateManager manOne = ChatStateManager.getInstance(conOne); ChatStateManager manTwo = ChatStateManager.getInstance(conTwo); Chat chatOne = ChatManager.getInstanceFor(conOne).chatWith(conTwo.getUser().asEntityBareJid()); final SimpleResultSyncPoint composingSyncPoint = new SimpleResultSyncPoint(); ChatStateListener composingListener = new ChatStateListener() { @Override public void stateChanged(Chat chat, ChatState state, Message message) { if (state.equals(ChatState.composing)) { composingSyncPoint.signal(); } } }; manTwo.addChatStateListener(composingListener); manOne.setCurrentState(ChatState.composing, chatOne); composingSyncPoint.waitForResult(10 * 1000); manTwo.removeChatStateListener(composingListener); final SimpleResultSyncPoint activeSyncPoint = new SimpleResultSyncPoint(); ChatStateListener activeListener = new ChatStateListener() { @Override public void stateChanged(Chat chat, ChatState state, Message message) { if (state.equals(ChatState.active)) { activeSyncPoint.signal(); } } }; manTwo.addChatStateListener(activeListener); Chat chat = ChatManager.getInstanceFor(conOne).chatWith(conTwo.getUser().asEntityBareJid()); chat.send("Hi!"); activeSyncPoint.waitForResult(10 * 1000); manTwo.removeChatStateListener(activeListener); }

Target:
public void testChatStateListeners() throws Exception { ChatStateManager manOne = ChatStateManager.getInstance(conOne); ChatStateManager manTwo = ChatStateManager.getInstance(conTwo); manTwo.addChatStateListener(composingListener); manTwo.addChatStateListener(activeListener); Chat chatOne = ChatManager.getInstanceFor(conOne) .chatWith(conTwo.getUser().asEntityBareJid()); manOne.setCurrentState(ChatState.composing, chatOne); composingSyncPoint.waitForResult(timeout); Chat chat = ChatManager.getInstanceFor(conOne) .chatWith(conTwo.getUser().asEntityBareJid()); chat.send("Hi!"); activeSyncPoint.waitForResult(timeout); }
Source:
private boolean shouldBeDirectlyAttached(String vfName, Guid vmId) { return !CollectionUtils .isEmpty(vmDeviceDao.getVmDeviceByVmIdTypeAndDevice(vmId, VmDeviceGeneralType.HOSTDEV, vfName)); }

Target:
private boolean shouldBeDirectlyAttached(String vfName, Guid vmId) { return CollectionUtils .isNotEmpty(vmDeviceDao.getVmDeviceByVmIdTypeAndDevice(vmId, VmDeviceGeneralType.HOSTDEV, vfName)); }
Source:
public byte[] getCacheKey() { try (final ByteArrayOutputStream baos = new ByteArrayOutputStream()) { baos.write(StringUtils.toUtf8(getClass().getCanonicalName())); baos.write(0xFF); baos.write(StringUtils.toUtf8(getLookup())); baos.write(0xFF); baos.write(ensureDelegate().getCacheKey()); return baos.toByteArray(); } catch (IOException e) { throw Throwables.propagate(e); } }

Target:
public byte[] getCacheKey() { final byte[] keyPrefix = StringUtils.toUtf8(getClass().getCanonicalName()); final byte[] lookupName = StringUtils.toUtf8(getLookup()); final byte[] delegateKey = ensureDelegate().getCacheKey(); return ByteBuffer .allocate(keyPrefix.length + 1 + lookupName.length + 1 + delegateKey.length) .put(keyPrefix).put((byte) 0xFF) .put(lookupName).put((byte) 0xFF) .put(delegateKey) .array(); }
Source:
public static RMInitialState getRMInitialState(long counter) { try { long startTime = System.currentTimeMillis(); final RMInitialState state = rmProxy.getRMInitialState(counter); long time = System.currentTimeMillis() - startTime; logger.debug(String.format("Updated RM initial state in %d ms", time)); return state; } catch (Exception e) { logger.error("Exception occurrend while updating RM state cache, connection reset", e); throw e; } }

Target:
public static RMInitialState getRMInitialState(long counter) { try { long startTime = System.currentTimeMillis(); final RMInitialState state = PAFuture.getFutureValue(rm.getRMInitialState(counter)); long time = System.currentTimeMillis() - startTime; logger.debug(String.format("Updated RM initial state in %d ms", time)); return state; } catch (Exception e) { logger.error("Exception occurrend while updating RM state cache, connection reset", e); throw e; } }
Source:
public PluggableFacade(PluggableDefinition def, IPipeHolder holder, EnumFacing side, NBTTagCompound nbt) { super(def, holder, side); this.states = FacadeInstance.readFromNbt(nbt, "states"); activeState = MathUtil.clamp(nbt.getInteger("activeState"), 0, states.phasedStates.length - 1); isSideSolid = states.areAllStatesSolid(side) && !states.phasedStates[activeState].isHollow(); }

Target:
public PluggableFacade(PluggableDefinition def, IPipeHolder holder, EnumFacing side, NBTTagCompound nbt) { super(def, holder, side); this.states = FacadeInstance.readFromNbt(nbt, "states"); activeState = MathUtil.clamp(nbt.getInteger("activeState"), 0, states.phasedStates.length - 1); isSideSolid = states.areAllStatesSolid(side); blockFaceShape = states.getBlockFaceShape(side); }
Source:
public void createClientWithJWKS_generatedKid() throws Exception { OIDCClientRepresentation clientRep = createRep(); clientRep.setGrantTypes(Collections.singletonList(OAuth2Constants.CLIENT_CREDENTIALS)); clientRep.setTokenEndpointAuthMethod(OIDCLoginProtocol.PRIVATE_KEY_JWT); TestOIDCEndpointsApplicationResource oidcClientEndpointsResource = testingClient.testApp().oidcClientEndpoints(); Map<String, String> generatedKeys = oidcClientEndpointsResource.generateKeys(null); JSONWebKeySet keySet = oidcClientEndpointsResource.getJwks(); clientRep.setJwks(keySet); OIDCClientRepresentation response = reg.oidc().create(clientRep); Assert.assertEquals(OIDCLoginProtocol.PRIVATE_KEY_JWT, response.getTokenEndpointAuthMethod()); Assert.assertNull(response.getClientSecret()); Assert.assertNull(response.getClientSecretExpiresAt()); assertAuthenticateClientSuccess(generatedKeys, response, KEEP_GENERATED_KID); }

Target:
public void createClientWithJWKS_generatedKid() throws Exception { OIDCClientRepresentation clientRep = createRep(); clientRep.setGrantTypes(Collections.singletonList(OAuth2Constants.CLIENT_CREDENTIALS)); clientRep.setTokenEndpointAuthMethod(OIDCLoginProtocol.PRIVATE_KEY_JWT); TestOIDCEndpointsApplicationResource oidcClientEndpointsResource = testingClient.testApp().oidcClientEndpoints(); Map<String, String> generatedKeys = oidcClientEndpointsResource.generateKeys("RS256"); JSONWebKeySet keySet = oidcClientEndpointsResource.getJwks(); clientRep.setJwks(keySet); OIDCClientRepresentation response = reg.oidc().create(clientRep); Assert.assertEquals(OIDCLoginProtocol.PRIVATE_KEY_JWT, response.getTokenEndpointAuthMethod()); Assert.assertNull(response.getClientSecret()); Assert.assertNull(response.getClientSecretExpiresAt()); assertAuthenticateClientSuccess(generatedKeys, response, KEEP_GENERATED_KID); }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { final HttpServletRequest httpRequest = (HttpServletRequest) request; final String token = tokenExtractor.getToken(httpRequest); if (isNullOrEmpty(token)) { chain.doFilter(request, response); return; } try { final Jws<Claims> jwt = Jwts.parser().setSigningKeyResolver(workspaceSigningKeyResolver).parseClaimsJws(token); final Claims claims = jwt.getBody(); try { final String userId = claims.get(USER_ID_CLAIM, String.class); final String userName = userManager.getById(userId).getName(); final Subject authorizedSubject = new AuthorizedSubject( new SubjectImpl(userName, userId, token, false), permissionChecker); EnvironmentContext.getCurrent().setSubject(authorizedSubject); chain.doFilter(addUserInRequest(httpRequest, authorizedSubject), response); } catch (NotFoundException ex) { sendErr( response, SC_UNAUTHORIZED, "Authentication with machine token failed because user for this token no longer exist."); } catch (ServerException ex) { sendErr( response, SC_UNAUTHORIZED, format("Authentication with machine token failed cause: %s", ex.getMessage())); } finally { EnvironmentContext.reset(); } } catch (JwtException ex) { chain.doFilter(request, response); } }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { final HttpServletRequest httpRequest = (HttpServletRequest) request; final String token = tokenExtractor.getToken(httpRequest); if (isNullOrEmpty(token)) { chain.doFilter(request, response); return; } try { final Claims claims = jwtParser.parseClaimsJws(token).getBody(); try { final String userId = claims.get(USER_ID_CLAIM, String.class); final String userName = userManager.getById(userId).getName(); final Subject authorizedSubject = new AuthorizedSubject( new SubjectImpl(userName, userId, token, false), permissionChecker); EnvironmentContext.getCurrent().setSubject(authorizedSubject); chain.doFilter(addUserInRequest(httpRequest, authorizedSubject), response); } catch (NotFoundException ex) { sendErr( response, SC_UNAUTHORIZED, "Authentication with machine token failed because user for this token no longer exist."); } finally { EnvironmentContext.reset(); } } catch (NotMachineTokenJwtException ex) { chain.doFilter(request, response); } catch (ServerException | JwtException e) { sendErr( response, SC_UNAUTHORIZED, format("Authentication with machine token failed cause: %s", e.getMessage())); } }
Source:
public void reload() { prepareConfigFile(); if(process.getClass().getName().equals("java.lang.UNIXProcess")) { try { Request.Post("http://localhost:8088/v1-catalog/templates?action=refresh").execute(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }

Target:
public void reload() { try { prepareConfigFile(); Request.Post("http://localhost:8088/v1-catalog/templates?action=refresh").execute(); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public boolean canMatchTrace(ITmfTrace trace) { if (!(trace instanceof IKernelTrace)) { return false; } IKernelAnalysisEventLayout layout = ((IKernelTrace) trace).getKernelEventLayout(); TRACE_LAYOUTS.put(trace, layout); Set<String> events = REQUIRED_EVENTS.computeIfAbsent(layout, k -> { Set<String> eventsSet = new HashSet<>(); eventsSet.addAll(k.eventsNetworkSend()); eventsSet.addAll(k.eventsNetworkReceive()); return eventsSet; }); if (!(trace instanceof ITmfTraceWithPreDefinedEvents)) { return true; } ITmfTraceWithPreDefinedEvents ktrace = (ITmfTraceWithPreDefinedEvents) trace; Set<String> traceEvents = TmfEventTypeCollectionHelper.getEventNames(ktrace.getContainedEventTypes()); traceEvents.retainAll(events); return !traceEvents.isEmpty(); }

Target:
public boolean canMatchTrace(ITmfTrace trace) { if (!(trace instanceof IKernelTrace)) { return false; } IKernelAnalysisEventLayout layout = ((IKernelTrace) trace).getKernelEventLayout(); TRACE_LAYOUTS.put(trace, layout); Set<String> events = REQUIRED_EVENTS.computeIfAbsent(layout, eventLayout -> { Set<String> eventsSet = new HashSet<>(); eventsSet.addAll(eventLayout.eventsNetworkSend()); eventsSet.addAll(eventLayout.eventsNetworkReceive()); return eventsSet; }); if (!(trace instanceof ITmfTraceWithPreDefinedEvents)) { return true; } ITmfTraceWithPreDefinedEvents ktrace = (ITmfTraceWithPreDefinedEvents) trace; Set<String> traceEvents = TmfEventTypeCollectionHelper.getEventNames(ktrace.getContainedEventTypes()); traceEvents.retainAll(events); return !traceEvents.isEmpty(); }
Source:
public StringFieldEditor(String name, String labelText, int width, int strategy, Composite parent) { init(name, labelText); widthInChars = width; setValidateStrategy(strategy); isValid = false; errorMessage = JFaceResources .getString("StringFieldEditor.errorMessage"); createControl(parent); }

Target:
public StringFieldEditor(String name, String labelText, int width, int strategy, Composite parent) { this(name, labelText, width, 1, strategy, parent); }
Source:
public void testStopSyncthingServiceBackground() { PreferenceManager.getDefaultSharedPreferences(mContext) .edit() .putBoolean(SyncthingService.PREF_ALWAYS_RUN_IN_BACKGROUND, true) .commit(); Intent intent = new Intent(new Intent(mContext, AppConfigReceiver.class)); intent.setAction(AppConfigReceiver.ACTION_STOP); try { mReceiver.onReceive(mContext, intent); Assert.fail("Stop SyncthingService Background (1) - didn't fail to create the notification"); } catch (NullPointerException e) { } }

Target:
public void testStopSyncthingServiceBackground() { PreferenceManager.getDefaultSharedPreferences(mContext) .edit() .putBoolean(SyncthingService.PREF_ALWAYS_RUN_IN_BACKGROUND, true) .commit(); Intent intent = new Intent(new Intent(mContext, AppConfigReceiver.class)); intent.setAction(AppConfigReceiver.ACTION_STOP); mReceiver.onReceive(mContext, intent); assertEquals("Stop SyncthingService Background", 0, mContext.getStopServiceIntents().size()); }
Source:
public Object get(String column) { TupleOperation result = currentState.get( column ); if ( result == null ) { return snapshot.get( column ); } else if ( result.getType() == PUT_NULL || result.getType() == REMOVE ) { return result; } else { return result.getValue(); } }

Target:
public Object get(String column) { TupleOperation result = currentState.get( column ); if ( result == null ) { return snapshot.get( column ); } else if ( result.getType() == PUT_NULL || result.getType() == REMOVE ) { return null; } else { return result.getValue(); } }
Source:
public void onConstruct(String enumName, int ordinal, int idIn, String nameIn, String suffixIn, Class <? extends WorldProvider > clazzIn, CallbackInfo ci) { this.sanitizedId = this.getName().toLowerCase().replaceAll(" ", "_").replace("[^A-Za-z0-9_]", ""); this.config = new SpongeConfig<>(SpongeConfig.Type.DIMENSION, SpongeImpl.getSpongeConfigDir().resolve("worlds").resolve(dimensionType$getId ()).resolve("dimension.conf"), SpongeImpl.ECOSYSTEM_ID); this.context = new Context(Context.DIMENSION_KEY, this.sanitizedId); }

Target:
public void onConstruct(String enumName, int ordinal, int idIn, String nameIn, String suffixIn, Class <? extends WorldProvider > clazzIn, CallbackInfo ci) { this.sanitizedId = this.getName().toLowerCase().replace(" ", "_").replaceAll("[^A-Za-z0-9_]", ""); this.config = new SpongeConfig<>(SpongeConfig.Type.DIMENSION, SpongeImpl.getSpongeConfigDir().resolve("worlds").resolve(dimensionType$getId ()).resolve("dimension.conf"), SpongeImpl.ECOSYSTEM_ID); this.context = new Context(Context.DIMENSION_KEY, this.sanitizedId); }
Source:
private HystrixConcurrencyStrategy detectRegisteredConcurrencyStrategy() { HystrixConcurrencyStrategy registeredStrategy = HystrixPlugins.getInstance() .getConcurrencyStrategy(); if (existingConcurrencyStrategy == null) { return registeredStrategy; } if (registeredStrategy instanceof HystrixConcurrencyStrategyDefault){ return existingConcurrencyStrategy; } if (!existingConcurrencyStrategy.equals(registeredStrategy)){ throw new IllegalStateException("Multiple HystrixConcurrencyStrategy detected."); } return existingConcurrencyStrategy; }

Target:
private HystrixConcurrencyStrategy detectRegisteredConcurrencyStrategy() { HystrixConcurrencyStrategy registeredStrategy = HystrixPlugins.getInstance() .getConcurrencyStrategy(); if (existingConcurrencyStrategy == null) { return registeredStrategy; } if (registeredStrategy instanceof HystrixConcurrencyStrategyDefault){ return existingConcurrencyStrategy; } if (!existingConcurrencyStrategy.equals(registeredStrategy)){ LOGGER.warn("Multiple HystrixConcurrencyStrategy detected. Bean of HystrixConcurrencyStrategy was used."); } return existingConcurrencyStrategy; }
Source:
String value() { String s = value; if ( s == null ) { synchronized ( this ) { s = value; if ( s == null ) { s = value = new String( bytes, offset, length, StandardCharsets.UTF_8 ); } } } return s; }

Target:
String value() { String s = value; if ( s == null ) { synchronized ( this ) { s = value; if ( s == null ) { value = s = new String( bytes, offset, byteLength, StandardCharsets.UTF_8 ); } } } return s; }
Source:
protected Node getSequencedNode( Node parentNode, String relativePath, int waitTimeSeconds) throws Exception { String parentNodePath = parentNode.getPath(); String expectedPath = parentNodePath.endsWith( "/") ? parentNodePath + relativePath : parentNodePath + "/" + relativePath; if (!sequencedNodes.containsKey(expectedPath)) { if (!waitingLatches.containsKey(expectedPath)) { createWaitingLatch(expectedPath); } logger.debug("Waiting for sequenced node at: " + expectedPath); waitingLatches.get(expectedPath).await(waitTimeSeconds, TimeUnit.SECONDS); } waitingLatches.remove(expectedPath); return sequencedNodes.remove(expectedPath); }

Target:
protected Node getSequencedNode( Node parentNode, String relativePath, int waitTimeSeconds) throws Exception { String parentNodePath = parentNode.getPath(); String expectedPath = parentNodePath.endsWith( "/") ? parentNodePath + relativePath : parentNodePath + "/" + relativePath; if (!sequencedNodes.containsKey(expectedPath)) { createWaitingLatchIfNecessary(expectedPath); logger.debug("Waiting for sequenced node at: " + expectedPath); waitingLatches.get(expectedPath).await(waitTimeSeconds, TimeUnit.SECONDS); } waitingLatches.remove(expectedPath); return sequencedNodes.remove(expectedPath); }
Source:
private Set<IContainer> getIgnoredReferencePointParents( Set<IReferencePoint> referencePoints, Set<IContainer> referencePointParents) { Set<IContainer> referencePointDelegates = referencePoints.stream().map(ResourceConverter::getDelegate).collect(Collectors.toSet()); List<IContainer> sortedReferencePointParents = new ArrayList<>(referencePointParents); sortedReferencePointParents.sort( (c1, c2) -> { IPath path1 = c1.getFullPath(); IPath path2 = c2.getFullPath(); return -1 * Integer.compare(path1.segmentCount(), path2.segmentCount()); }); Set<IContainer> containersWithoutSharableChildren = new HashSet<>(); Set<IContainer> containersWithSharableChildren = new HashSet<>(); for (IContainer referencePointParent : sortedReferencePointParents) { IResource[] children; try { children = referencePointParent.members(); } catch (CoreException e) { log.error("Could not obtain members of container " + referencePointParent, e); continue; } boolean hasSharableChildren = false; for (IResource child : children) { if (!(child instanceof IContainer)) { continue; } if (containersWithSharableChildren.contains(child) || (!referencePointParents.contains(child) && !referencePointDelegates.contains(child))) { hasSharableChildren = true; break; } } if (hasSharableChildren) { containersWithSharableChildren.add(referencePointParent); } else { containersWithoutSharableChildren.add(referencePointParent); } } return containersWithoutSharableChildren; }

Target:
private Set<IContainer> getIgnoredReferencePointParents( Set<IReferencePoint> referencePoints, Set<IContainer> referencePointParents) { Set<IContainer> referencePointDelegates = referencePoints.stream().map(ResourceConverter::getDelegate).collect(Collectors.toSet()); List<IContainer> sortedReferencePointParents = new ArrayList<>(referencePointParents); sortedReferencePointParents.sort( Comparator.comparingInt((IContainer c) -> c.getFullPath().segmentCount()).reversed()); Set<IContainer> containersWithoutSharableChildren = new HashSet<>(); Set<IContainer> containersWithSharableChildren = new HashSet<>(); for (IContainer referencePointParent : sortedReferencePointParents) { IResource[] children; try { children = referencePointParent.members(); } catch (CoreException e) { log.error("Could not obtain members of container " + referencePointParent, e); continue; } boolean hasSharableChildren = false; for (IResource child : children) { if (!(child instanceof IContainer)) { continue; } if (containersWithSharableChildren.contains(child) || (!referencePointParents.contains(child) && !referencePointDelegates.contains(child))) { hasSharableChildren = true; break; } } if (hasSharableChildren) { containersWithSharableChildren.add(referencePointParent); } else { containersWithoutSharableChildren.add(referencePointParent); } } return containersWithoutSharableChildren; }
Source:
private Mono<CosmosPermissionResponse> readInternal(CosmosPermissionRequestOptions options, Context context) { String spanName = "readPermission." + cosmosUser.getId(); Mono<CosmosPermissionResponse> responseMono = readInternal(options); return cosmosUser.getDatabase().getClient().getTracerProvider().traceEnabledCosmosResponsePublisher(responseMono, context, spanName, cosmosUser.getDatabase().getId(), cosmosUser.getDatabase().getClient().getServiceEndpoint()); }

Target:
private Mono<CosmosPermissionResponse> readInternal(CosmosPermissionRequestOptions options, Context context) { String spanName = "readPermission." + cosmosUser.getId(); Mono<CosmosPermissionResponse> responseMono = cosmosUser.getDatabase() .getDocClientWrapper() .readPermission(getLink(), ModelBridgeInternal.toRequestOptions(options)) .map(response -> ModelBridgeInternal.createCosmosPermissionResponse(response)) .single(); return cosmosUser.getDatabase().getClient().getTracerProvider().traceEnabledCosmosResponsePublisher(responseMono, context, spanName, cosmosUser.getDatabase().getId(), cosmosUser.getDatabase().getClient().getServiceEndpoint()); }