commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kohs...@apache.org
Subject svn commit: r290019 - /jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
Date Sun, 18 Sep 2005 23:56:36 GMT
Author: kohsuke
Date: Sun Sep 18 16:56:33 2005
New Revision: 290019

URL: http://svn.apache.org/viewcvs?rev=290019&view=rev
Log:
modified to avoid instrumenting a class that was already instrumented

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=290019&r1=290018&r2=290019&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
Sun Sep 18 16:56:33 2005
@@ -126,12 +126,22 @@
         log.debug("transforming class " + javaClazz.getClassName());
 
         //final JavaClass clazz = Repository.lookupClass(clazzName);
-        
+
+        {// check if this class is already instrumented
+            String[] intfs = javaClazz.getInterfaceNames();
+            for( int i=0; i<intfs.length; i++ )
+                if(intfs[i].equals(CONTINUABLE_CLASS)) {
+                    // no need to instrument further
+                    log.debug(javaClazz.getClassName()+" is already instrumented. Skipping");
+                    return original;
+                }
+        }
+
         final ClassGen clazzGen = new ClassGen(javaClazz);
         final ConstantPoolGen cp = clazzGen.getConstantPool();
 
         if(debug) {
-            dump(javaClazz, "orig");
+            dump(javaClazz, ".orig");
         }
 
         // vistor to build the frame information



---------------------------------------------------------------------
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