diff --git a/jode/ChangeLog b/jode/ChangeLog index 0193368..14555d3 100644 --- a/jode/ChangeLog +++ b/jode/ChangeLog @@ -1,4 +1,11 @@ -2002-02-25 Jochen Hoenicke +2002-06-11 Jochen Hoenicke + + * jode/bytecode/BytecodeInfo.java.in (readAttribute): Fix the + exception handlers that javac 1.4 produces: I simply shorten + the start/end interval, so that the catcher is not in the end + interval. + +2002-02-25 Jochen Hoenicke * jode/bytecode/ClassInfo.java.in (read): Don't check for a maximum version anymore. Sun changes it with every release without diff --git a/jode/jode/bytecode/BytecodeInfo.java.in b/jode/jode/bytecode/BytecodeInfo.java.in index 6f37864..71c28ff 100644 --- a/jode/jode/bytecode/BytecodeInfo.java.in +++ b/jode/jode/bytecode/BytecodeInfo.java.in @@ -856,6 +856,26 @@ public class BytecodeInfo extends BinaryInfo implements Opcodes { handlersLength--; i--; } + + if (exceptionHandlers[i].start.getAddr() + <= exceptionHandlers[i].catcher.getAddr() + && exceptionHandlers[i].end.getAddr() + >= exceptionHandlers[i].catcher.getAddr()) + { + /* Javac 1.4 is a bit paranoid with finally and + * synchronize blocks and even breaks the JLS. + * We fix it here. Hopefully this won't produce + * any other problems. + */ + if (exceptionHandlers[i].start + == exceptionHandlers[i].catcher) { + handlersLength--; + i--; + } else { + exceptionHandlers[i].end = + exceptionHandlers[i].catcher.getPrevByAddr(); + } + } } if (handlersLength < exceptionHandlers.length) { Handler[] newHandlers = new Handler[handlersLength];