-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.1
-
None
-
x86
-
windows_95
(See also Comments).
Name: mc57594 Date: 02/27/97
I've noticed that the static class initianalisers are being called when I do a 'Class.getDeclaredMethod'. It probably happens with all the other reflective Class methods as well. Is there no way of reflecting on a class without doing a <clinit>? This could prove really anoying!
Class c = Class.forName("Test");
c.getDeclaredMethod("someMethod", {});
System.out.println("Does it ever get here?");
class Test {
static {
while(true) {
System.out.println("Stop me if you can!!!");
}
}
}
Keep up the good work!
company - Obsolete , email - ###@###.###
======================================================================
Name: mc57594 Date: 02/27/97
I've noticed that the static class initianalisers are being called when I do a 'Class.getDeclaredMethod'. It probably happens with all the other reflective Class methods as well. Is there no way of reflecting on a class without doing a <clinit>? This could prove really anoying!
Class c = Class.forName("Test");
c.getDeclaredMethod("someMethod", {});
System.out.println("Does it ever get here?");
class Test {
static {
while(true) {
System.out.println("Stop me if you can!!!");
}
}
}
Keep up the good work!
company - Obsolete , email - ###@###.###
======================================================================
- duplicates
-
JDK-4073950 Execution of static intializer blocks is premature
-
- Closed
-