Community
Participate
Working Groups
Created attachment 199909 [details] error An example without twr - create a breakpoint on the indicated line - Debug as > Java application - when the breakpoint is hit, uncomment the indicated line - debugger jumps to beginning of foo() => GOOD ! ------------------------------------------------------------------------------- class Try { public static void main(String[] args) throws Throwable { foo(); } private static void foo() { System.out.println("1"); Test t = new Test(); //Test t1 = new Test(); // uncomment this line after breakpoint is hit try { String line = ""; // breakpoint on this line System.out.println(line); } finally { } } private static class Test { public Test() { System.out.println("constructor"); } } } ------------------------------------------------------------------------------ An example with twr - create a breakpoint on the indicated line - Debug as > Java application - when the breakpoint is hit, uncomment the indicated line - obsolete methods error (see screenshot) => BAD ! ------------------------------------------------------------------------------ class TryWithResources1 { public static void main(String[] args) throws Throwable { foo(); } private static void foo() throws IOException { System.out.println("1"); try (Test t = new Test();/*Test t1 = new Test();*/) { // uncomment declaration of t1 String line=""; // breakpoint on this line System.out.println(line); } catch (FileNotFoundException e) { e.printStackTrace(); } } private static class Test implements AutoCloseable { @Override public void close() throws IOException { System.out.println("closing"); throw new IOException(); } public Test() { System.out.println("constructor"); } } } ------------------------------------------------------------------------------
This works fine for me using Oracle 1.7 b147 and the latest IBM 1.7. Did you perhaps make an edit to a method declaration during your test?
(In reply to comment #1) > This works fine for me using Oracle 1.7 b147 and the latest IBM 1.7. > Also works fine using Oracle 1.7 update 1
Same here on Windows 7.
(In reply to comment #3) > Same here on Windows 7. Just to clarify: I can also not reproduce it.
closing worksforme
I also cannot reproduce it today. Sorry for the trouble.