| Summary: | Hot code replacing an inner class crashes the JVM | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | j.hertsig |
| Component: | Debug | Assignee: | JDT-Debug-Inbox <jdt-debug-inbox> |
| Status: | RESOLVED NOT_ECLIPSE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | j.hertsig, Michael_Rennie |
| Version: | 3.7 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Using the latest 1.6 / 1.7 VMs this works as expected. Marking not_eclipse as it was likely a VM bug. |
Build Identifier: M20100909-0800 Adding or removing a String constant in a class that will be hot code replaced, causes the JVM to crash if getEnclosingClass() is called on that object's class. Reproducible: Always Steps to Reproduce: 1. Create this class: public class Test { private static final Object CONSTANT = new Object() { void unused() { System.out.println("123"); } }; public static void main(String[] args) { while(true) { System.out.println(CONSTANT.getClass().getEnclosingClass()); } } } 2. Run it in debug mode 3. (while it's running) add a statement that uses another String constant in the unused() method. A print works, but new String("234") works as well. 4. Save your modification. The class will be hot code replaced 5. The JVM crashes as soon as the getEnclosingClass() method is called on the replaced class. I have filed this bug with Oracle as well, since the JVM should not crash. However, it might be possible to work around the JVM bug in Eclipse.