Summary: | [compiler] inlineJSR may cause entering twice finally block | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Philipe Mulet <philippe_mulet> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.2 | ||
Target Milestone: | 3.2 M6 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Philipe Mulet
2006-02-24 04:29:35 EST
The problem arises from the nested try with no finally block. Exception handlers are not properly closed then. The range for NPE handler is far too long: // Method descriptor #6 ()V // Stack: 2, Locals: 7 public void save(); 0 aconst_null 1 astore_1 [warnings] 2 aconst_null 3 astore_2 [contexts] 4 getstatic System.out : PrintStream [15] 7 ldc <String "[try]"> [21] 9 invokevirtual PrintStream.print(String) : void [23] 12 getstatic System.out : PrintStream [15] 15 aload_1 [warnings] 16 invokevirtual PrintStream.print(Object) : void [29] 19 iconst_0 20 istore 5 [var] 22 getstatic System.out : PrintStream [15] 25 ldc <String "[finally]"> [32] 27 invokevirtual PrintStream.println(String) : void [34] 30 aconst_null 31 astore 6 [o] 33 aload 6 [o] 35 invokevirtual Object.toString() : String [37] 38 pop 39 return 40 astore_3 [npe] 41 getstatic System.out : PrintStream [15] 44 ldc <String "[npe]"> [41] 46 invokevirtual PrintStream.print(String) : void [23] 49 getstatic System.out : PrintStream [15] 52 aload_2 [contexts] 53 invokevirtual PrintStream.print(Object) : void [29] 56 iconst_0 57 istore 5 [var] 59 getstatic System.out : PrintStream [15] 62 ldc <String "[finally]"> [32] 64 invokevirtual PrintStream.println(String) : void [34] 67 aconst_null 68 astore 6 70 aload 6 72 invokevirtual Object.toString() : String [37] 75 pop 76 return 77 astore_1 [e] 78 getstatic System.out : PrintStream [15] 81 ldc <String "[e]"> [43] 83 invokevirtual PrintStream.print(String) : void [23] 86 iconst_0 87 istore 5 [var] 89 getstatic System.out : PrintStream [15] 92 ldc <String "[finally]"> [32] 94 invokevirtual PrintStream.println(String) : void [34] 97 aconst_null 98 astore 6 100 aload 6 102 invokevirtual Object.toString() : String [37] 105 pop 106 return 107 astore 4 109 iconst_0 110 istore 5 [var] 112 getstatic System.out : PrintStream [15] 115 ldc <String "[finally]"> [32] 117 invokevirtual PrintStream.println(String) : void [34] 120 aconst_null 121 astore 6 123 aload 6 125 invokevirtual Object.toString() : String [37] 128 pop 129 aload 4 131 athrow Exception Table: [pc: 4, pc: 40] -> 40 when : java.lang.NullPointerException [pc: 0, pc: 19] -> 77 when : java.lang.Exception [pc: 39, pc: 56] -> 77 when : java.lang.Exception [pc: 76, pc: 77] -> 77 when : java.lang.Exception [pc: 0, pc: 19] -> 107 when : any [pc: 40, pc: 56] -> 107 when : any [pc: 77, pc: 86] -> 107 when : any Added GenericTypeTest#test045 Now consider all surrounding try & synchronized statements in subroutines collections, and properly interact with their exception handlers (enter/exit). Fixed Verified for 3.2 M6 using build I20060327-0010 |