commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject svn commit: r700623 - in /commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow: ./ bytecode/transformation/ bytecode/transformation/bcel/ bytecode/transformation/bcel/analyser/ stores/ utils/
Date Tue, 30 Sep 2008 23:03:32 GMT
Author: tcurdt
Date: Tue Sep 30 16:03:31 2008
New Revision: 700623

URL: http://svn.apache.org/viewvc?rev=700623&view=rev
Log:
nitpicking,
switched to asm as default transformer,
return null if class could not be read for BcelClassTransformer.transform()


Modified:
    commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/ContinuationClassLoader.java
    commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/ResourceTransformer.java
    commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
    commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/ControlFlowGraph.java
    commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/stores/JavaflowResourceStore.java
    commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/utils/RewritingUtils.java

Modified: commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/ContinuationClassLoader.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/ContinuationClassLoader.java?rev=700623&r1=700622&r2=700623&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/ContinuationClassLoader.java
(original)
+++ commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/ContinuationClassLoader.java
Tue Sep 30 16:03:31 2008
@@ -17,7 +17,7 @@
 package org.apache.commons.javaflow;
 
 import org.apache.commons.javaflow.bytecode.transformation.ResourceTransformer;
-import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
+import org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -107,7 +107,7 @@
     }
 
     public ContinuationClassLoader(URL[] urls, ClassLoader parent) {
-        this(urls,parent,new BcelClassTransformer());
+        this(urls,parent,new AsmClassTransformer());
     }
 
     private static ClassLoader fixNullParent(ClassLoader classLoader) {

Modified: commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/ResourceTransformer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/ResourceTransformer.java?rev=700623&r1=700622&r2=700623&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/ResourceTransformer.java
(original)
+++ commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/ResourceTransformer.java
Tue Sep 30 16:03:31 2008
@@ -16,11 +16,6 @@
  */
 package org.apache.commons.javaflow.bytecode.transformation;
 
-import org.apache.commons.javaflow.Continuation;
-import org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer;
-import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
-
-
 /**
  * Byte-code transformer that enhances the class files for javaflow.
  *

Modified: commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java?rev=700623&r1=700622&r2=700623&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
(original)
+++ commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
Tue Sep 30 16:03:31 2008
@@ -79,6 +79,7 @@
  *
  * @author tcurdt
  * @author Kohsuke Kawaguchi
+ * @deprecated use the AsmClassTransformer instead
  */
 public final class BcelClassTransformer implements ResourceTransformer {
 
@@ -130,7 +131,7 @@
     }
 
     public byte[] transform(final byte[] original) {
-        if(repository==null) {
+        if(repository == null) {
             return doTransform(original);
         } else {
             synchronized(repositoryLock) {
@@ -165,6 +166,10 @@
 			}
         }
         
+        if (javaClazz == null) {
+        	return null;
+        }
+        
         Repository.addClass(javaClazz);
         
         log.debug("transforming class " + javaClazz.getClassName());

Modified: commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/ControlFlowGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/ControlFlowGraph.java?rev=700623&r1=700622&r2=700623&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/ControlFlowGraph.java
(original)
+++ commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/ControlFlowGraph.java
Tue Sep 30 16:03:31 2008
@@ -138,7 +138,7 @@
 		public boolean execute(Frame inFrame, ExecutionPath execPreds, ExecutionVisitor ev){
 
             // When merge failed, this is useful to see what are two passes
-            ExecutionPath oldExecPreds = executionPredecessors;
+            //ExecutionPath oldExecPreds = executionPredecessors;
 
             executionPredecessors = execPreds;
 

Modified: commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/stores/JavaflowResourceStore.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/stores/JavaflowResourceStore.java?rev=700623&r1=700622&r2=700623&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/stores/JavaflowResourceStore.java
(original)
+++ commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/stores/JavaflowResourceStore.java
Tue Sep 30 16:03:31 2008
@@ -22,7 +22,7 @@
 import org.apache.bcel.Repository;
 import org.apache.bcel.util.ClassLoaderRepository;
 import org.apache.commons.javaflow.bytecode.transformation.ResourceTransformer;
-import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
+import org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer;
 import org.apache.commons.jci.stores.MemoryResourceStore;
 import org.apache.commons.jci.stores.ResourceStore;
 import org.apache.commons.jci.stores.TransactionalResourceStore;
@@ -52,7 +52,7 @@
         super(pStore);
         tstore = new TransformingResourceStore(
                 pStore,
-                new ResourceTransformer[] { new BcelClassTransformer() }
+                new ResourceTransformer[] { new AsmClassTransformer() }
                 );
         Repository.setRepository(new ClassLoaderRepository(this.getClass().getClassLoader()));
     }

Modified: commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/utils/RewritingUtils.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/utils/RewritingUtils.java?rev=700623&r1=700622&r2=700623&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/utils/RewritingUtils.java
(original)
+++ commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/utils/RewritingUtils.java
Tue Sep 30 16:03:31 2008
@@ -16,11 +16,6 @@
  */
 package org.apache.commons.javaflow.utils;
 
-import org.apache.commons.javaflow.bytecode.transformation.ResourceTransformer;
-import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -33,6 +28,11 @@
 import java.util.jar.JarInputStream;
 import java.util.jar.JarOutputStream;
 
+import org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer;
+import org.apache.commons.javaflow.bytecode.transformation.ResourceTransformer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 public final class RewritingUtils {
 
     private final static Log log = LogFactory.getLog(RewritingUtils.class);
@@ -173,7 +173,7 @@
 
 
     public static void main(final String[] args) throws FileNotFoundException, IOException
{
-        ResourceTransformer transformer = new BcelClassTransformer();
+        ResourceTransformer transformer = new AsmClassTransformer();
 
         for (int i=0; i<args.length; i+=2) {
             System.out.println("rewriting " + args[i]);



Mime
View raw message