core/src/com/google/inject/internal/ProviderMethod.java
static <T> ProviderMethod<T> create(
      Key<T> key,
      Method method,
      Object instance,
      ImmutableSet<Dependency<?>> dependencies,
      Class<? extends Annotation> scopeAnnotation,
      boolean skipFastClassGeneration,
      Annotation annotation) {
    int modifiers = method.getModifiers();
    /*if[AOP]*/
    if (!skipFastClassGeneration) {
      try {
        net.sf.cglib.reflect.FastClass fc = BytecodeGen.newFastClassForMember(method);
        if (fc != null) {
          return new FastClassProviderMethod<T>(
              key, fc, method, instance, dependencies, scopeAnnotation, annotation);
        }
      } catch (net.sf.cglib.core.CodeGenerationException e) {
        /* fall-through */
      }
    }
    /*end[AOP]*/

    if (!Modifier.isPublic(modifiers)
        || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) {
      method.setAccessible(true);
    }

    return new ReflectionProviderMethod<T>(
        key, method, instance, dependencies, scopeAnnotation, annotation);
  }
static <T> ProviderMethod<T> create(
      Key<T> key,
      Method method,
      Object instance,
      ImmutableSet<Dependency<?>> dependencies,
      Class<? extends Annotation> scopeAnnotation,
      boolean skipFastClassGeneration,
      Annotation annotation) {
    int modifiers = method.getModifiers();
    /*if[AOP]*/
    if (!skipFastClassGeneration) {
      try {
        net.sf.cglib.reflect.FastClass fc = BytecodeGen.newFastClassForMember(method);
        if (fc != null) {
          return new FastClassProviderMethod<T>(
              key, fc, method, instance, dependencies, scopeAnnotation, annotation);
        }
      } catch (net.sf.cglib.core.CodeGenerationException e) {
        /* fall-through */
      }
    }
    /*end[AOP]*/

    if (!Modifier.isPublic(modifiers)
        || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) {
      method.setAccessible(true);
    }

    return new ReflectionProviderMethod<T>(
        key, method, instance, dependencies, scopeAnnotation, annotation);
  }
Creates a {@link ProviderMethod}.

<p>Unless {@code skipFastClassGeneration} is set, this will use {@link
net.sf.cglib.reflect.FastClass} to invoke the actual method, since it is significantly faster.
However, this will fail if the method is {@code private} or {@code protected}, since fastclass
is subject to java access policies.