8008371: Fix Dynalink compiler warnings and whitespace

Mon, 18 Feb 2013 16:00:15 +0100

author
attila
date
Mon, 18 Feb 2013 16:00:15 +0100
changeset 101
f8221ce53c2e
parent 100
3245e174fe3a
child 102
4738de1bd57f

8008371: Fix Dynalink compiler warnings and whitespace
Reviewed-by: jlaskey, sundar

src/jdk/internal/dynalink/CallSiteDescriptor.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/ChainedCallSite.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/DefaultBootstrapper.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/DynamicLinker.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/DynamicLinkerFactory.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/MonomorphicCallSite.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/NoSuchDynamicMethodException.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/RelinkableCallSite.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/AbstractJavaLinker.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/ApplicableOverloadedMethods.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/BeanLinker.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/BeansLinker.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/CheckRestrictedPackageInternal.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/ClassLinker.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/ClassString.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/DynamicMethod.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/DynamicMethodLinker.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/FacetIntrospector.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/GuardedInvocationComponent.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/MaximallySpecific.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/OverloadedMethod.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/SimpleDynamicMethod.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/StaticClass.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/beans/StaticClassLinker.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/linker/GuardedInvocation.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/linker/GuardingDynamicLinker.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/linker/GuardingTypeConverterFactory.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/linker/LinkRequest.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/linker/LinkerServices.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/AbstractCallSiteDescriptor.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/AbstractRelinkableCallSite.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/AutoDiscovery.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/BottomGuardingDynamicLinker.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/CallSiteDescriptorFactory.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/CompositeGuardingDynamicLinker.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/CompositeTypeBasedGuardingDynamicLinker.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/DefaultCallSiteDescriptor.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/Guards.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/LinkRequestImpl.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/LinkerServicesImpl.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/Lookup.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/LookupCallSiteDescriptor.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/NamedDynCallSiteDescriptor.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/RuntimeContextLinkRequestImpl.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/TypeConverterFactory.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/TypeUtilities.java file | annotate | diff | comparison | revisions
src/jdk/internal/dynalink/support/UnnamedDynCallSiteDescriptor.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/codegen/CompilationPhase.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/codegen/FunctionSignature.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/ir/FunctionNode.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/objects/ScriptFunctionTrampolineImpl.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/parser/Parser.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/Context.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/jdk/internal/dynalink/CallSiteDescriptor.java	Mon Feb 18 10:36:18 2013 +0100
     1.2 +++ b/src/jdk/internal/dynalink/CallSiteDescriptor.java	Mon Feb 18 16:00:15 2013 +0100
     1.3 @@ -87,7 +87,6 @@
     1.4  import java.lang.invoke.MethodType;
     1.5  import jdk.internal.dynalink.support.CallSiteDescriptorFactory;
     1.6  
     1.7 -
     1.8  /**
     1.9   * An immutable descriptor of a call site. It is an immutable object that contains all the information about a call
    1.10   * site: the class performing the lookups, the name of the method being invoked, and the method signature. The library
    1.11 @@ -172,4 +171,4 @@
    1.12       */
    1.13      public CallSiteDescriptor changeMethodType(MethodType newMethodType);
    1.14  
    1.15 -}
    1.16 \ No newline at end of file
    1.17 +}
     2.1 --- a/src/jdk/internal/dynalink/ChainedCallSite.java	Mon Feb 18 10:36:18 2013 +0100
     2.2 +++ b/src/jdk/internal/dynalink/ChainedCallSite.java	Mon Feb 18 16:00:15 2013 +0100
     2.3 @@ -92,7 +92,6 @@
     2.4  import jdk.internal.dynalink.linker.GuardedInvocation;
     2.5  import jdk.internal.dynalink.support.AbstractRelinkableCallSite;
     2.6  
     2.7 -
     2.8  /**
     2.9   * A relinkable call site that maintains a chain of linked method handles. In the default implementation, up to 8 method
    2.10   * handles can be chained, cascading from one to the other through
    2.11 @@ -209,4 +208,4 @@
    2.12              throw new AssertionError(e.getMessage(), e); // Can not happen
    2.13          }
    2.14      }
    2.15 -}
    2.16 \ No newline at end of file
    2.17 +}
     3.1 --- a/src/jdk/internal/dynalink/DefaultBootstrapper.java	Mon Feb 18 10:36:18 2013 +0100
     3.2 +++ b/src/jdk/internal/dynalink/DefaultBootstrapper.java	Mon Feb 18 16:00:15 2013 +0100
     3.3 @@ -88,7 +88,6 @@
     3.4  import java.lang.invoke.MethodType;
     3.5  import jdk.internal.dynalink.support.CallSiteDescriptorFactory;
     3.6  
     3.7 -
     3.8  /**
     3.9   * A convenience default bootstrapper that exposes static bootstrap methods which language runtimes that need the very
    3.10   * default behavior can use with minimal setup. When first referenced, it will create a dynamic linker with default
    3.11 @@ -141,4 +140,4 @@
    3.12      private static CallSite bootstrapInternal(MethodHandles.Lookup caller, String name, MethodType type) {
    3.13          return dynamicLinker.link(new MonomorphicCallSite(CallSiteDescriptorFactory.create(caller, name, type)));
    3.14      }
    3.15 -}
    3.16 \ No newline at end of file
    3.17 +}
     4.1 --- a/src/jdk/internal/dynalink/DynamicLinker.java	Mon Feb 18 10:36:18 2013 +0100
     4.2 +++ b/src/jdk/internal/dynalink/DynamicLinker.java	Mon Feb 18 16:00:15 2013 +0100
     4.3 @@ -97,7 +97,6 @@
     4.4  import jdk.internal.dynalink.support.Lookup;
     4.5  import jdk.internal.dynalink.support.RuntimeContextLinkRequestImpl;
     4.6  
     4.7 -
     4.8  /**
     4.9   * The linker for {@link RelinkableCallSite} objects. Users of it (scripting frameworks and language runtimes) have to
    4.10   * create a linker using the {@link DynamicLinkerFactory} and invoke its link method from the invokedynamic bootstrap
    4.11 @@ -246,14 +245,15 @@
    4.12              }
    4.13          }
    4.14  
    4.15 -        if(unstableDetectionEnabled && relinkCount <= unstableRelinkThreshold && relinkCount++ == unstableRelinkThreshold) {
    4.16 -            // Note that we'll increase the relinkCount until threshold+1 and not increase it beyond that. Threshold+1
    4.17 -            // is treated as a special value to signal that resetAndRelink has already executed once for the unstable
    4.18 -            // call site; we only want the call site to throw away its current linkage once, when it transitions to
    4.19 -            // unstable.
    4.20 -            callSite.resetAndRelink(guardedInvocation, createRelinkAndInvokeMethod(callSite, relinkCount));
    4.21 +        int newRelinkCount = relinkCount;
    4.22 +        // Note that the short-circuited "&&" evaluation below ensures we'll increment the relinkCount until
    4.23 +        // threshold + 1 but not beyond that. Threshold + 1 is treated as a special value to signal that resetAndRelink
    4.24 +        // has already executed once for the unstable call site; we only want the call site to throw away its current
    4.25 +        // linkage once, when it transitions to unstable.
    4.26 +        if(unstableDetectionEnabled && newRelinkCount <= unstableRelinkThreshold && newRelinkCount++ == unstableRelinkThreshold) {
    4.27 +            callSite.resetAndRelink(guardedInvocation, createRelinkAndInvokeMethod(callSite, newRelinkCount));
    4.28          } else {
    4.29 -            callSite.relink(guardedInvocation, createRelinkAndInvokeMethod(callSite, relinkCount));
    4.30 +            callSite.relink(guardedInvocation, createRelinkAndInvokeMethod(callSite, newRelinkCount));
    4.31          }
    4.32          if(syncOnRelink) {
    4.33              MutableCallSite.syncAll(new MutableCallSite[] { (MutableCallSite)callSite });
     5.1 --- a/src/jdk/internal/dynalink/DynamicLinkerFactory.java	Mon Feb 18 10:36:18 2013 +0100
     5.2 +++ b/src/jdk/internal/dynalink/DynamicLinkerFactory.java	Mon Feb 18 16:00:15 2013 +0100
     5.3 @@ -102,7 +102,6 @@
     5.4  import jdk.internal.dynalink.support.LinkerServicesImpl;
     5.5  import jdk.internal.dynalink.support.TypeConverterFactory;
     5.6  
     5.7 -
     5.8  /**
     5.9   * A factory class for creating {@link DynamicLinker}s. The most usual dynamic linker is a linker that is a composition
    5.10   * of all {@link GuardingDynamicLinker}s known and pre-created by the caller as well as any
    5.11 @@ -256,14 +255,16 @@
    5.12  
    5.13          // Gather classes of all precreated (prioritized and fallback) linkers.
    5.14          // We'll filter out any discovered linkers of the same class.
    5.15 -        final Set<Class<? extends GuardingDynamicLinker>> knownLinkerClasses = new HashSet<>();
    5.16 +        final Set<Class<? extends GuardingDynamicLinker>> knownLinkerClasses =
    5.17 +                new HashSet<>();
    5.18          addClasses(knownLinkerClasses, prioritizedLinkers);
    5.19          addClasses(knownLinkerClasses, fallbackLinkers);
    5.20  
    5.21          final List<GuardingDynamicLinker> discovered = AutoDiscovery.loadLinkers(classLoader);
    5.22          // Now, concatenate ...
    5.23 -        final List<GuardingDynamicLinker> linkers = new ArrayList<>(prioritizedLinkers.size() + discovered.size()
    5.24 -                + fallbackLinkers.size());
    5.25 +        final List<GuardingDynamicLinker> linkers =
    5.26 +                new ArrayList<>(prioritizedLinkers.size() + discovered.size()
    5.27 +                        + fallbackLinkers.size());
    5.28          // ... prioritized linkers, ...
    5.29          linkers.addAll(prioritizedLinkers);
    5.30          // ... filtered discovered linkers, ...
    5.31 @@ -308,4 +309,4 @@
    5.32              knownLinkerClasses.add(linker.getClass());
    5.33          }
    5.34      }
    5.35 -}
    5.36 \ No newline at end of file
    5.37 +}
     6.1 --- a/src/jdk/internal/dynalink/MonomorphicCallSite.java	Mon Feb 18 10:36:18 2013 +0100
     6.2 +++ b/src/jdk/internal/dynalink/MonomorphicCallSite.java	Mon Feb 18 16:00:15 2013 +0100
     6.3 @@ -87,7 +87,6 @@
     6.4  import jdk.internal.dynalink.linker.GuardedInvocation;
     6.5  import jdk.internal.dynalink.support.AbstractRelinkableCallSite;
     6.6  
     6.7 -
     6.8  /**
     6.9   * A relinkable call site that implements monomorphic inline caching strategy. After it linked a method, it will keep it
    6.10   * until either its guard evaluates to false, or its switchpoint is invalidated, at which time it will throw away the
    6.11 @@ -113,4 +112,4 @@
    6.12      public void resetAndRelink(GuardedInvocation guardedInvocation, MethodHandle relink) {
    6.13          relink(guardedInvocation, relink);
    6.14      }
    6.15 -}
    6.16 \ No newline at end of file
    6.17 +}
     7.1 --- a/src/jdk/internal/dynalink/NoSuchDynamicMethodException.java	Mon Feb 18 10:36:18 2013 +0100
     7.2 +++ b/src/jdk/internal/dynalink/NoSuchDynamicMethodException.java	Mon Feb 18 16:00:15 2013 +0100
     7.3 @@ -100,4 +100,4 @@
     7.4      public NoSuchDynamicMethodException(String message) {
     7.5          super(message);
     7.6      }
     7.7 -}
     7.8 \ No newline at end of file
     7.9 +}
     8.1 --- a/src/jdk/internal/dynalink/RelinkableCallSite.java	Mon Feb 18 10:36:18 2013 +0100
     8.2 +++ b/src/jdk/internal/dynalink/RelinkableCallSite.java	Mon Feb 18 16:00:15 2013 +0100
     8.3 @@ -89,7 +89,6 @@
     8.4  import java.lang.invoke.VolatileCallSite;
     8.5  import jdk.internal.dynalink.linker.GuardedInvocation;
     8.6  
     8.7 -
     8.8  /**
     8.9   * Interface for relinkable call sites. Language runtimes wishing to use this framework must use subclasses of
    8.10   * {@link CallSite} that also implement this interface as their call sites. There is a readily usable
    8.11 @@ -145,4 +144,4 @@
    8.12       * {@link #resetAndRelink(GuardedInvocation, MethodHandle)}, and finally invoke the target.
    8.13       */
    8.14      public void resetAndRelink(GuardedInvocation guardedInvocation, MethodHandle fallback);
    8.15 -}
    8.16 \ No newline at end of file
    8.17 +}
     9.1 --- a/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java	Mon Feb 18 10:36:18 2013 +0100
     9.2 +++ b/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java	Mon Feb 18 16:00:15 2013 +0100
     9.3 @@ -103,7 +103,6 @@
     9.4  import jdk.internal.dynalink.support.Guards;
     9.5  import jdk.internal.dynalink.support.Lookup;
     9.6  
     9.7 -
     9.8  /**
     9.9   * A base class for both {@link StaticClassLinker} and {@link BeanLinker}. Deals with common aspects of property
    9.10   * exposure and method calls for both static and instance facets of a class.
    9.11 @@ -128,50 +127,46 @@
    9.12          this.assignableGuard = assignableGuard;
    9.13  
    9.14          final FacetIntrospector introspector = createFacetIntrospector();
    9.15 -        try {
    9.16 -            // Add methods and properties
    9.17 -            for(Method method: introspector.getMethods()) {
    9.18 -                final String name = method.getName();
    9.19 -                final MethodHandle methodHandle = introspector.unreflect(method);
    9.20 -                // Add method
    9.21 -                addMember(name, methodHandle, methods);
    9.22 -                // Add the method as a property getter and/or setter
    9.23 -                if(name.startsWith("get") && name.length() > 3 && method.getParameterTypes().length == 0) {
    9.24 -                    // Property getter
    9.25 -                    setPropertyGetter(Introspector.decapitalize(name.substring(3)), introspector.unreflect(
    9.26 -                            getMostGenericGetter(method)), ValidationType.INSTANCE_OF);
    9.27 -                } else if(name.startsWith("is") && name.length() > 2 && method.getParameterTypes().length == 0 &&
    9.28 -                        method.getReturnType() == boolean.class) {
    9.29 -                    // Boolean property getter
    9.30 -                    setPropertyGetter(Introspector.decapitalize(name.substring(2)), introspector.unreflect(
    9.31 -                            getMostGenericGetter(method)), ValidationType.INSTANCE_OF);
    9.32 -                } else if(name.startsWith("set") && name.length() > 3 && method.getParameterTypes().length == 1) {
    9.33 -                    // Property setter
    9.34 -                    addMember(Introspector.decapitalize(name.substring(3)), methodHandle, propertySetters);
    9.35 -                }
    9.36 +        // Add methods and properties
    9.37 +        for(Method method: introspector.getMethods()) {
    9.38 +            final String name = method.getName();
    9.39 +            final MethodHandle methodHandle = introspector.unreflect(method);
    9.40 +            // Add method
    9.41 +            addMember(name, methodHandle, methods);
    9.42 +            // Add the method as a property getter and/or setter
    9.43 +            if(name.startsWith("get") && name.length() > 3 && method.getParameterTypes().length == 0) {
    9.44 +                // Property getter
    9.45 +                setPropertyGetter(Introspector.decapitalize(name.substring(3)), introspector.unreflect(
    9.46 +                        getMostGenericGetter(method)), ValidationType.INSTANCE_OF);
    9.47 +            } else if(name.startsWith("is") && name.length() > 2 && method.getParameterTypes().length == 0 &&
    9.48 +                    method.getReturnType() == boolean.class) {
    9.49 +                // Boolean property getter
    9.50 +                setPropertyGetter(Introspector.decapitalize(name.substring(2)), introspector.unreflect(
    9.51 +                        getMostGenericGetter(method)), ValidationType.INSTANCE_OF);
    9.52 +            } else if(name.startsWith("set") && name.length() > 3 && method.getParameterTypes().length == 1) {
    9.53 +                // Property setter
    9.54 +                addMember(Introspector.decapitalize(name.substring(3)), methodHandle, propertySetters);
    9.55              }
    9.56 +        }
    9.57  
    9.58 -            // Add field getter/setters as property getters/setters.
    9.59 -            for(Field field: introspector.getFields()) {
    9.60 -                final String name = field.getName();
    9.61 -                // Only add a property getter when one is not defined already as a getXxx()/isXxx() method.
    9.62 -                if(!propertyGetters.containsKey(name)) {
    9.63 -                    setPropertyGetter(name, introspector.unreflectGetter(field), ValidationType.EXACT_CLASS);
    9.64 -                }
    9.65 -                if(!(Modifier.isFinal(field.getModifiers()) || propertySetters.containsKey(name))) {
    9.66 -                    addMember(name, introspector.unreflectSetter(field), propertySetters);
    9.67 -                }
    9.68 +        // Add field getter/setters as property getters/setters.
    9.69 +        for(Field field: introspector.getFields()) {
    9.70 +            final String name = field.getName();
    9.71 +            // Only add a property getter when one is not defined already as a getXxx()/isXxx() method.
    9.72 +            if(!propertyGetters.containsKey(name)) {
    9.73 +                setPropertyGetter(name, introspector.unreflectGetter(field), ValidationType.EXACT_CLASS);
    9.74              }
    9.75 +            if(!(Modifier.isFinal(field.getModifiers()) || propertySetters.containsKey(name))) {
    9.76 +                addMember(name, introspector.unreflectSetter(field), propertySetters);
    9.77 +            }
    9.78 +        }
    9.79  
    9.80 -            // Add inner classes, but only those for which we don't hide a property with it
    9.81 -            for(Map.Entry<String, MethodHandle> innerClassSpec: introspector.getInnerClassGetters().entrySet()) {
    9.82 -                final String name = innerClassSpec.getKey();
    9.83 -                if(!propertyGetters.containsKey(name)) {
    9.84 -                    setPropertyGetter(name, innerClassSpec.getValue(), ValidationType.EXACT_CLASS);
    9.85 -                }
    9.86 +        // Add inner classes, but only those for which we don't hide a property with it
    9.87 +        for(Map.Entry<String, MethodHandle> innerClassSpec: introspector.getInnerClassGetters().entrySet()) {
    9.88 +            final String name = innerClassSpec.getKey();
    9.89 +            if(!propertyGetters.containsKey(name)) {
    9.90 +                setPropertyGetter(name, innerClassSpec.getValue(), ValidationType.EXACT_CLASS);
    9.91              }
    9.92 -        } finally {
    9.93 -            introspector.close();
    9.94          }
    9.95      }
    9.96  
    9.97 @@ -394,10 +389,8 @@
    9.98                              IS_METHOD_HANDLE_NOT_NULL, invokeHandleFolded, fallbackFolded), typedGetter);
    9.99                  if(nextComponent == null) {
   9.100                      return getClassGuardedInvocationComponent(compositeSetter, type);
   9.101 -                } else {
   9.102 -                    return nextComponent.compose(compositeSetter, getClassGuard(type), clazz,
   9.103 -                            ValidationType.EXACT_CLASS);
   9.104                  }
   9.105 +                return nextComponent.compose(compositeSetter, getClassGuard(type), clazz, ValidationType.EXACT_CLASS);
   9.106              }
   9.107              case 3: {
   9.108                  // Must have two arguments: target object and property value
   9.109 @@ -474,10 +467,8 @@
   9.110                              IS_ANNOTATED_HANDLE_NOT_NULL, invokeHandleFolded, fallbackFolded), typedGetter);
   9.111                  if(nextComponent == null) {
   9.112                      return getClassGuardedInvocationComponent(compositeGetter, type);
   9.113 -                } else {
   9.114 -                    return nextComponent.compose(compositeGetter, getClassGuard(type), clazz,
   9.115 -                            ValidationType.EXACT_CLASS);
   9.116                  }
   9.117 +                return nextComponent.compose(compositeGetter, getClassGuard(type), clazz, ValidationType.EXACT_CLASS);
   9.118              }
   9.119              case 3: {
   9.120                  // Must have exactly one argument: receiver
   9.121 @@ -521,8 +512,10 @@
   9.122              case NONE: {
   9.123                  return null;
   9.124              }
   9.125 +            default: {
   9.126 +                throw new AssertionError();
   9.127 +            }
   9.128          }
   9.129 -        throw new AssertionError();
   9.130      }
   9.131  
   9.132      private static final MethodHandle IS_DYNAMIC_METHOD_NOT_NULL = Guards.asType(Guards.isNotNull(),
   9.133 @@ -541,32 +534,30 @@
   9.134                  if(nextComponent == null) {
   9.135                      // No next component operation; just return a component for this operation.
   9.136                      return getClassGuardedInvocationComponent(linkerServices.asType(getDynamicMethod, type), type);
   9.137 -                } else {
   9.138 -                    // What's below is basically:
   9.139 -                    //   foldArguments(guardWithTest(isNotNull, identity, nextComponent.invocation), getter)
   9.140 -                    // only with a bunch of method signature adjustments. Basically, execute method getter; if
   9.141 -                    // it returns a non-null DynamicMethod, use identity to return it, otherwise delegate to
   9.142 -                    // nextComponent's invocation.
   9.143 +                }
   9.144  
   9.145 -                    final MethodHandle typedGetter = linkerServices.asType(getDynamicMethod, type.changeReturnType(
   9.146 -                            DynamicMethod.class));
   9.147 -                    // Since it is part of the foldArgument() target, it will have extra args that we need to drop.
   9.148 -                    final MethodHandle returnMethodHandle = linkerServices.asType(MethodHandles.dropArguments(
   9.149 -                            DYNAMIC_METHOD_IDENTITY, 1, type.parameterList()), type.insertParameterTypes(0,
   9.150 -                                    DynamicMethod.class));
   9.151 -                    final MethodHandle nextComponentInvocation = nextComponent.getGuardedInvocation().getInvocation();
   9.152 -                    // The assumption is that getGuardedInvocationComponent() already asType()'d it correctly
   9.153 -                    assert nextComponentInvocation.type().equals(type);
   9.154 -                    // Since it is part of the foldArgument() target, we have to drop an extra arg it receives.
   9.155 -                    final MethodHandle nextCombinedInvocation = MethodHandles.dropArguments(nextComponentInvocation, 0,
   9.156 -                            DynamicMethod.class);
   9.157 -                    // Assemble it all into a fold(guard(isNotNull, identity, nextInvocation), get)
   9.158 -                    final MethodHandle compositeGetter = MethodHandles.foldArguments(MethodHandles.guardWithTest(
   9.159 -                            IS_DYNAMIC_METHOD_NOT_NULL, returnMethodHandle, nextCombinedInvocation), typedGetter);
   9.160 +                // What's below is basically:
   9.161 +                // foldArguments(guardWithTest(isNotNull, identity, nextComponent.invocation), getter) only with a
   9.162 +                // bunch of method signature adjustments. Basically, execute method getter; if it returns a non-null
   9.163 +                // DynamicMethod, use identity to return it, otherwise delegate to nextComponent's invocation.
   9.164  
   9.165 -                    return nextComponent.compose(compositeGetter, getClassGuard(type), clazz,
   9.166 -                            ValidationType.EXACT_CLASS);
   9.167 -                }
   9.168 +                final MethodHandle typedGetter = linkerServices.asType(getDynamicMethod, type.changeReturnType(
   9.169 +                        DynamicMethod.class));
   9.170 +                // Since it is part of the foldArgument() target, it will have extra args that we need to drop.
   9.171 +                final MethodHandle returnMethodHandle = linkerServices.asType(MethodHandles.dropArguments(
   9.172 +                        DYNAMIC_METHOD_IDENTITY, 1, type.parameterList()), type.insertParameterTypes(0,
   9.173 +                                DynamicMethod.class));
   9.174 +                final MethodHandle nextComponentInvocation = nextComponent.getGuardedInvocation().getInvocation();
   9.175 +                // The assumption is that getGuardedInvocationComponent() already asType()'d it correctly
   9.176 +                assert nextComponentInvocation.type().equals(type);
   9.177 +                // Since it is part of the foldArgument() target, we have to drop an extra arg it receives.
   9.178 +                final MethodHandle nextCombinedInvocation = MethodHandles.dropArguments(nextComponentInvocation, 0,
   9.179 +                        DynamicMethod.class);
   9.180 +                // Assemble it all into a fold(guard(isNotNull, identity, nextInvocation), get)
   9.181 +                final MethodHandle compositeGetter = MethodHandles.foldArguments(MethodHandles.guardWithTest(
   9.182 +                        IS_DYNAMIC_METHOD_NOT_NULL, returnMethodHandle, nextCombinedInvocation), typedGetter);
   9.183 +
   9.184 +                return nextComponent.compose(compositeGetter, getClassGuard(type), clazz, ValidationType.EXACT_CLASS);
   9.185              }
   9.186              case 3: {
   9.187                  // Must have exactly one argument: receiver
   9.188 @@ -638,7 +629,7 @@
   9.189       * @return the dynamic method (either {@link SimpleDynamicMethod} or {@link OverloadedDynamicMethod}, or null if the
   9.190       * method with the specified name does not exist.
   9.191       */
   9.192 -    public DynamicMethod getDynamicMethod(String name) {
   9.193 +    DynamicMethod getDynamicMethod(String name) {
   9.194          return getDynamicMethod(name, methods);
   9.195      }
   9.196  
   9.197 @@ -687,4 +678,4 @@
   9.198              this.validationType = validationType;
   9.199          }
   9.200      }
   9.201 -}
   9.202 \ No newline at end of file
   9.203 +}
    10.1 --- a/src/jdk/internal/dynalink/beans/ApplicableOverloadedMethods.java	Mon Feb 18 10:36:18 2013 +0100
    10.2 +++ b/src/jdk/internal/dynalink/beans/ApplicableOverloadedMethods.java	Mon Feb 18 16:00:15 2013 +0100
    10.3 @@ -89,7 +89,6 @@
    10.4  import java.util.List;
    10.5  import jdk.internal.dynalink.support.TypeUtilities;
    10.6  
    10.7 -
    10.8  /**
    10.9   * Represents overloaded methods applicable to a specific call site signature.
   10.10   *
    11.1 --- a/src/jdk/internal/dynalink/beans/BeanLinker.java	Mon Feb 18 10:36:18 2013 +0100
    11.2 +++ b/src/jdk/internal/dynalink/beans/BeanLinker.java	Mon Feb 18 16:00:15 2013 +0100
    11.3 @@ -99,7 +99,6 @@
    11.4  import jdk.internal.dynalink.support.Lookup;
    11.5  import jdk.internal.dynalink.support.TypeUtilities;
    11.6  
    11.7 -
    11.8  /**
    11.9   * A class that provides linking capabilities for a single POJO class. Normally not used directly, but managed by
   11.10   * {@link BeansLinker}.
   11.11 @@ -176,7 +175,7 @@
   11.12          // dealing with an array, or a list or map, but hey...
   11.13          // Note that for arrays and lists, using LinkerServices.asType() will ensure that any language specific linkers
   11.14          // in use will get a chance to perform any (if there's any) implicit conversion to integer for the indices.
   11.15 -        final GuardedInvocationComponent gic;;
   11.16 +        final GuardedInvocationComponent gic;
   11.17          final boolean isMap;
   11.18          if(declaredType.isArray()) {
   11.19              gic = new GuardedInvocationComponent(MethodHandles.arrayElementGetter(declaredType));
   11.20 @@ -223,22 +222,22 @@
   11.21  
   11.22          if(nextComponent == null) {
   11.23              return gic.replaceInvocation(binder.bind(invocation));
   11.24 +        }
   11.25 +
   11.26 +        final MethodHandle checkGuard;
   11.27 +        if(invocation == GET_LIST_ELEMENT) {
   11.28 +            checkGuard = convertArgToInt(RANGE_CHECK_LIST, linkerServices, callSiteDescriptor);
   11.29 +        } else if(invocation == GET_MAP_ELEMENT) {
   11.30 +            // TODO: A more complex solution could be devised for maps, one where we do a get() first, and fold it
   11.31 +            // into a GWT that tests if it returned null, and if it did, do another GWT with containsKey()
   11.32 +            // that returns constant null (on true), or falls back to next component (on false)
   11.33 +            checkGuard = CONTAINS_MAP;
   11.34          } else {
   11.35 -            final MethodHandle checkGuard;
   11.36 -            if(invocation == GET_LIST_ELEMENT) {
   11.37 -                checkGuard = convertArgToInt(RANGE_CHECK_LIST, linkerServices, callSiteDescriptor);
   11.38 -            } else if(invocation == GET_MAP_ELEMENT) {
   11.39 -                // TODO: A more complex solution could be devised for maps, one where we do a get() first, and fold it
   11.40 -                // into a GWT that tests if it returned null, and if it did, do another GWT with containsKey()
   11.41 -                // that returns constant null (on true), or falls back to next component (on false)
   11.42 -                checkGuard = CONTAINS_MAP;
   11.43 -            } else {
   11.44 -                checkGuard = convertArgToInt(RANGE_CHECK_ARRAY, linkerServices, callSiteDescriptor);
   11.45 -            }
   11.46 -            return nextComponent.compose(MethodHandles.guardWithTest(binder.bindTest(checkGuard),
   11.47 -                    binder.bind(invocation), nextComponent.getGuardedInvocation().getInvocation()), gi.getGuard(),
   11.48 -                    gic.getValidatorClass(), gic.getValidationType());
   11.49 +            checkGuard = convertArgToInt(RANGE_CHECK_ARRAY, linkerServices, callSiteDescriptor);
   11.50          }
   11.51 +        return nextComponent.compose(MethodHandles.guardWithTest(binder.bindTest(checkGuard),
   11.52 +                binder.bind(invocation), nextComponent.getGuardedInvocation().getInvocation()), gi.getGuard(),
   11.53 +                gic.getValidatorClass(), gic.getValidationType());
   11.54      }
   11.55  
   11.56      private static String getFixedKey(final CallSiteDescriptor callSiteDescriptor) {
   11.57 @@ -435,13 +434,13 @@
   11.58  
   11.59          if(nextComponent == null) {
   11.60              return gic.replaceInvocation(binder.bind(invocation));
   11.61 -        } else {
   11.62 -            final MethodHandle checkGuard = convertArgToInt(invocation == SET_LIST_ELEMENT ? RANGE_CHECK_LIST :
   11.63 -                RANGE_CHECK_ARRAY, linkerServices, callSiteDescriptor);
   11.64 -            return nextComponent.compose(MethodHandles.guardWithTest(binder.bindTest(checkGuard),
   11.65 -                    binder.bind(invocation), nextComponent.getGuardedInvocation().getInvocation()), gi.getGuard(),
   11.66 -                    gic.getValidatorClass(), gic.getValidationType());
   11.67          }
   11.68 +
   11.69 +        final MethodHandle checkGuard = convertArgToInt(invocation == SET_LIST_ELEMENT ? RANGE_CHECK_LIST :
   11.70 +            RANGE_CHECK_ARRAY, linkerServices, callSiteDescriptor);
   11.71 +        return nextComponent.compose(MethodHandles.guardWithTest(binder.bindTest(checkGuard),
   11.72 +                binder.bind(invocation), nextComponent.getGuardedInvocation().getInvocation()), gi.getGuard(),
   11.73 +                gic.getValidatorClass(), gic.getValidationType());
   11.74      }
   11.75  
   11.76      private static MethodHandle GET_ARRAY_LENGTH = Lookup.PUBLIC.findStatic(Array.class, "getLength",
   11.77 @@ -490,4 +489,4 @@
   11.78              throw new BootstrapMethodError(descriptor.getName() + " must have exactly " + paramCount + " parameters.");
   11.79          }
   11.80      }
   11.81 -}
   11.82 \ No newline at end of file
   11.83 +}
    12.1 --- a/src/jdk/internal/dynalink/beans/BeansLinker.java	Mon Feb 18 10:36:18 2013 +0100
    12.2 +++ b/src/jdk/internal/dynalink/beans/BeansLinker.java	Mon Feb 18 16:00:15 2013 +0100
    12.3 @@ -93,7 +93,6 @@
    12.4  import jdk.internal.dynalink.linker.LinkerServices;
    12.5  import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
    12.6  
    12.7 -
    12.8  /**
    12.9   * A linker for POJOs. Normally used as the ultimate fallback linker by the {@link DynamicLinkerFactory} so it is given
   12.10   * the chance to link calls to all objects that no other language runtime recognizes. Specifically, this linker will:
   12.11 @@ -177,4 +176,4 @@
   12.12          }
   12.13          return getLinkerForClass(receiver.getClass()).getGuardedInvocation(request, linkerServices);
   12.14      }
   12.15 -}
   12.16 \ No newline at end of file
   12.17 +}
    13.1 --- a/src/jdk/internal/dynalink/beans/CheckRestrictedPackageInternal.java	Mon Feb 18 10:36:18 2013 +0100
    13.2 +++ b/src/jdk/internal/dynalink/beans/CheckRestrictedPackageInternal.java	Mon Feb 18 16:00:15 2013 +0100
    13.3 @@ -222,14 +222,14 @@
    13.4                          resolveClass(clazz);
    13.5                      }
    13.6                      return clazz;
    13.7 -                } else {
    13.8 -                    return super.loadClass(name, resolve);
    13.9                  }
   13.10 +
   13.11 +                return super.loadClass(name, resolve);
   13.12              }
   13.13          };
   13.14      }
   13.15  
   13.16 -    private static byte[] getTesterClassBytes() {
   13.17 +    static byte[] getTesterClassBytes() {
   13.18          try {
   13.19              final InputStream in = CheckRestrictedPackage.class.getResourceAsStream("RestrictedPackageTester.class");
   13.20              try {
    14.1 --- a/src/jdk/internal/dynalink/beans/ClassLinker.java	Mon Feb 18 10:36:18 2013 +0100
    14.2 +++ b/src/jdk/internal/dynalink/beans/ClassLinker.java	Mon Feb 18 16:00:15 2013 +0100
    14.3 @@ -89,7 +89,6 @@
    14.4  import jdk.internal.dynalink.beans.GuardedInvocationComponent.ValidationType;
    14.5  import jdk.internal.dynalink.support.Lookup;
    14.6  
    14.7 -
    14.8  /**
    14.9   * A linker for java.lang.Class objects. Provides a synthetic property "static" that allows access to static fields and
   14.10   * methods on the class (respecting property getter/setter conventions). Note that Class objects are not recognized by
   14.11 @@ -107,4 +106,4 @@
   14.12      private static final MethodHandle FOR_CLASS = new Lookup(MethodHandles.lookup()).findStatic(StaticClass.class,
   14.13              "forClass", MethodType.methodType(StaticClass.class, Class.class));
   14.14  
   14.15 -}
   14.16 \ No newline at end of file
   14.17 +}
    15.1 --- a/src/jdk/internal/dynalink/beans/ClassString.java	Mon Feb 18 10:36:18 2013 +0100
    15.2 +++ b/src/jdk/internal/dynalink/beans/ClassString.java	Mon Feb 18 16:00:15 2013 +0100
    15.3 @@ -91,7 +91,6 @@
    15.4  import jdk.internal.dynalink.support.Guards;
    15.5  import jdk.internal.dynalink.support.TypeUtilities;
    15.6  
    15.7 -
    15.8  /**
    15.9   *
   15.10   * @author Attila Szegedi
   15.11 @@ -206,4 +205,4 @@
   15.12      private static boolean canConvert(LinkerServices ls, Class<?> from, Class<?> to) {
   15.13          return ls == null ? TypeUtilities.isMethodInvocationConvertible(from, to) : ls.canConvert(from, to);
   15.14      }
   15.15 -}
   15.16 \ No newline at end of file
   15.17 +}
    16.1 --- a/src/jdk/internal/dynalink/beans/DynamicMethod.java	Mon Feb 18 10:36:18 2013 +0100
    16.2 +++ b/src/jdk/internal/dynalink/beans/DynamicMethod.java	Mon Feb 18 16:00:15 2013 +0100
    16.3 @@ -88,7 +88,6 @@
    16.4  import java.util.StringTokenizer;
    16.5  import jdk.internal.dynalink.linker.LinkerServices;
    16.6  
    16.7 -
    16.8  /**
    16.9   * Represents a single dynamic method. A "dynamic" method can be bound to a single Java method, or can be bound to all
   16.10   * overloaded methods of the same name on a class. Getting an invocation of a dynamic method bound to multiple
   16.11 @@ -166,4 +165,4 @@
   16.12      public String toString() {
   16.13          return "[" + getClass().getName() + " " + getName() + "]";
   16.14      }
   16.15 -}
   16.16 \ No newline at end of file
   16.17 +}
    17.1 --- a/src/jdk/internal/dynalink/beans/DynamicMethodLinker.java	Mon Feb 18 10:36:18 2013 +0100
    17.2 +++ b/src/jdk/internal/dynalink/beans/DynamicMethodLinker.java	Mon Feb 18 16:00:15 2013 +0100
    17.3 @@ -93,7 +93,6 @@
    17.4  import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
    17.5  import jdk.internal.dynalink.support.Guards;
    17.6  
    17.7 -
    17.8  /**
    17.9   * Simple linker that implements the "dyn:call" operation for {@link DynamicMethod} objects - the objects returned by
   17.10   * "dyn:getMethod" from {@link AbstractJavaLinker}.
   17.11 @@ -102,7 +101,7 @@
   17.12      @Override
   17.13      public boolean canLinkType(Class<?> type) {
   17.14          return DynamicMethod.class.isAssignableFrom(type);
   17.15 -    };
   17.16 +    }
   17.17  
   17.18      @Override
   17.19      public GuardedInvocation getGuardedInvocation(LinkRequest linkRequest, LinkerServices linkerServices) {
    18.1 --- a/src/jdk/internal/dynalink/beans/FacetIntrospector.java	Mon Feb 18 10:36:18 2013 +0100
    18.2 +++ b/src/jdk/internal/dynalink/beans/FacetIntrospector.java	Mon Feb 18 16:00:15 2013 +0100
    18.3 @@ -94,13 +94,12 @@
    18.4  import java.util.Map;
    18.5  import jdk.internal.dynalink.support.Lookup;
    18.6  
    18.7 -
    18.8  /**
    18.9   * Base for classes that expose class field and method information to an {@link AbstractJavaLinker}. There are
   18.10   * subclasses for instance (bean) and static facet of a class.
   18.11   * @author Attila Szegedi
   18.12   */
   18.13 -abstract class FacetIntrospector implements AutoCloseable {
   18.14 +abstract class FacetIntrospector {
   18.15      private final Class<?> clazz;
   18.16      private final boolean instance;
   18.17      private final boolean isRestricted;
   18.18 @@ -181,8 +180,4 @@
   18.19       * @return the edited method handle.
   18.20       */
   18.21      abstract MethodHandle editMethodHandle(MethodHandle mh);
   18.22 -
   18.23 -    @Override
   18.24 -    public void close() {
   18.25 -    }
   18.26 -}
   18.27 \ No newline at end of file
   18.28 +}
    19.1 --- a/src/jdk/internal/dynalink/beans/GuardedInvocationComponent.java	Mon Feb 18 10:36:18 2013 +0100
    19.2 +++ b/src/jdk/internal/dynalink/beans/GuardedInvocationComponent.java	Mon Feb 18 16:00:15 2013 +0100
    19.3 @@ -86,7 +86,6 @@
    19.4  import java.lang.invoke.MethodHandle;
    19.5  import jdk.internal.dynalink.linker.GuardedInvocation;
    19.6  
    19.7 -
    19.8  /**
    19.9   * Represents one component for a GuardedInvocation of a potentially composite operation of an
   19.10   * {@link AbstractJavaLinker}. In addition to holding a guarded invocation, it holds semantic information about its
   19.11 @@ -196,8 +195,8 @@
   19.12                                  return this;
   19.13                              }
   19.14                              break;
   19.15 -                        case NONE:
   19.16 -                            throw new AssertionError(); // Not possible
   19.17 +                        default:
   19.18 +                            throw new AssertionError();
   19.19                      }
   19.20                      break;
   19.21                  case EXACT_CLASS:
   19.22 @@ -217,8 +216,8 @@
   19.23                                  return this;
   19.24                              }
   19.25                              break;
   19.26 -                        case NONE:
   19.27 -                            throw new AssertionError(); // Not possible
   19.28 +                        default:
   19.29 +                            throw new AssertionError();
   19.30                      }
   19.31                      break;
   19.32                  case IS_ARRAY:
   19.33 @@ -231,10 +230,12 @@
   19.34                              break;
   19.35                          case IS_ARRAY:
   19.36                              return this;
   19.37 -                        case NONE:
   19.38 -                            throw new AssertionError(); // Not possible
   19.39 +                        default:
   19.40 +                            throw new AssertionError();
   19.41                      }
   19.42                      break;
   19.43 +                default:
   19.44 +                    throw new AssertionError();
   19.45              }
   19.46              throw new AssertionError("Incompatible composition " + this + " vs " + other);
   19.47          }
    20.1 --- a/src/jdk/internal/dynalink/beans/MaximallySpecific.java	Mon Feb 18 10:36:18 2013 +0100
    20.2 +++ b/src/jdk/internal/dynalink/beans/MaximallySpecific.java	Mon Feb 18 16:00:15 2013 +0100
    20.3 @@ -92,7 +92,6 @@
    20.4  import jdk.internal.dynalink.linker.LinkerServices;
    20.5  import jdk.internal.dynalink.support.TypeUtilities;
    20.6  
    20.7 -
    20.8  /**
    20.9   * Utility class that encapsulates the algorithm for choosing the maximally specific methods.
   20.10   *
   20.11 @@ -141,6 +140,10 @@
   20.12                      }
   20.13                      case INDETERMINATE: {
   20.14                          // do nothing
   20.15 +                        break;
   20.16 +                    }
   20.17 +                    default: {
   20.18 +                        throw new AssertionError();
   20.19                      }
   20.20                  }
   20.21              }
    21.1 --- a/src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java	Mon Feb 18 10:36:18 2013 +0100
    21.2 +++ b/src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java	Mon Feb 18 16:00:15 2013 +0100
    21.3 @@ -92,7 +92,6 @@
    21.4  import jdk.internal.dynalink.linker.LinkerServices;
    21.5  import jdk.internal.dynalink.support.TypeUtilities;
    21.6  
    21.7 -
    21.8  /**
    21.9   * Represents an overloaded method.
   21.10   *
   21.11 @@ -204,14 +203,16 @@
   21.12                  final MethodHandle mh = invokables.iterator().next();
   21.13                  return new SimpleDynamicMethod(mh).getInvocation(callSiteType, linkerServices);
   21.14              }
   21.15 +            default: {
   21.16 +                // We have more than one candidate. We have no choice but to link to a method that resolves overloads on
   21.17 +                // every invocation (alternatively, we could opportunistically link the one method that resolves for the
   21.18 +                // current arguments, but we'd need to install a fairly complex guard for that and when it'd fail, we'd
   21.19 +                // go back all the way to candidate selection.
   21.20 +                // TODO: cache per call site type
   21.21 +                return new OverloadedMethod(invokables, this, callSiteType, linkerServices).getInvoker();
   21.22 +            }
   21.23          }
   21.24  
   21.25 -        // We have more than one candidate. We have no choice but to link to a method that resolves overloads on every
   21.26 -        // invocation (alternatively, we could opportunistically link the one method that resolves for the current
   21.27 -        // arguments, but we'd need to install a fairly complex guard for that and when it'd fail, we'd go back all the
   21.28 -        // way to candidate selection.
   21.29 -        // TODO: cache per call site type
   21.30 -        return new OverloadedMethod(invokables, this, callSiteType, linkerServices).getInvoker();
   21.31      }
   21.32  
   21.33      @Override
   21.34 @@ -248,6 +249,8 @@
   21.35          final boolean varArgs = m.isVarargsCollector();
   21.36          final int fixedArgLen = methodType.parameterCount() - (varArgs ? 1 : 0);
   21.37          final int callSiteArgLen = callSiteType.parameterCount();
   21.38 +
   21.39 +        // Arity checks
   21.40          if(varArgs) {
   21.41              if(callSiteArgLen < fixedArgLen) {
   21.42                  return false;
   21.43 @@ -255,32 +258,36 @@
   21.44          } else if(callSiteArgLen != fixedArgLen) {
   21.45              return false;
   21.46          }
   21.47 -        // Starting from 1, as receiver type doesn't participate
   21.48 +
   21.49 +        // Fixed arguments type checks, starting from 1, as receiver type doesn't participate
   21.50          for(int i = 1; i < fixedArgLen; ++i) {
   21.51              if(!isApplicableDynamically(linkerServices, callSiteType.parameterType(i), methodType.parameterType(i))) {
   21.52                  return false;
   21.53              }
   21.54          }
   21.55 -        if(varArgs) {
   21.56 -            final Class<?> varArgArrayType = methodType.parameterType(fixedArgLen);
   21.57 -            final Class<?> varArgType = varArgArrayType.getComponentType();
   21.58 -            if(fixedArgLen == callSiteArgLen - 1) {
   21.59 -                final Class<?> callSiteArgType = callSiteType.parameterType(fixedArgLen);
   21.60 -                // Exactly one vararg; check both exact matching and component
   21.61 -                // matching.
   21.62 -                return isApplicableDynamically(linkerServices, callSiteArgType, varArgArrayType)
   21.63 -                        || isApplicableDynamically(linkerServices, callSiteArgType, varArgType);
   21.64 -            } else {
   21.65 -                for(int i = fixedArgLen; i < callSiteArgLen; ++i) {
   21.66 -                    if(!isApplicableDynamically(linkerServices, callSiteType.parameterType(i), varArgType)) {
   21.67 -                        return false;
   21.68 -                    }
   21.69 -                }
   21.70 -                return true;
   21.71 -            }
   21.72 -        } else {
   21.73 +        if(!varArgs) {
   21.74 +            // Not vararg; both arity and types matched.
   21.75              return true;
   21.76          }
   21.77 +
   21.78 +        final Class<?> varArgArrayType = methodType.parameterType(fixedArgLen);
   21.79 +        final Class<?> varArgType = varArgArrayType.getComponentType();
   21.80 +
   21.81 +        if(fixedArgLen == callSiteArgLen - 1) {
   21.82 +            // Exactly one vararg; check both array type matching and array component type matching.
   21.83 +            final Class<?> callSiteArgType = callSiteType.parameterType(fixedArgLen);
   21.84 +            return isApplicableDynamically(linkerServices, callSiteArgType, varArgArrayType)
   21.85 +                    || isApplicableDynamically(linkerServices, callSiteArgType, varArgType);
   21.86 +        }
   21.87 +
   21.88 +        // Either zero, or more than one vararg; check if all actual vararg types match the vararg array component type.
   21.89 +        for(int i = fixedArgLen; i < callSiteArgLen; ++i) {
   21.90 +            if(!isApplicableDynamically(linkerServices, callSiteType.parameterType(i), varArgType)) {
   21.91 +                return false;
   21.92 +            }
   21.93 +        }
   21.94 +
   21.95 +        return true;
   21.96      }
   21.97  
   21.98      private static boolean isApplicableDynamically(LinkerServices linkerServices, Class<?> callSiteType,
   21.99 @@ -298,7 +305,7 @@
  21.100       *
  21.101       * @param method the method to add.
  21.102       */
  21.103 -    public void addMethod(SimpleDynamicMethod method) {
  21.104 +    void addMethod(SimpleDynamicMethod method) {
  21.105          addMethod(method.getTarget());
  21.106      }
  21.107  
  21.108 @@ -310,4 +317,4 @@
  21.109      public void addMethod(MethodHandle method) {
  21.110          methods.add(method);
  21.111      }
  21.112 -}
  21.113 \ No newline at end of file
  21.114 +}
    22.1 --- a/src/jdk/internal/dynalink/beans/OverloadedMethod.java	Mon Feb 18 10:36:18 2013 +0100
    22.2 +++ b/src/jdk/internal/dynalink/beans/OverloadedMethod.java	Mon Feb 18 16:00:15 2013 +0100
    22.3 @@ -94,7 +94,6 @@
    22.4  import jdk.internal.dynalink.linker.LinkerServices;
    22.5  import jdk.internal.dynalink.support.Lookup;
    22.6  
    22.7 -
    22.8  /**
    22.9   * Represents a subset of overloaded methods for a certain method name on a certain class. It can be either a fixarg or
   22.10   * a vararg subset depending on the subclass. The method is for a fixed number of arguments though (as it is generated
   22.11 @@ -263,4 +262,4 @@
   22.12              b.append(classes[l - 1].getComponentType().getCanonicalName()).append("...");
   22.13          }
   22.14      }
   22.15 -}
   22.16 \ No newline at end of file
   22.17 +}
    23.1 --- a/src/jdk/internal/dynalink/beans/SimpleDynamicMethod.java	Mon Feb 18 10:36:18 2013 +0100
    23.2 +++ b/src/jdk/internal/dynalink/beans/SimpleDynamicMethod.java	Mon Feb 18 16:00:15 2013 +0100
    23.3 @@ -90,7 +90,6 @@
    23.4  import jdk.internal.dynalink.linker.LinkerServices;
    23.5  import jdk.internal.dynalink.support.Guards;
    23.6  
    23.7 -
    23.8  /**
    23.9   * A dynamic method bound to exactly one, non-overloaded Java method. Handles varargs.
   23.10   *
   23.11 @@ -164,14 +163,13 @@
   23.12              // Less actual arguments than number of fixed declared arguments; can't invoke.
   23.13              return null;
   23.14          }
   23.15 -        // Method handle of the same number of arguments as the call site type
   23.16 +        // Method handle has the same number of fixed arguments as the call site type
   23.17          if(argsLen == fixParamsLen) {
   23.18              // Method handle that matches the number of actual arguments as the number of fixed arguments
   23.19              final MethodHandle matchedMethod;
   23.20              if(varArgs) {
   23.21                  // If vararg, add a zero-length array of the expected type as the last argument to signify no variable
   23.22                  // arguments.
   23.23 -                // TODO: check whether collectArguments() would handle this too.
   23.24                  matchedMethod = MethodHandles.insertArguments(fixTarget, fixParamsLen, Array.newInstance(
   23.25                          methodType.parameterType(fixParamsLen).getComponentType(), 0));
   23.26              } else {
   23.27 @@ -195,22 +193,22 @@
   23.28                  // Call site signature guarantees we'll always be passed a single compatible array; just link directly
   23.29                  // to the method.
   23.30                  return createConvertingInvocation(fixTarget, linkerServices, callSiteType);
   23.31 -            } else if(!linkerServices.canConvert(callSiteLastArgType, varArgType)) {
   23.32 +            }
   23.33 +            if(!linkerServices.canConvert(callSiteLastArgType, varArgType)) {
   23.34                  // Call site signature guarantees the argument can definitely not be an array (i.e. it is primitive);
   23.35                  // link immediately to a vararg-packing method handle.
   23.36                  return createConvertingInvocation(collectArguments(fixTarget, argsLen), linkerServices, callSiteType);
   23.37 -            } else {
   23.38 -                // Call site signature makes no guarantees that the single argument in the vararg position will be
   23.39 -                // compatible across all invocations. Need to insert an appropriate guard and fall back to generic
   23.40 -                // vararg method when it is not.
   23.41 -                return MethodHandles.guardWithTest(Guards.isInstance(varArgType, fixParamsLen, callSiteType),
   23.42 -                        createConvertingInvocation(fixTarget, linkerServices, callSiteType),
   23.43 -                        createConvertingInvocation(collectArguments(fixTarget, argsLen), linkerServices, callSiteType));
   23.44              }
   23.45 -        } else {
   23.46 -            // Remaining case: more than one vararg.
   23.47 -            return createConvertingInvocation(collectArguments(fixTarget, argsLen), linkerServices, callSiteType);
   23.48 +            // Call site signature makes no guarantees that the single argument in the vararg position will be
   23.49 +            // compatible across all invocations. Need to insert an appropriate guard and fall back to generic vararg
   23.50 +            // method when it is not.
   23.51 +            return MethodHandles.guardWithTest(Guards.isInstance(varArgType, fixParamsLen, callSiteType),
   23.52 +                    createConvertingInvocation(fixTarget, linkerServices, callSiteType),
   23.53 +                    createConvertingInvocation(collectArguments(fixTarget, argsLen), linkerServices, callSiteType));
   23.54          }
   23.55 +
   23.56 +        // Remaining case: more than one vararg.
   23.57 +        return createConvertingInvocation(collectArguments(fixTarget, argsLen), linkerServices, callSiteType);
   23.58      }
   23.59  
   23.60      @Override
   23.61 @@ -238,4 +236,4 @@
   23.62              final LinkerServices linkerServices, final MethodType callSiteType) {
   23.63          return linkerServices.asType(sizedMethod, callSiteType);
   23.64      }
   23.65 -}
   23.66 \ No newline at end of file
   23.67 +}
    24.1 --- a/src/jdk/internal/dynalink/beans/StaticClass.java	Mon Feb 18 10:36:18 2013 +0100
    24.2 +++ b/src/jdk/internal/dynalink/beans/StaticClass.java	Mon Feb 18 16:00:15 2013 +0100
    24.3 @@ -135,4 +135,4 @@
    24.4      private Object readResolve() {
    24.5          return forClass(clazz);
    24.6      }
    24.7 -}
    24.8 \ No newline at end of file
    24.9 +}
    25.1 --- a/src/jdk/internal/dynalink/beans/StaticClassLinker.java	Mon Feb 18 10:36:18 2013 +0100
    25.2 +++ b/src/jdk/internal/dynalink/beans/StaticClassLinker.java	Mon Feb 18 16:00:15 2013 +0100
    25.3 @@ -99,7 +99,6 @@
    25.4  import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
    25.5  import jdk.internal.dynalink.support.Lookup;
    25.6  
    25.7 -
    25.8  /**
    25.9   * Provides a linker for the {@link StaticClass} objects.
   25.10   * @author Attila Szegedi
   25.11 @@ -201,4 +200,4 @@
   25.12      private static boolean isClass(Class<?> clazz, Object obj) {
   25.13          return obj instanceof StaticClass && ((StaticClass)obj).getRepresentedClass() == clazz;
   25.14      }
   25.15 -}
   25.16 \ No newline at end of file
   25.17 +}
    26.1 --- a/src/jdk/internal/dynalink/linker/GuardedInvocation.java	Mon Feb 18 10:36:18 2013 +0100
    26.2 +++ b/src/jdk/internal/dynalink/linker/GuardedInvocation.java	Mon Feb 18 16:00:15 2013 +0100
    26.3 @@ -92,7 +92,6 @@
    26.4  import jdk.internal.dynalink.CallSiteDescriptor;
    26.5  import jdk.internal.dynalink.support.Guards;
    26.6  
    26.7 -
    26.8  /**
    26.9   * Represents a conditionally valid method handle. It is an immutable triple of an invocation method handle, a guard
   26.10   * method handle that defines the applicability of the invocation handle, and a switch point that can be used for
   26.11 @@ -312,4 +311,4 @@
   26.12              throw new WrongMethodTypeException("Expected type: " + type + " actual type: " + mh.type());
   26.13          }
   26.14      }
   26.15 -}
   26.16 \ No newline at end of file
   26.17 +}
    27.1 --- a/src/jdk/internal/dynalink/linker/GuardingDynamicLinker.java	Mon Feb 18 10:36:18 2013 +0100
    27.2 +++ b/src/jdk/internal/dynalink/linker/GuardingDynamicLinker.java	Mon Feb 18 16:00:15 2013 +0100
    27.3 @@ -109,4 +109,4 @@
    27.4       */
    27.5      public GuardedInvocation getGuardedInvocation(LinkRequest linkRequest, LinkerServices linkerServices)
    27.6              throws Exception;
    27.7 -}
    27.8 \ No newline at end of file
    27.9 +}
    28.1 --- a/src/jdk/internal/dynalink/linker/GuardingTypeConverterFactory.java	Mon Feb 18 10:36:18 2013 +0100
    28.2 +++ b/src/jdk/internal/dynalink/linker/GuardingTypeConverterFactory.java	Mon Feb 18 16:00:15 2013 +0100
    28.3 @@ -111,4 +111,4 @@
    28.4       * @throws Exception if there was an error during creation of the converter
    28.5       */
    28.6      public GuardedInvocation convertToType(Class<?> sourceType, Class<?> targetType) throws Exception;
    28.7 -}
    28.8 \ No newline at end of file
    28.9 +}
    29.1 --- a/src/jdk/internal/dynalink/linker/LinkRequest.java	Mon Feb 18 10:36:18 2013 +0100
    29.2 +++ b/src/jdk/internal/dynalink/linker/LinkRequest.java	Mon Feb 18 16:00:15 2013 +0100
    29.3 @@ -146,4 +146,4 @@
    29.4       * specified ones.
    29.5       */
    29.6      public LinkRequest replaceArguments(CallSiteDescriptor callSiteDescriptor, Object[] arguments);
    29.7 -}
    29.8 \ No newline at end of file
    29.9 +}
    30.1 --- a/src/jdk/internal/dynalink/linker/LinkerServices.java	Mon Feb 18 10:36:18 2013 +0100
    30.2 +++ b/src/jdk/internal/dynalink/linker/LinkerServices.java	Mon Feb 18 16:00:15 2013 +0100
    30.3 @@ -89,7 +89,6 @@
    30.4  import jdk.internal.dynalink.DynamicLinker;
    30.5  import jdk.internal.dynalink.linker.ConversionComparator.Comparison;
    30.6  
    30.7 -
    30.8  /**
    30.9   * Interface for services provided to {@link GuardingDynamicLinker} instances by the {@link DynamicLinker} that owns
   30.10   * them. You can think of it as the interface of the {@link DynamicLinker} that faces the {@link GuardingDynamicLinker}
   30.11 @@ -162,4 +161,4 @@
   30.12       * conversion.
   30.13       */
   30.14      public Comparison compareConversion(Class<?> sourceType, Class<?> targetType1, Class<?> targetType2);
   30.15 -}
   30.16 \ No newline at end of file
   30.17 +}
    31.1 --- a/src/jdk/internal/dynalink/support/AbstractCallSiteDescriptor.java	Mon Feb 18 10:36:18 2013 +0100
    31.2 +++ b/src/jdk/internal/dynalink/support/AbstractCallSiteDescriptor.java	Mon Feb 18 16:00:15 2013 +0100
    31.3 @@ -88,7 +88,6 @@
    31.4  import java.util.Objects;
    31.5  import jdk.internal.dynalink.CallSiteDescriptor;
    31.6  
    31.7 -
    31.8  /**
    31.9   * A base class for call site descriptor implementations. Provides reconstruction of the name from the tokens, as well
   31.10   * as a generally useful {@code equals} and {@code hashCode} methods.
    32.1 --- a/src/jdk/internal/dynalink/support/AbstractRelinkableCallSite.java	Mon Feb 18 10:36:18 2013 +0100
    32.2 +++ b/src/jdk/internal/dynalink/support/AbstractRelinkableCallSite.java	Mon Feb 18 16:00:15 2013 +0100
    32.3 @@ -88,7 +88,6 @@
    32.4  import jdk.internal.dynalink.CallSiteDescriptor;
    32.5  import jdk.internal.dynalink.RelinkableCallSite;
    32.6  
    32.7 -
    32.8  /**
    32.9   * A basic implementation of the {@link RelinkableCallSite} as a {@link MutableCallSite} subclass.
   32.10   *
   32.11 @@ -115,4 +114,4 @@
   32.12      public void initialize(MethodHandle relinkAndInvoke) {
   32.13          setTarget(relinkAndInvoke);
   32.14      }
   32.15 -}
   32.16 \ No newline at end of file
   32.17 +}
    33.1 --- a/src/jdk/internal/dynalink/support/AutoDiscovery.java	Mon Feb 18 10:36:18 2013 +0100
    33.2 +++ b/src/jdk/internal/dynalink/support/AutoDiscovery.java	Mon Feb 18 16:00:15 2013 +0100
    33.3 @@ -89,7 +89,6 @@
    33.4  import jdk.internal.dynalink.DynamicLinkerFactory;
    33.5  import jdk.internal.dynalink.linker.GuardingDynamicLinker;
    33.6  
    33.7 -
    33.8  /**
    33.9   * Provides methods for automatic discovery of all guarding dynamic linkers listed in the
   33.10   * <tt>/META-INF/services/jdk.internal.dynalink.linker.GuardingDynamicLinker</tt> resources of all JAR files for a
   33.11 @@ -131,4 +130,4 @@
   33.12          }
   33.13          return list;
   33.14      }
   33.15 -}
   33.16 \ No newline at end of file
   33.17 +}
    34.1 --- a/src/jdk/internal/dynalink/support/BottomGuardingDynamicLinker.java	Mon Feb 18 10:36:18 2013 +0100
    34.2 +++ b/src/jdk/internal/dynalink/support/BottomGuardingDynamicLinker.java	Mon Feb 18 16:00:15 2013 +0100
    34.3 @@ -113,4 +113,4 @@
    34.4      public GuardedInvocation getGuardedInvocation(LinkRequest linkRequest, LinkerServices linkerServices) {
    34.5          return null;
    34.6      }
    34.7 -}
    34.8 \ No newline at end of file
    34.9 +}
    35.1 --- a/src/jdk/internal/dynalink/support/CallSiteDescriptorFactory.java	Mon Feb 18 10:36:18 2013 +0100
    35.2 +++ b/src/jdk/internal/dynalink/support/CallSiteDescriptorFactory.java	Mon Feb 18 16:00:15 2013 +0100
    35.3 @@ -94,7 +94,6 @@
    35.4  import java.util.WeakHashMap;
    35.5  import jdk.internal.dynalink.CallSiteDescriptor;
    35.6  
    35.7 -
    35.8  /**
    35.9   * Usable as a default factory for call site descriptor implementations. It is weakly canonicalizing, meaning it will
   35.10   * return the same immutable call site descriptor for identical inputs, i.e. repeated requests for a descriptor
   35.11 @@ -129,9 +128,8 @@
   35.12          final String[] tokenizedName = tokenizeName(name);
   35.13          if(isPublicLookup(lookup)) {
   35.14              return getCanonicalPublicDescriptor(createPublicCallSiteDescriptor(tokenizedName, methodType));
   35.15 -        } else {
   35.16 -            return new LookupCallSiteDescriptor(tokenizedName, methodType, lookup);
   35.17          }
   35.18 +        return new LookupCallSiteDescriptor(tokenizedName, methodType, lookup);
   35.19      }
   35.20  
   35.21      static CallSiteDescriptor getCanonicalPublicDescriptor(final CallSiteDescriptor desc) {
   35.22 @@ -262,4 +260,4 @@
   35.23      public static CallSiteDescriptor insertParameterTypes(CallSiteDescriptor desc, int num, List<Class<?>> ptypesToInsert) {
   35.24          return desc.changeMethodType(desc.getMethodType().insertParameterTypes(num, ptypesToInsert));
   35.25      }
   35.26 -}
   35.27 \ No newline at end of file
   35.28 +}
    36.1 --- a/src/jdk/internal/dynalink/support/CompositeGuardingDynamicLinker.java	Mon Feb 18 10:36:18 2013 +0100
    36.2 +++ b/src/jdk/internal/dynalink/support/CompositeGuardingDynamicLinker.java	Mon Feb 18 16:00:15 2013 +0100
    36.3 @@ -91,7 +91,6 @@
    36.4  import jdk.internal.dynalink.linker.LinkRequest;
    36.5  import jdk.internal.dynalink.linker.LinkerServices;
    36.6  
    36.7 -
    36.8  /**
    36.9   * A {@link GuardingDynamicLinker} that delegates sequentially to a list of other guarding dynamic linkers. The first
   36.10   * value returned from a component linker other than null is returned. If no component linker returns an invocation,
   36.11 @@ -129,4 +128,4 @@
   36.12          }
   36.13          return null;
   36.14      }
   36.15 -}
   36.16 \ No newline at end of file
   36.17 +}
    37.1 --- a/src/jdk/internal/dynalink/support/CompositeTypeBasedGuardingDynamicLinker.java	Mon Feb 18 10:36:18 2013 +0100
    37.2 +++ b/src/jdk/internal/dynalink/support/CompositeTypeBasedGuardingDynamicLinker.java	Mon Feb 18 16:00:15 2013 +0100
    37.3 @@ -93,7 +93,6 @@
    37.4  import jdk.internal.dynalink.linker.LinkerServices;
    37.5  import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
    37.6  
    37.7 -
    37.8  /**
    37.9   * A composite type-based guarding dynamic linker. When a receiver of a not yet seen class is encountered, all linkers
   37.10   * are queried sequentially on their {@link TypeBasedGuardingDynamicLinker#canLinkType(Class)} method. The linkers
   37.11 @@ -223,4 +222,4 @@
   37.12              }
   37.13          }
   37.14      }
   37.15 -}
   37.16 \ No newline at end of file
   37.17 +}
    38.1 --- a/src/jdk/internal/dynalink/support/DefaultCallSiteDescriptor.java	Mon Feb 18 10:36:18 2013 +0100
    38.2 +++ b/src/jdk/internal/dynalink/support/DefaultCallSiteDescriptor.java	Mon Feb 18 16:00:15 2013 +0100
    38.3 @@ -87,7 +87,6 @@
    38.4  import java.lang.invoke.MethodType;
    38.5  import jdk.internal.dynalink.CallSiteDescriptor;
    38.6  
    38.7 -
    38.8  /**
    38.9   * A default, fairly light implementation of a call site descriptor used for describing non-standard operations. It does
   38.10   * not store {@link Lookup} objects but always returns the public lookup from its {@link #getLookup()} method. If you
    39.1 --- a/src/jdk/internal/dynalink/support/Guards.java	Mon Feb 18 10:36:18 2013 +0100
    39.2 +++ b/src/jdk/internal/dynalink/support/Guards.java	Mon Feb 18 16:00:15 2013 +0100
    39.3 @@ -90,7 +90,6 @@
    39.4  import java.util.logging.Logger;
    39.5  import jdk.internal.dynalink.linker.LinkerServices;
    39.6  
    39.7 -
    39.8  /**
    39.9   * Utility methods for creating typical guards. TODO: introduce reasonable caching of created guards.
   39.10   *
   39.11 @@ -357,4 +356,4 @@
   39.12          return MethodHandles.permuteArguments(MethodHandles.constant(Boolean.TYPE, value),
   39.13                  type.changeReturnType(Boolean.TYPE));
   39.14      }
   39.15 -}
   39.16 \ No newline at end of file
   39.17 +}
    40.1 --- a/src/jdk/internal/dynalink/support/LinkRequestImpl.java	Mon Feb 18 10:36:18 2013 +0100
    40.2 +++ b/src/jdk/internal/dynalink/support/LinkRequestImpl.java	Mon Feb 18 16:00:15 2013 +0100
    40.3 @@ -140,4 +140,4 @@
    40.4      public LinkRequest replaceArguments(CallSiteDescriptor newCallSiteDescriptor, Object[] newArguments) {
    40.5          return new LinkRequestImpl(newCallSiteDescriptor, callSiteUnstable, newArguments);
    40.6      }
    40.7 -}
    40.8 \ No newline at end of file
    40.9 +}
    41.1 --- a/src/jdk/internal/dynalink/support/LinkerServicesImpl.java	Mon Feb 18 10:36:18 2013 +0100
    41.2 +++ b/src/jdk/internal/dynalink/support/LinkerServicesImpl.java	Mon Feb 18 16:00:15 2013 +0100
    41.3 @@ -91,7 +91,6 @@
    41.4  import jdk.internal.dynalink.linker.LinkRequest;
    41.5  import jdk.internal.dynalink.linker.LinkerServices;
    41.6  
    41.7 -
    41.8  /**
    41.9   * Default implementation of the {@link LinkerServices} interface.
   41.10   *
   41.11 @@ -138,4 +137,4 @@
   41.12      public GuardedInvocation getGuardedInvocation(LinkRequest linkRequest) throws Exception {
   41.13          return topLevelLinker.getGuardedInvocation(linkRequest, this);
   41.14      }
   41.15 -}
   41.16 \ No newline at end of file
   41.17 +}
    42.1 --- a/src/jdk/internal/dynalink/support/Lookup.java	Mon Feb 18 10:36:18 2013 +0100
    42.2 +++ b/src/jdk/internal/dynalink/support/Lookup.java	Mon Feb 18 16:00:15 2013 +0100
    42.3 @@ -231,9 +231,8 @@
    42.4                      m.setAccessible(true);
    42.5                  }
    42.6                  return unreflect(m);
    42.7 -            } else {
    42.8 -                return lookup.findSpecial(declaringClass, name, type, declaringClass);
    42.9              }
   42.10 +            return lookup.findSpecial(declaringClass, name, type, declaringClass);
   42.11          } catch(IllegalAccessException e) {
   42.12              final IllegalAccessError ee = new IllegalAccessError("Failed to access special method " + methodDescription(
   42.13                      declaringClass, name, type));
    43.1 --- a/src/jdk/internal/dynalink/support/LookupCallSiteDescriptor.java	Mon Feb 18 10:36:18 2013 +0100
    43.2 +++ b/src/jdk/internal/dynalink/support/LookupCallSiteDescriptor.java	Mon Feb 18 16:00:15 2013 +0100
    43.3 @@ -87,7 +87,6 @@
    43.4  import java.lang.invoke.MethodType;
    43.5  import jdk.internal.dynalink.CallSiteDescriptor;
    43.6  
    43.7 -
    43.8  /**
    43.9   * A call site descriptor that stores a specific {@link Lookup}. It does not, however, store static bootstrap arguments.
   43.10   * @author Attila Szegedi
    44.1 --- a/src/jdk/internal/dynalink/support/NamedDynCallSiteDescriptor.java	Mon Feb 18 10:36:18 2013 +0100
    44.2 +++ b/src/jdk/internal/dynalink/support/NamedDynCallSiteDescriptor.java	Mon Feb 18 16:00:15 2013 +0100
    44.3 @@ -86,7 +86,6 @@
    44.4  import java.lang.invoke.MethodType;
    44.5  import jdk.internal.dynalink.CallSiteDescriptor;
    44.6  
    44.7 -
    44.8  class NamedDynCallSiteDescriptor extends UnnamedDynCallSiteDescriptor {
    44.9      private final String name;
   44.10  
    45.1 --- a/src/jdk/internal/dynalink/support/RuntimeContextLinkRequestImpl.java	Mon Feb 18 10:36:18 2013 +0100
    45.2 +++ b/src/jdk/internal/dynalink/support/RuntimeContextLinkRequestImpl.java	Mon Feb 18 16:00:15 2013 +0100
    45.3 @@ -139,4 +139,4 @@
    45.4          System.arraycopy(args, runtimeContextArgCount + 1, newargs, 1, newargs.length - 1);
    45.5          return newargs;
    45.6      }
    45.7 -}
    45.8 \ No newline at end of file
    45.9 +}
    46.1 --- a/src/jdk/internal/dynalink/support/TypeConverterFactory.java	Mon Feb 18 10:36:18 2013 +0100
    46.2 +++ b/src/jdk/internal/dynalink/support/TypeConverterFactory.java	Mon Feb 18 16:00:15 2013 +0100
    46.3 @@ -95,7 +95,6 @@
    46.4  import jdk.internal.dynalink.linker.GuardingTypeConverterFactory;
    46.5  import jdk.internal.dynalink.linker.LinkerServices;
    46.6  
    46.7 -
    46.8  /**
    46.9   * A factory for type converters. This class is the main implementation behind the
   46.10   * {@link LinkerServices#asType(MethodHandle, MethodType)}. It manages the known {@link GuardingTypeConverterFactory}
   46.11 @@ -317,4 +316,4 @@
   46.12      }
   46.13  
   46.14      /*private*/ static final MethodHandle IDENTITY_CONVERSION = MethodHandles.identity(Object.class);
   46.15 -}
   46.16 \ No newline at end of file
   46.17 +}
    47.1 --- a/src/jdk/internal/dynalink/support/TypeUtilities.java	Mon Feb 18 10:36:18 2013 +0100
    47.2 +++ b/src/jdk/internal/dynalink/support/TypeUtilities.java	Mon Feb 18 16:00:15 2013 +0100
    47.3 @@ -439,4 +439,4 @@
    47.4      public static Class<?> getWrapperType(Class<?> primitiveType) {
    47.5          return WRAPPER_TYPES.get(primitiveType);
    47.6      }
    47.7 -}
    47.8 \ No newline at end of file
    47.9 +}
    48.1 --- a/src/jdk/internal/dynalink/support/UnnamedDynCallSiteDescriptor.java	Mon Feb 18 10:36:18 2013 +0100
    48.2 +++ b/src/jdk/internal/dynalink/support/UnnamedDynCallSiteDescriptor.java	Mon Feb 18 16:00:15 2013 +0100
    48.3 @@ -86,7 +86,6 @@
    48.4  import java.lang.invoke.MethodType;
    48.5  import jdk.internal.dynalink.CallSiteDescriptor;
    48.6  
    48.7 -
    48.8  class UnnamedDynCallSiteDescriptor extends AbstractCallSiteDescriptor {
    48.9      private final MethodType methodType;
   48.10      private final String op;
    49.1 --- a/src/jdk/nashorn/internal/codegen/CompilationPhase.java	Mon Feb 18 10:36:18 2013 +0100
    49.2 +++ b/src/jdk/nashorn/internal/codegen/CompilationPhase.java	Mon Feb 18 16:00:15 2013 +0100
    49.3 @@ -7,6 +7,7 @@
    49.4  import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.INITIALIZED;
    49.5  import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.LOWERED;
    49.6  import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.SPLIT;
    49.7 +
    49.8  import java.io.File;
    49.9  import java.io.FileOutputStream;
   49.10  import java.io.IOException;
   49.11 @@ -15,9 +16,9 @@
   49.12  import jdk.nashorn.internal.ir.FunctionNode;
   49.13  import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
   49.14  import jdk.nashorn.internal.ir.Node;
   49.15 -import jdk.nashorn.internal.ir.visitor.NodeVisitor;
   49.16  import jdk.nashorn.internal.ir.debug.ASTWriter;
   49.17  import jdk.nashorn.internal.ir.debug.PrintVisitor;
   49.18 +import jdk.nashorn.internal.ir.visitor.NodeVisitor;
   49.19  import jdk.nashorn.internal.runtime.Context;
   49.20  import jdk.nashorn.internal.runtime.ECMAErrors;
   49.21  
    50.1 --- a/src/jdk/nashorn/internal/codegen/FunctionSignature.java	Mon Feb 18 10:36:18 2013 +0100
    50.2 +++ b/src/jdk/nashorn/internal/codegen/FunctionSignature.java	Mon Feb 18 16:00:15 2013 +0100
    50.3 @@ -25,6 +25,8 @@
    50.4  
    50.5  package jdk.nashorn.internal.codegen;
    50.6  
    50.7 +import static jdk.nashorn.internal.runtime.linker.Lookup.MH;
    50.8 +
    50.9  import java.lang.invoke.MethodType;
   50.10  import java.util.ArrayList;
   50.11  import java.util.List;
   50.12 @@ -34,8 +36,6 @@
   50.13  import jdk.nashorn.internal.runtime.ScriptFunction;
   50.14  import jdk.nashorn.internal.runtime.linker.LinkerCallSite;
   50.15  
   50.16 -import static jdk.nashorn.internal.runtime.linker.Lookup.MH;
   50.17 -
   50.18  /**
   50.19   * Class that generates function signatures for dynamic calls
   50.20   */
    51.1 --- a/src/jdk/nashorn/internal/ir/FunctionNode.java	Mon Feb 18 10:36:18 2013 +0100
    51.2 +++ b/src/jdk/nashorn/internal/ir/FunctionNode.java	Mon Feb 18 16:00:15 2013 +0100
    51.3 @@ -36,7 +36,6 @@
    51.4  import java.util.LinkedList;
    51.5  import java.util.List;
    51.6  import java.util.Stack;
    51.7 -
    51.8  import jdk.nashorn.internal.codegen.CompileUnit;
    51.9  import jdk.nashorn.internal.codegen.Compiler;
   51.10  import jdk.nashorn.internal.codegen.Frame;
    52.1 --- a/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java	Mon Feb 18 10:36:18 2013 +0100
    52.2 +++ b/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java	Mon Feb 18 16:00:15 2013 +0100
    52.3 @@ -28,7 +28,6 @@
    52.4  import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
    52.5  
    52.6  import java.lang.invoke.MethodHandle;
    52.7 -
    52.8  import jdk.nashorn.internal.runtime.GlobalFunctions;
    52.9  import jdk.nashorn.internal.runtime.Property;
   52.10  import jdk.nashorn.internal.runtime.PropertyMap;
    53.1 --- a/src/jdk/nashorn/internal/objects/ScriptFunctionTrampolineImpl.java	Mon Feb 18 10:36:18 2013 +0100
    53.2 +++ b/src/jdk/nashorn/internal/objects/ScriptFunctionTrampolineImpl.java	Mon Feb 18 16:00:15 2013 +0100
    53.3 @@ -1,12 +1,10 @@
    53.4  package jdk.nashorn.internal.objects;
    53.5  
    53.6 +import static jdk.nashorn.internal.runtime.linker.Lookup.MH;
    53.7 +
    53.8  import java.lang.invoke.MethodHandle;
    53.9  import java.lang.invoke.MethodHandles;
   53.10  import java.lang.invoke.MethodType;
   53.11 -
   53.12 -
   53.13 -import static jdk.nashorn.internal.runtime.linker.Lookup.MH;
   53.14 -
   53.15  import jdk.nashorn.internal.codegen.Compiler;
   53.16  import jdk.nashorn.internal.codegen.FunctionSignature;
   53.17  import jdk.nashorn.internal.codegen.types.Type;
    54.1 --- a/src/jdk/nashorn/internal/parser/Parser.java	Mon Feb 18 10:36:18 2013 +0100
    54.2 +++ b/src/jdk/nashorn/internal/parser/Parser.java	Mon Feb 18 16:00:15 2013 +0100
    54.3 @@ -59,7 +59,6 @@
    54.4  import java.util.List;
    54.5  import java.util.Map;
    54.6  import java.util.Stack;
    54.7 -
    54.8  import jdk.nashorn.internal.codegen.CompilerConstants;
    54.9  import jdk.nashorn.internal.codegen.Namespace;
   54.10  import jdk.nashorn.internal.ir.AccessNode;
   54.11 @@ -101,8 +100,8 @@
   54.12  import jdk.nashorn.internal.runtime.ErrorManager;
   54.13  import jdk.nashorn.internal.runtime.JSErrorType;
   54.14  import jdk.nashorn.internal.runtime.ParserException;
   54.15 +import jdk.nashorn.internal.runtime.ScriptingFunctions;
   54.16  import jdk.nashorn.internal.runtime.Source;
   54.17 -import jdk.nashorn.internal.runtime.ScriptingFunctions;
   54.18  
   54.19  /**
   54.20   * Builds the IR.
    55.1 --- a/src/jdk/nashorn/internal/runtime/Context.java	Mon Feb 18 10:36:18 2013 +0100
    55.2 +++ b/src/jdk/nashorn/internal/runtime/Context.java	Mon Feb 18 16:00:15 2013 +0100
    55.3 @@ -45,7 +45,6 @@
    55.4  import java.security.PrivilegedAction;
    55.5  import java.util.Locale;
    55.6  import java.util.TimeZone;
    55.7 -
    55.8  import jdk.internal.org.objectweb.asm.ClassReader;
    55.9  import jdk.internal.org.objectweb.asm.util.CheckClassAdapter;
   55.10  import jdk.nashorn.internal.codegen.ClassEmitter;

mercurial