8146625: OverloadedDynamicMethod has unused ClassLoader field that can be removed

Reviewed-by: attila, hannesw
This commit is contained in:
Athijegannathan Sundararajan 2016-01-07 21:47:21 +05:30
parent 3b28163296
commit 017a8a1f36

View File

@ -112,8 +112,7 @@ class OverloadedDynamicMethod extends DynamicMethod {
/**
* 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 @@ class OverloadedDynamicMethod extends DynamicMethod {
* @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 @@ class OverloadedDynamicMethod extends DynamicMethod {
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();