]> source.dussan.org Git - aspectj.git/commitdiff
fix for Bugzilla Bug 37325
authorjhugunin <jhugunin>
Sun, 11 May 2003 18:50:26 +0000 (18:50 +0000)
committerjhugunin <jhugunin>
Sun, 11 May 2003 18:50:26 +0000 (18:50 +0000)
   Weaver fails with NPE for very large source files

weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
weaver/src/org/aspectj/weaver/bcel/Utility.java

index aa5c157ec7c81401582233314ff9e59e484652c3..a5b5c06fb10a1d45b99adcb301afeaf0d6a12d53 100644 (file)
@@ -95,14 +95,14 @@ public final class LazyClassGen {
     {
         myGen = new ClassGen(class_name, super_class_name, file_name, access_flags, interfaces);
                constantPoolGen = myGen.getConstantPool();
-        fact = new InstructionFactory(constantPoolGen);
+        fact = new InstructionFactory(myGen, constantPoolGen);
     }
 
        //Non child type, so it comes from a real type in the world.
     public LazyClassGen(BcelObjectType myType) {
        myGen = new ClassGen(myType.getJavaClass());
        constantPoolGen = myGen.getConstantPool();
-               fact = new InstructionFactory(constantPoolGen);        
+               fact = new InstructionFactory(myGen, constantPoolGen);        
                this.myType = myType;
 
         Method[] methods = myGen.getMethods();
index 402c85b2ffbfa146ced41e64a1eff05397ba76d1..9dc9e2a904e5c2175c4cb47796fb32e4d4c36ffa 100644 (file)
@@ -27,6 +27,7 @@ import org.apache.bcel.generic.BranchInstruction;
 import org.apache.bcel.generic.ConstantPushInstruction;
 import org.apache.bcel.generic.INSTANCEOF;
 import org.apache.bcel.generic.Instruction;
+import org.apache.bcel.generic.InstructionConstants;
 import org.apache.bcel.generic.InstructionFactory;
 import org.apache.bcel.generic.InstructionHandle;
 import org.apache.bcel.generic.InstructionList;
@@ -318,13 +319,13 @@ public class Utility {
                int i) {
                Instruction inst;
                switch(i) {
-                       case -1: inst =  fact.ICONST_M1; break;
-                       case 0: inst =  fact.ICONST_0;  break;                  
-                       case 1: inst =  fact.ICONST_1; break;
-                       case 2: inst =  fact.ICONST_2; break;                           
-                       case 3: inst =  fact.ICONST_3; break;
-                       case 4: inst =  fact.ICONST_4;  break;                  
-                       case 5: inst =  fact.ICONST_5;  break;  
+                       case -1: inst =  InstructionConstants.ICONST_M1; break;
+                       case 0: inst =  InstructionConstants.ICONST_0;  break;                  
+                       case 1: inst =  InstructionConstants.ICONST_1; break;
+                       case 2: inst =  InstructionConstants.ICONST_2; break;                           
+                       case 3: inst =  InstructionConstants.ICONST_3; break;
+                       case 4: inst =  InstructionConstants.ICONST_4;  break;                  
+                       case 5: inst =  InstructionConstants.ICONST_5;  break;  
                }
                if (i <= Byte.MAX_VALUE && i >= Byte.MIN_VALUE) {
                inst =  new BIPUSH((byte)i);