This benchmark attempts to measure performance of {@link TextFormat#inject(SpanContext, Object,
Setter)}.
512662
@Benchmark
  @BenchmarkMode(Mode.SampleTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public Map<String, String> inject(Data data) {
    Map<String, String> carrier = new HashMap<String, String>();
    data.textFormatBase.inject(data.spanContext, carrier);
    return carrier;
  }
1051954
@Override
    public void notifyInjectionMetaDataListeners(ReferenceContext referenceContext,
                                                 ComponentNameSpaceConfiguration compNSpaceConfiguration)
                    throws InjectionException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "notifyInjectionMetaDataListeners");

        InjectionMetaData injectionMetaData = new InjectionMetaDataImpl(this, compNSpaceConfiguration, referenceContext); // F48603

        for (InjectionMetaDataListener metaDataListener : metaDataListeners)
        {
            if (isTraceOn && tc.isDebugEnabled())
                Tr.debug(tc, "invoking InjectionMetaDataListener: " + metaDataListener);
            metaDataListener.injectionMetaDataCreated(injectionMetaData);
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "notifyInjectionMetaDataListeners");
    }
963383
protected void injectMethodTimer() {
        methodEntertime = newLocal(Type.LONG_TYPE);
        invokeStatic(Type.getType(System.class), Method.getMethod(CURRENT_TIME_MILLIS_METHODNAME));
        storeLocal(methodEntertime);

        /*
         * Inject debug information
         */
        if (Agent.debug) {
            getStatic(Type.getType(System.class), "err", Type.getType(PrintStream.class));
            push("Javametrics: Calling instrumented method: " + className + "." + methodName);
            invokeVirtual(Type.getType(PrintStream.class), Method.getMethod("void println(java.lang.String)"));
        }
    }
860865
protected void execute(WebElement element, SeleniumBrowser browser, TestContext context) {
        if (StringUtils.hasText(element.getTagName())) {
            context.setVariable(element.getTagName(), element);
        }
    }
1091874
private <A extends Annotation, AS extends Annotation> void addOrMergeInjectionBinding(int processorIndex,
                                                                                          InjectionProcessor<A, AS> processor,
                                                                                          Class<?> klass,
                                                                                          Member member,
                                                                                          A ann)
                    throws InjectionException
    {
        // Lazily create override processors as needed.
        if (ivOverrideIndices != null)
        {
            int overrideIndex = ivOverrideIndices[processorIndex];
            if (overrideIndex != -1)
            {
                // Create and set the override processor only once.
                ivOverrideIndices[processorIndex] = -1;

                InjectionProcessor<?, ?> overrideProcessor = getProcessor(overrideIndex, ivProviders.get(overrideIndex));
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "adding override processor " + overrideProcessor + " to " + processor);
                InjectionProcessorContextImpl.setOverrideProcessor(processor, overrideProcessor);
            }
        }

        InjectionProcessorContextImpl.addOrMergeInjectionBinding(processor, klass, member, ann);
    }
1359002
@SuppressWarnings("unchecked")
    public void injectNonContextualInstance(final Object instance) {
        if (instance != null) {
            CreationalContext<Object> creationalContext = manager.createCreationalContext(null);
            InjectionTarget<Object> injectionTarget = (InjectionTarget<Object>) manager
                    .createInjectionTarget(getAnnotatedType(instance));
            injectionTarget.inject(instance, creationalContext);
        }
    }
947275
def inject(span_context, format, carrier)
      case format
      when OpenTracing::FORMAT_TEXT_MAP
        inject_to_text_map(span_context, carrier)
      when OpenTracing::FORMAT_BINARY
        warn 'Binary inject format not yet implemented'
      when OpenTracing::FORMAT_RACK
        inject_to_rack(span_context, carrier)
      else
        warn 'Unknown inject format'
      end
    end
250690
public void setInjectionBinding(InjectionBinding<?> injectionBinding) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "setInjectionBinding : " + injectionBinding);

        ivInjectionBinding = injectionBinding;
    }
283789
public void setText(String text) {
        span.setText(text);

        if (!span.isAttached()) {
            add(span);
        }
    }
1053359
@Benchmark
  @BenchmarkMode(Mode.SampleTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public SpanContext extract(Data data) throws SpanContextParseException {
    return data.textFormatBase.extract(data.spanContextHeaders);
  }
566478
void performJavaNameSpaceBinding() throws InjectionException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "performJavaNameSpaceBinding: " + this);

        for (InjectionBinding<A> injectionBinding : ivAllAnnotationsCollection.values())
        {
            // F743-31682 - Only bind to java:global/:app/:module if needed.
            if (injectionBinding.getInjectionScope() == InjectionScope.COMP ||
                ivContext.ivBindNonCompInjectionBindings)
            {
                if (injectionBinding.getBindingObject() == null)
                {
                    if (isTraceOn && tc.isDebugEnabled())
                        Tr.debug(tc, "skipping empty " + injectionBinding);
                }
                else
                {
                    injectionBinding.bindInjectedObject();
                }
            }
            else
            {
                if (isTraceOn && tc.isEntryEnabled())
                    Tr.debug(tc, "skipping non-java:comp " + injectionBinding.toSimpleString());
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "performJavaNameSpaceBinding");
    }
680474
@Override
    public InjectionBinding<AdministeredObjectDefinition> createInjectionBinding(AdministeredObjectDefinition annotation, Class<?> instanceClass, Member member, String jndiName) throws InjectionException {
        InjectionBinding<AdministeredObjectDefinition> injectionBinding =
                        new AdministeredObjectDefinitionInjectionBinding(jndiName, ivNameSpaceConfig);
        injectionBinding.merge(annotation, instanceClass, null);
        return injectionBinding;
    }
303548
public static void injectWebServiceContext(final Object instance, final WebServiceContext ctx)
   {
      final Class<?> instanceClass = instance.getClass();

      // inject @Resource annotated methods accepting WebServiceContext parameter
      Collection<Method> resourceAnnotatedMethods = WEB_SERVICE_CONTEXT_METHOD_FINDER.process(instanceClass);
      for(Method method : resourceAnnotatedMethods)
      {
         try
         {
            invokeMethod(instance, method, new Object[] {ctx});
         }
         catch (Exception e)
         {
            final String message = "Cannot inject @Resource annotated method: " + method;
            InjectionException.rethrow(message, e);
         }
      }

      // inject @Resource annotated fields of WebServiceContext type
      final Collection<Field> resourceAnnotatedFields = WEB_SERVICE_CONTEXT_FIELD_FINDER.process(instanceClass);
      for (Field field : resourceAnnotatedFields)
      {
         try
         {
            setField(instance, field, ctx);
         }
         catch (Exception e)
         {
            final String message = "Cannot inject @Resource annotated field: " + field;
            InjectionException.rethrow(message, e);
         }
      }
   }
856841
public InjectionNode buildInjectionNode(ASTType astType, AnalysisContext context) {
        return buildInjectionNode(Collections.EMPTY_LIST, astType, astType, context);
    }
845346
@Override
    public Object eval(Reader reader, ScriptContext context) throws ScriptException {
	try {
	    return eval(IOUtil.toString(reader), context);
	}
	catch (IOException ioe) {
	    throw toScriptException(ioe);
	}
    }
1337994
@Override
    public final InjectionBinding<A> createInjectionBinding(A annotation,
                                                            Class<?> instanceClass,
                                                            Member member,
                                                            String jndiName)
                    throws InjectionException
    {
        return createInjectionBinding(annotation, instanceClass, member);
    }
742294
@Benchmark
    public ExampleInterface benchmarkByteBuddy() throws Exception {
        return new ByteBuddy()
                .with(TypeValidation.DISABLED)
                .ignore(none())
                .subclass(baseClass)
                .method(isDeclaredBy(baseClass)).intercept(StubMethod.INSTANCE)
                .make()
                .load(newClassLoader(), ClassLoadingStrategy.Default.INJECTION)
                .getLoaded()
                .getDeclaredConstructor()
                .newInstance();
    }