changeset 1588:9f96a4b227f3

8146625: OverloadedDynamicMethod has unused ClassLoader field that can be removed Reviewed-by: attila, hannesw
author sundar
date Thu, 07 Jan 2016 21:47:21 +0530
parents f618bede1afe
children 33e33bbc3bdb
files src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedDynamicMethod.java
diffstat 1 files changed, 2 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedDynamicMethod.java	Wed Jan 06 20:19:02 2016 +0530
+++ b/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<SingleDynamicMethod> methods;
-    private final ClassLoader classLoader;
+    private final LinkedList<SingleDynamicMethod> 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<SingleDynamicMethod>(), clazz.getClassLoader(), getClassAndMethodName(clazz, name));
-    }
-
-    private OverloadedDynamicMethod(final LinkedList<SingleDynamicMethod> 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();