Community
Participate
Working Groups
BETA_JAVA7 class Test { FileInputStream fisField = null; public static void main(String[] args) { try (FileInputStream fis = fisField) { fis.available(); } catch (Exception e) { } } } Debug as>Java application. Step through the code and when the resource has been initialized, change "FileInputStream fis = fisField" to "FileInputStream fis = new FileInputStream("")" and save. Hot code replace fails -> Obsolete methods in the stack. Expected: Debugger should jump to start of main. This also happens if one edits the statements inside the try block. (Try commenting out fis.available()) I'm using IBM JRE 7
Closing as worksforme. This is a VM limitation of hot code replace, you cannot pop the main entry point off the stack and re-enter it. Any code you try to hot swap in the main method will fail - this limitation is not unique to 1.7.