Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P3
-
Resolution: Duplicate
-
Affects Version/s: 1.1
-
Fix Version/s: None
-
Component/s: core-libs
-
Labels:None
-
Subcomponent:
-
CPU:x86
-
OS:windows_95
Description
(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 - ###@###.###
======================================================================
Attachments
Issue Links
- duplicates
-
JDK-4073950 Execution of static intializer blocks is premature
-
- Closed
-