commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kohs...@apache.org
Subject svn commit: r291068 - /jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
Date Fri, 23 Sep 2005 03:57:35 GMT
Author: kohsuke
Date: Thu Sep 22 20:57:29 2005
New Revision: 291068

URL: http://svn.apache.org/viewcvs?rev=291068&view=rev
Log:
added a code to work around a LinkError in JDK 5.0

Modified:
    jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java

Modified: jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java?rev=291068&r1=291067&r2=291068&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
(original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
Thu Sep 22 20:57:29 2005
@@ -25,6 +25,7 @@
 import org.apache.bcel.classfile.ConstantUtf8;
 import org.apache.bcel.classfile.JavaClass;
 import org.apache.bcel.classfile.Method;
+import org.apache.bcel.classfile.Attribute;
 import org.apache.bcel.generic.ACONST_NULL;
 import org.apache.bcel.generic.BasicType;
 import org.apache.bcel.generic.ClassGen;
@@ -475,6 +476,15 @@
         }
 
         method.setMaxLocals(localVarsSize[0]);
+
+        // remove LocalVariableTypeTable attribute until BCEL #33549 is fixed,
+        // so that JDK 5.0 classes can be instrumented correctly.
+        // see http://issues.apache.org/bugzilla/show_bug.cgi?id=33549
+        Attribute[] atts = method.getCodeAttributes();
+        for( int i=0; i<atts.length; i++ ) {
+            if(atts[i].getNameIndex()==method.getConstantPool().lookupUtf8("LocalVariableTypeTable"))
+                method.removeCodeAttribute(atts[i]);
+        }
     }
 
     private InstructionList duplicateStack(MethodGen method, InvokeInstruction invoke, ObjectType
objecttype, int[] localVarsSize) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message