# HG changeset patch # User sundar # Date 1452183441 -19800 # Node ID bba3b9d1c9ea3c0e6b98a38fd89bec7b232d06a7 # Parent 96c0c150eb216aa225c159a6738030663a2acd2e 8146625: OverloadedDynamicMethod has unused ClassLoader field that can be removed Reviewed-by: attila, hannesw diff -r 96c0c150eb21 -r bba3b9d1c9ea nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedDynamicMethod.java --- a/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedDynamicMethod.java Wed Jan 06 20:19:02 2016 +0530 +++ b/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedDynamicMethod.java Thu Jan 07 21:47:21 2016 +0530 @@ -112,8 +112,7 @@ /** * Holds a list of all methods. */ - private final LinkedList methods; - private final ClassLoader classLoader; + private final LinkedList methods = new LinkedList<>(); /** * Creates a new overloaded dynamic method. @@ -122,13 +121,7 @@ * @param name the name of the method */ OverloadedDynamicMethod(final Class clazz, final String name) { - this(new LinkedList(), clazz.getClassLoader(), getClassAndMethodName(clazz, name)); - } - - private OverloadedDynamicMethod(final LinkedList methods, final ClassLoader classLoader, final String name) { - super(name); - this.methods = methods; - this.classLoader = classLoader; + super(getClassAndMethodName(clazz, name)); } @Override @@ -288,10 +281,6 @@ return b.toString(); }; - ClassLoader getClassLoader() { - return classLoader; - } - private static boolean isApplicableDynamically(final LinkerServices linkerServices, final MethodType callSiteType, final SingleDynamicMethod m) { final MethodType methodType = m.getMethodType();