-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
7u75
-
x86
-
windows_7
FULL PRODUCT VERSION :
java version '"1.7.0_25
ADDITIONAL OS VERSION INFORMATION :
windows 7
A DESCRIPTION OF THE PROBLEM :
When i try to load a class using bootstrap ClassLoader (see code below) i get some methods from a superclass, it only happens with methods that are overloaded by a subclass.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Method name: foo From class:
Aclass.Bclass with declared methods:
java.lang.Integer
Method name: bar From class:
Aclass.Bclass with declared methods:
java.lang.String
com.nedstat.reporting.consistency.parameters.reflection_test.Aclass.Bclass
com.nedstat.reporting.consistency.parameters.reflection_test.Aclass
ACTUAL -
Aclass.Bclass with declared methods:
Method name: foo From class:
Aclass.Bclass with declared methods:
java.lang.Integer
Method name: bar From class:
Aclass.Bclass with declared methods:
Method name: bar From class:
Aclass.Bclass with declared methods:
java.lang.String
com.nedstat.reporting.consistency.parameters.reflection_test.Aclass.Bclass
com.nedstat.reporting.consistency.parameters.reflection_test.Aclass
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
//step 1, create this class in a new file:
class Aclass
{
public void foo()
{
}
public void bar()
{
}
public class Bclass extends Aclass
{
public void foo(Integer one)
{
}
public void bar(String two)
{
}
}
}
//Put this in a new file (this includes the main method):
public class Tester
{
public static void main(String[] args)
{
try
{
Class<?> clazz = Tester.class.getClassLoader().loadClass("com.nedstat.reporting.consistency.parameters.reflection_test.Aclass$Bclass");
for (Method method : clazz.getDeclaredMethods())
{
System.out.println("Method name: " + method.getName() + " From class: " + method.getDeclaringClass().getCanonicalName() + " with declared methods:");// test
for (Class<?> param : method.getParameterTypes())
{
System.out.println(param.getCanonicalName());
}
}
System.out.println(clazz.getCanonicalName());
System.out.println(clazz.getSuperclass().getCanonicalName());
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
could not find any
java version '"1.7.0_25
ADDITIONAL OS VERSION INFORMATION :
windows 7
A DESCRIPTION OF THE PROBLEM :
When i try to load a class using bootstrap ClassLoader (see code below) i get some methods from a superclass, it only happens with methods that are overloaded by a subclass.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Method name: foo From class:
Aclass.Bclass with declared methods:
java.lang.Integer
Method name: bar From class:
Aclass.Bclass with declared methods:
java.lang.String
com.nedstat.reporting.consistency.parameters.reflection_test.Aclass.Bclass
com.nedstat.reporting.consistency.parameters.reflection_test.Aclass
ACTUAL -
Aclass.Bclass with declared methods:
Method name: foo From class:
Aclass.Bclass with declared methods:
java.lang.Integer
Method name: bar From class:
Aclass.Bclass with declared methods:
Method name: bar From class:
Aclass.Bclass with declared methods:
java.lang.String
com.nedstat.reporting.consistency.parameters.reflection_test.Aclass.Bclass
com.nedstat.reporting.consistency.parameters.reflection_test.Aclass
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
//step 1, create this class in a new file:
class Aclass
{
public void foo()
{
}
public void bar()
{
}
public class Bclass extends Aclass
{
public void foo(Integer one)
{
}
public void bar(String two)
{
}
}
}
//Put this in a new file (this includes the main method):
public class Tester
{
public static void main(String[] args)
{
try
{
Class<?> clazz = Tester.class.getClassLoader().loadClass("com.nedstat.reporting.consistency.parameters.reflection_test.Aclass$Bclass");
for (Method method : clazz.getDeclaredMethods())
{
System.out.println("Method name: " + method.getName() + " From class: " + method.getDeclaringClass().getCanonicalName() + " with declared methods:");// test
for (Class<?> param : method.getParameterTypes())
{
System.out.println(param.getCanonicalName());
}
}
System.out.println(clazz.getCanonicalName());
System.out.println(clazz.getSuperclass().getCanonicalName());
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
could not find any