commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1424730 - in /commons/sandbox/privilizer/trunk: maven-plugin/src/main/java/org/apache/commons/weaver/maven/ modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/ processor/src/main/java/org/apache/commons/weaver/ pr...
Date Thu, 20 Dec 2012 21:56:21 GMT
Author: struberg
Date: Thu Dec 20 21:56:21 2012
New Revision: 1424730

URL: http://svn.apache.org/viewvc?rev=1424730&view=rev
Log:
first step to migrate the maven plugin

Added:
    commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractWeaveMojo.java
  (contents, props changed)
      - copied, changed from r1424629, commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractPrivilegedMojo.java
Removed:
    commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractPrivilegedMojo.java
    commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/PrivilegedMojo.java
    commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestPrivilegedMojo.java
Modified:
    commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/PrepareMojo.java
    commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestPrepareMojo.java
    commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestWeaveMojo.java
    commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/WeaveMojo.java
    commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/FilesystemPrivilizer.java
    commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/PrivilizerWeaver.java
    commons/sandbox/privilizer/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java
    commons/sandbox/privilizer/trunk/processor/src/main/java/org/apache/commons/weaver/spi/Weaver.java
    commons/sandbox/privilizer/trunk/processor/src/test/java/org/apache/commons/weaver/test/weaver/TestWeaver.java

Copied: commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractWeaveMojo.java
(from r1424629, commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractPrivilegedMojo.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractWeaveMojo.java?p2=commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractWeaveMojo.java&p1=commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractPrivilegedMojo.java&r1=1424629&r2=1424730&rev=1424730&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractPrivilegedMojo.java
(original)
+++ commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractWeaveMojo.java
Thu Dec 20 21:56:21 2012
@@ -19,11 +19,6 @@ import java.io.File;
 import java.net.URLClassLoader;
 import java.util.List;
 
-import org.apache.commons.weaver.privilizer.weaver.AccessLevel;
-import org.apache.commons.weaver.privilizer.weaver.FilesystemPrivilizer;
-import org.apache.commons.weaver.privilizer.weaver.URLArray;
-import org.apache.commons.weaver.privilizer.weaver.Privilizer.Log;
-import org.apache.commons.weaver.privilizer.weaver.Privilizer.Policy;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugins.annotations.Parameter;
 
@@ -31,7 +26,7 @@ import org.apache.maven.plugins.annotati
 /**
  * Defines common properties.
  */
-public abstract class AbstractPrivilegedMojo extends AbstractMojo {
+public abstract class AbstractWeaveMojo extends AbstractMojo {
     /**
      * Weaving policy to use.
      */

Propchange: commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractWeaveMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/PrepareMojo.java
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/PrepareMojo.java?rev=1424730&r1=1424729&r2=1424730&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/PrepareMojo.java
(original)
+++ commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/PrepareMojo.java
Thu Dec 20 21:56:21 2012
@@ -15,8 +15,6 @@
  */
 package org.apache.commons.weaver.maven;
 
-import javassist.NotFoundException;
-
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
@@ -29,7 +27,7 @@ import org.apache.maven.project.MavenPro
  * policy.
  */
 @Mojo(name = "prepare", defaultPhase = LifecyclePhase.INITIALIZE, requiresDependencyCollection
= ResolutionScope.COMPILE)
-public class PrepareMojo extends PrivilegedMojo {
+public class PrepareMojo extends WeaveMojo {
     @Component
     private MavenProject project;
 
@@ -37,8 +35,10 @@ public class PrepareMojo extends Privile
     public void execute() throws MojoExecutionException {
         if (target.exists()) {
             try {
+            /*X TODO do we need the prepare mojo at all?
                 createWeaver().prepare();
-            } catch (NotFoundException e) {
+                */
+            } catch (Exception e) {
                 throw new MojoExecutionException("error", e);
             }
         }

Modified: commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestPrepareMojo.java
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestPrepareMojo.java?rev=1424730&r1=1424729&r2=1424730&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestPrepareMojo.java
(original)
+++ commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestPrepareMojo.java
Thu Dec 20 21:56:21 2012
@@ -15,8 +15,6 @@
  */
 package org.apache.commons.weaver.maven;
 
-import javassist.NotFoundException;
-
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
@@ -29,18 +27,20 @@ import org.apache.maven.project.MavenPro
  * policy.
  */
 @Mojo(name = "test-prepare", defaultPhase = LifecyclePhase.INITIALIZE, requiresDependencyCollection
= ResolutionScope.TEST)
-public class TestPrepareMojo extends TestPrivilegedMojo {
+public class TestPrepareMojo extends TestWeaveMojo {
     @Component
     private MavenProject project;
 
     @Override
     public void execute() throws MojoExecutionException {
         if (target.exists()) {
+/*X TODO do we need the prepare mojo at all?
             try {
                 createWeaver().prepare();
-            } catch (NotFoundException e) {
+            } catch (Exception e) {
                 throw new MojoExecutionException("error", e);
             }
+*/
         }
     }
 

Modified: commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestWeaveMojo.java
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestWeaveMojo.java?rev=1424730&r1=1424729&r2=1424730&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestWeaveMojo.java
(original)
+++ commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestWeaveMojo.java
Thu Dec 20 21:56:21 2012
@@ -15,22 +15,50 @@
  */
 package org.apache.commons.weaver.maven;
 
-import org.apache.commons.weaver.privilizer.Privileged;
+import java.io.File;
+import java.util.List;
+
+import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
 
 
 /**
- * Goal to weave test classes with {@link SecurityManager} handling code for methods marked
with
- * the {@link Privileged} annotation.
+ * Goal to weave test classes.
  */
 @Mojo(name = "test-weave", defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES, requiresDependencyCollection
= ResolutionScope.TEST)
-public class TestWeaveMojo extends TestPrivilegedMojo {
+public class TestWeaveMojo extends AbstractWeaveMojo {
+
+    @Parameter(readonly = true, required = true, defaultValue = "${project.testClasspathElements}")
+    protected List<String> classpath;
+
+    @Parameter(readonly = true, required = true, defaultValue = "${project.build.testOutputDirectory}")
+    protected File target;
+
+    @Parameter(readonly = false, required = true, defaultValue = "PUBLIC")
+    protected AccessLevel accessLevel;
+
+    @Override
+    protected List<String> getClasspath() {
+        return classpath;
+    }
+
+    @Override
+    protected File getTarget() {
+        return target;
+    }
+
+    @Override
+    protected AccessLevel getAccessLevel() {
+        return accessLevel;
+    }
 
     @Override
-    public void execute() throws MojoFailureException {
+    public void execute() throws MojoExecutionException
+    {
         try {
             createWeaver().weaveAll();
         } catch (Exception e) {

Modified: commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/WeaveMojo.java
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/WeaveMojo.java?rev=1424730&r1=1424729&r2=1424730&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/WeaveMojo.java
(original)
+++ commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/WeaveMojo.java
Thu Dec 20 21:56:21 2012
@@ -15,22 +15,49 @@
  */
 package org.apache.commons.weaver.maven;
 
-import org.apache.commons.weaver.privilizer.Privileged;
+import java.io.File;
+import java.util.List;
+
+import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
 
 
 /**
- * Goal to weave classes with {@link SecurityManager} handling code for methods marked with
- * the {@link Privileged} annotation.
+ * Goal to weave classes.
  */
 @Mojo(name = "weave", defaultPhase = LifecyclePhase.PROCESS_CLASSES, requiresDependencyCollection
= ResolutionScope.COMPILE)
-public class WeaveMojo extends PrivilegedMojo {
+public class WeaveMojo extends AbstractWeaveMojo {
+
+    @Parameter(readonly = true, required = true, defaultValue = "${project.compileClasspathElements}")
+    protected List<String> classpath;
+
+    @Parameter(readonly = true, required = true, defaultValue = "${project.build.outputDirectory}")
+    protected File target;
+
+    @Parameter(readonly = false, required = true, defaultValue = "PACKAGE")
+    protected AccessLevel accessLevel;
+
+    @Override
+    protected List<String> getClasspath() {
+        return classpath;
+    }
+
+    @Override
+    protected File getTarget() {
+        return target;
+    }
 
     @Override
-    public void execute() throws MojoFailureException {
+    protected AccessLevel getAccessLevel() {
+        return accessLevel;
+    }
+    @Override
+    public void execute() throws MojoExecutionException
+    {
         try {
             createWeaver().weaveAll();
         } catch (Exception e) {

Modified: commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/FilesystemPrivilizer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/FilesystemPrivilizer.java?rev=1424730&r1=1424729&r2=1424730&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/FilesystemPrivilizer.java
(original)
+++ commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/FilesystemPrivilizer.java
Thu Dec 20 21:56:21 2012
@@ -19,9 +19,7 @@ import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.Method;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
-import java.util.TreeSet;
 
 import javassist.CannotCompileException;
 import javassist.ClassPool;
@@ -29,12 +27,7 @@ import javassist.CtClass;
 import javassist.LoaderClassPath;
 import javassist.NotFoundException;
 
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.filefilter.RegexFileFilter;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.Validate;
-import org.apache.xbean.finder.AnnotationFinder;
-import org.apache.xbean.finder.archive.FileArchive;
 
 
 /**
@@ -95,12 +88,11 @@ public class FilesystemPrivilizer extend
         this.target = target;
     }
 
-    /**
+    /*X TODO remove or fix!
      * Clear the way by deleting classfiles woven with a different
      * {@link Policy}.
      * 
      * @throws NotFoundException
-     */
     public void prepare() throws NotFoundException {
         info("preparing %s; policy = %s", target, policy);
         final Set<File> toDelete = new TreeSet<File>();
@@ -132,6 +124,7 @@ public class FilesystemPrivilizer extend
             }
         }
     }
+    */
 
     /**
      * Weave all {@link Privileged} methods found.
@@ -141,16 +134,8 @@ public class FilesystemPrivilizer extend
      * @throws CannotCompileException
      * @throws ClassNotFoundException
      */
-    public void weaveAll() throws NotFoundException, IOException, CannotCompileException,
ClassNotFoundException {
-        int woven = 0;
-        for (final Class<?> type : getDeclaringClasses(findPrivilegedMethods())) {
-            if (weave(classPool.get(type.getName()))) {
-                woven++;
-            }
-        }
-        if (woven > 0) {
-            info("Wove %s classes.", woven);
-        }
+    public boolean weaveClass(Class<?> clazz) throws NotFoundException, IOException,
CannotCompileException, ClassNotFoundException {
+        return weave(classPool.get(clazz.getName()));
     }
 
     @Override
@@ -158,8 +143,4 @@ public class FilesystemPrivilizer extend
         return classFileWriter;
     }
 
-    private List<Method> findPrivilegedMethods() {
-        final AnnotationFinder annotationFinder = new AnnotationFinder(new FileArchive(classpath,
target), false);
-        return annotationFinder.findAnnotatedMethods(Privileged.class);
-    }
 }

Modified: commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/PrivilizerWeaver.java
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/PrivilizerWeaver.java?rev=1424730&r1=1424729&r2=1424730&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/PrivilizerWeaver.java
(original)
+++ commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/PrivilizerWeaver.java
Thu Dec 20 21:56:21 2012
@@ -1,12 +1,17 @@
 package org.apache.commons.weaver.privilizer;
 
 import java.io.File;
+import java.io.IOException;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.net.URLClassLoader;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.logging.Logger;
 
+import javassist.CannotCompileException;
+import javassist.NotFoundException;
 import org.apache.commons.weaver.spi.Weaver;
 
 /**
@@ -15,6 +20,8 @@ import org.apache.commons.weaver.spi.Wea
  */
 public class PrivilizerWeaver implements Weaver
 {
+    private Logger logger = Logger.getLogger(PrivilizerWeaver.class.getName());
+
     private FilesystemPrivilizer privilizer;
 
     private Privilizer.Policy policy;
@@ -25,7 +32,11 @@ public class PrivilizerWeaver implements
 
     private File target;
 
-
+    @Override
+    public void setLogger(Logger customLogger)
+    {
+        this.logger = customLogger;
+    }
 
     @Override
     public void configure(Map<String, Object> config)
@@ -41,30 +52,54 @@ public class PrivilizerWeaver implements
     @Override
     public List<Class<? extends Annotation>> getInterest()
     {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+        List<Class<? extends Annotation>> interest = new ArrayList<Class<?
extends Annotation>>();
+        interest.add(Privileged.class);
+        return interest;
     }
 
     @Override
     public void preWeave()
     {
-        //To change body of implemented methods use File | Settings | File Templates.
+        // nothing to do
     }
 
     @Override
-    public boolean weave(Class classToWeave)
+    public boolean weave(Class classToWeave, Class<? extends Annotation> processingAnnotation)
     {
-        return false;  //To change body of implemented methods use File | Settings | File
Templates.
+        // Privilizer does not weave classes
+        return false;
     }
 
     @Override
-    public boolean weave(Method methodToWeave)
+    public boolean weave(Method methodToWeave, Class<? extends Annotation> processingAnnotation)
     {
-        return false;  //To change body of implemented methods use File | Settings | File
Templates.
+        try
+        {
+            privilizer.weaveClass(methodToWeave.getDeclaringClass());
+        }
+        catch (NotFoundException e)
+        {
+            throw new RuntimeException(e);
+        }
+        catch (IOException e)
+        {
+            throw new RuntimeException(e);
+        }
+        catch (CannotCompileException e)
+        {
+            throw new RuntimeException(e);
+        }
+        catch (ClassNotFoundException e)
+        {
+            throw new RuntimeException(e);
+        }
+
+        return true;
     }
 
     @Override
     public void postWeave()
     {
-        //To change body of implemented methods use File | Settings | File Templates.
+        // nothing to do
     }
 }

Modified: commons/sandbox/privilizer/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java?rev=1424730&r1=1424729&r2=1424730&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java
(original)
+++ commons/sandbox/privilizer/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java
Thu Dec 20 21:56:21 2012
@@ -110,12 +110,12 @@ public class WeaveProcessor {
             List<Class<?>> annotatedClasses = annotationFinder.findAnnotatedClasses(annotation);
 
             for (Class<?> annotatedClass : annotatedClasses) {
-                weaver.weave(annotatedClass);
+                weaver.weave(annotatedClass, annotation);
             }
 
             List<Method> annotateMethods = annotationFinder.findAnnotatedMethods(annotation);
             for (Method annotatedMethod : annotateMethods) {
-                weaver.weave(annotatedMethod);
+                weaver.weave(annotatedMethod, annotation);
             }
         }
     }

Modified: commons/sandbox/privilizer/trunk/processor/src/main/java/org/apache/commons/weaver/spi/Weaver.java
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/processor/src/main/java/org/apache/commons/weaver/spi/Weaver.java?rev=1424730&r1=1424729&r2=1424730&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/processor/src/main/java/org/apache/commons/weaver/spi/Weaver.java
(original)
+++ commons/sandbox/privilizer/trunk/processor/src/main/java/org/apache/commons/weaver/spi/Weaver.java
Thu Dec 20 21:56:21 2012
@@ -22,6 +22,7 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.util.List;
 import java.util.Map;
+import java.util.logging.Logger;
 
 /**
  * An implementation of a 'Weaver' takes care about
@@ -40,6 +41,12 @@ public interface Weaver
     void configure(Map<String, Object> config);
 
     /**
+     * This method can be used to set a custom logger
+     * @param customLogger
+     */
+    void setLogger(Logger customLogger);
+
+    /**
      * A Weaver must return a List of Annotations he is interested in.
      */
     List<Class<? extends Annotation>> getInterest();
@@ -55,7 +62,7 @@ public interface Weaver
      *
      * @return <code>true</code> if some bytecode has been changed
      */
-    boolean weave(Class classToWeave);
+    boolean weave(Class classToWeave, Class<? extends Annotation> processingAnnotation);
 
     /**
      * Perform weaving on the given class for any class which has one of the required annotations.
@@ -63,7 +70,7 @@ public interface Weaver
      *
      * @return <code>true</code> if some bytecode has been changed
      */
-    boolean weave(Method methodToWeave);
+    boolean weave(Method methodToWeave, Class<? extends Annotation> processingAnnotation);
 
 
     /**

Modified: commons/sandbox/privilizer/trunk/processor/src/test/java/org/apache/commons/weaver/test/weaver/TestWeaver.java
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/processor/src/test/java/org/apache/commons/weaver/test/weaver/TestWeaver.java?rev=1424730&r1=1424729&r2=1424730&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/processor/src/test/java/org/apache/commons/weaver/test/weaver/TestWeaver.java
(original)
+++ commons/sandbox/privilizer/trunk/processor/src/test/java/org/apache/commons/weaver/test/weaver/TestWeaver.java
Thu Dec 20 21:56:21 2012
@@ -23,6 +23,7 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.logging.Logger;
 
 import org.apache.commons.weaver.test.beans.TestAnnotation;
 import org.junit.Assert;
@@ -39,6 +40,11 @@ public class TestWeaver implements Weave
     public static List<Class> wovenClasses = new ArrayList<Class>();
 
     @Override
+    public void setLogger(Logger customLogger) {
+        // do nothing
+    }
+
+    @Override
     public void configure(Map<String, Object> config)
     {
         Assert.assertNotNull(config);
@@ -63,13 +69,13 @@ public class TestWeaver implements Weave
     }
 
     @Override
-    public boolean weave(Class classToWeave)
+    public boolean weave(Class classToWeave, Class<? extends Annotation> processingAnnotation)
     {
         return wovenClasses.add(classToWeave);
     }
 
     @Override
-    public boolean weave(Method methodToWeave)
+    public boolean weave(Method methodToWeave, Class<? extends Annotation> processingAnnotation)
     {
         return wovenMethods.add(methodToWeave);
     }



Mime
View raw message