Pulled transaction start before try-catch block in the generated bytecode.
1.1 --- a/mdr/src/org/netbeans/mdr/handlers/gen/ClassGenerator.java Sun May 02 15:14:17 2004 +0000
1.2 +++ b/mdr/src/org/netbeans/mdr/handlers/gen/ClassGenerator.java Tue May 11 22:21:38 2004 +0000
1.3 @@ -512,8 +512,6 @@
1.4 // store "null" in result variable
1.5 code_astore(result, out);
1.6
1.7 - // start of the try block
1.8 -
1.9 // I'll pass this instance as the first parameter
1.10 code_aload(0, out);
1.11 out.writeByte(opc_aconst_null);
1.12 @@ -525,6 +523,9 @@
1.13 // store the returned object in a local variable
1.14 code_astore(extraInfo, out);
1.15
1.16 + // start of the try block
1.17 + short tryStart = (short) out.size();
1.18 +
1.19 if (isCustom) {
1.20 // I'll pass this instance as the first parameter
1.21 code_aload(0, out);
1.22 @@ -625,7 +626,7 @@
1.23 out.writeByte(opc_ret);
1.24 out.writeByte(addr);
1.25
1.26 - minfo.getExceptionTable().add(new ExceptionTableEntry((short) (3 + getBytesForLoadOrStore(fail) + getBytesForLoadOrStore(extraInfo) + getBytesForLoadOrStore(result)), catchStart, catchStart, (short) 0));
1.27 + minfo.getExceptionTable().add(new ExceptionTableEntry(tryStart, catchStart, catchStart, (short) 0));
1.28
1.29 minfo.setMaxStack((short)10);
1.30 minfo.setMaxLocals((short) (localSlot0 + 5));
2.1 --- a/mdr/src/org/netbeans/mdr/handlers/gen/FeaturedGenerator.java Sun May 02 15:14:17 2004 +0000
2.2 +++ b/mdr/src/org/netbeans/mdr/handlers/gen/FeaturedGenerator.java Tue May 11 22:21:38 2004 +0000
2.3 @@ -105,8 +105,6 @@
2.4 cout = new DataOutputStream(cminfo.getCodeStream());
2.5 }
2.6
2.7 - // start of the try block
2.8 -
2.9 // store "true" in the fail variable
2.10 out.writeByte(opc_iconst_1);
2.11 code_istore(fail, out);
2.12 @@ -135,6 +133,9 @@
2.13 // store the returned object in a local variable
2.14 code_astore(extraInfo, out);
2.15
2.16 + // start of the try block
2.17 + short tryStart = (short) out.size();
2.18 +
2.19 if (isCustom) {
2.20 // I'll pass this instance as the first parameter
2.21 code_aload(0, out);
2.22 @@ -272,7 +273,7 @@
2.23 out.writeByte(opc_ret);
2.24 out.writeByte(addr);
2.25
2.26 - minfo.getExceptionTable().add(new ExceptionTableEntry((short) (3 + getBytesForLoadOrStore(fail) + getBytesForLoadOrStore(extraInfo) + getBytesForLoadOrStore(result)), catchStart, catchStart, (short) 0));
2.27 + minfo.getExceptionTable().add(new ExceptionTableEntry(tryStart, catchStart, catchStart, (short) 0));
2.28
2.29 minfo.setMaxStack((short)10);
2.30 minfo.setMaxLocals((short) (localSlot0 + 7));
3.1 --- a/mdr/src/org/netbeans/mdr/handlers/gen/HandlerGenerator.java Sun May 02 15:14:17 2004 +0000
3.2 +++ b/mdr/src/org/netbeans/mdr/handlers/gen/HandlerGenerator.java Tue May 11 22:21:38 2004 +0000
3.3 @@ -216,8 +216,6 @@
3.4 // store "null" in result variable
3.5 code_astore(result, out);
3.6
3.7 - // start of the try block
3.8 -
3.9 // I'll pass this instance as the first parameter
3.10 code_aload(0, out);
3.11
3.12 @@ -233,7 +231,10 @@
3.13 // call the _pre method
3.14 out.writeByte(opc_invokespecial);
3.15 out.writeShort(preMethod);
3.16 -
3.17 +
3.18 + // start of the try block
3.19 + short tryStart = (short) out.size();
3.20 +
3.21 // store the returned object in a local variable
3.22 code_astore(extraInfo, out);
3.23
3.24 @@ -376,7 +377,7 @@
3.25 out.writeByte(opc_ret);
3.26 out.writeByte(addr);
3.27
3.28 - minfo.getExceptionTable().add(new ExceptionTableEntry((short) (3 + getBytesForLoadOrStore(fail) + getBytesForLoadOrStore(extraInfo) + getBytesForLoadOrStore(result)), catchStart, catchStart, (short) 0));
3.29 + minfo.getExceptionTable().add(new ExceptionTableEntry(tryStart, catchStart, catchStart, (short) 0));
3.30
3.31 minfo.setMaxStack((short)15);
3.32 minfo.setMaxLocals((short)(localSlot0 + 6));
4.1 --- a/mdr/src/org/netbeans/mdr/handlers/gen/PackageGenerator.java Sun May 02 15:14:17 2004 +0000
4.2 +++ b/mdr/src/org/netbeans/mdr/handlers/gen/PackageGenerator.java Tue May 11 22:21:38 2004 +0000
4.3 @@ -189,8 +189,6 @@
4.4 // store "null" in result variable
4.5 code_astore(result, out);
4.6
4.7 - // start of the try block
4.8 -
4.9 // I'll pass this instance as the first parameter
4.10 code_aload(0, out);
4.11
4.12 @@ -217,6 +215,9 @@
4.13 // store the returned object in a local variable
4.14 code_astore(extraInfo, out);
4.15
4.16 + // start of the try block
4.17 + short tryStart = (short) out.size();
4.18 +
4.19 if (isCustom) {
4.20 // I'll pass this instance as the first parameter
4.21 code_aload(0, out);
4.22 @@ -349,7 +350,7 @@
4.23 out.writeByte(opc_ret);
4.24 out.writeByte(addr);
4.25
4.26 - minfo.getExceptionTable().add(new ExceptionTableEntry((short) (3 + getBytesForLoadOrStore(fail) + getBytesForLoadOrStore(extraInfo) + getBytesForLoadOrStore(result)), catchStart, catchStart, (short) 0));
4.27 + minfo.getExceptionTable().add(new ExceptionTableEntry(tryStart, catchStart, catchStart, (short) 0));
4.28
4.29 minfo.setMaxStack((short) 15);
4.30 minfo.setMaxLocals((short) (localSlot0 + 5));