You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2013/08/11 19:55:40 UTC

svn commit: r1512980 - in /commons/sandbox/weaver/trunk: ./ example/ modules/ modules/normalizer/ processor/src/main/java/org/apache/commons/weaver/ processor/src/main/java/org/apache/commons/weaver/model/

Author: mbenson
Date: Sun Aug 11 17:55:39 2013
New Revision: 1512980

URL: http://svn.apache.org/r1512980
Log:
merge normalizer + required changes back to trunk

Added:
    commons/sandbox/weaver/trunk/modules/normalizer/
      - copied from r1512979, commons/sandbox/weaver/branches/normalizer/modules/normalizer/
Modified:
    commons/sandbox/weaver/trunk/   (props changed)
    commons/sandbox/weaver/trunk/example/pom.xml
    commons/sandbox/weaver/trunk/modules/pom.xml
    commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/CleanProcessor.java
    commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/Finder.java
    commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java
    commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeaveEnvironment.java

Propchange: commons/sandbox/weaver/trunk/
------------------------------------------------------------------------------
  Merged /commons/sandbox/weaver/branches/normalizer:r1511092-1512979

Modified: commons/sandbox/weaver/trunk/example/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/weaver/trunk/example/pom.xml?rev=1512980&r1=1512979&r2=1512980&view=diff
==============================================================================
--- commons/sandbox/weaver/trunk/example/pom.xml (original)
+++ commons/sandbox/weaver/trunk/example/pom.xml Sun Aug 11 17:55:39 2013
@@ -1,22 +1,23 @@
 <?xml version="1.0"?>
-<!-- 
-
-  Copyright the original author or authors.
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-
- -->
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+--><project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.commons</groupId>

Modified: commons/sandbox/weaver/trunk/modules/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/weaver/trunk/modules/pom.xml?rev=1512980&r1=1512979&r2=1512980&view=diff
==============================================================================
--- commons/sandbox/weaver/trunk/modules/pom.xml (original)
+++ commons/sandbox/weaver/trunk/modules/pom.xml Sun Aug 11 17:55:39 2013
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
@@ -16,8 +16,7 @@ software distributed under the License i
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
--->
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <artifactId>commons-weaver-parent</artifactId>
@@ -31,6 +30,7 @@ under the License.
   <name>Commons Weaver Modules aggregator project</name>
   <modules>
     <module>privilizer</module>
+    <module>normalizer</module>
   </modules>
   <dependencies>
       <dependency>

Modified: commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/CleanProcessor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/CleanProcessor.java?rev=1512980&r1=1512979&r2=1512980&view=diff
==============================================================================
--- commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/CleanProcessor.java (original)
+++ commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/CleanProcessor.java Sun Aug 11 17:55:39 2013
@@ -85,7 +85,8 @@ public class CleanProcessor {
         final Finder finder = new Finder(new FileArchive(classLoader, target));
         for (Cleaner cleaner : CLEANERS) {
             final WeaveEnvironment env =
-                new WeaveEnvironment(classpath, target, configuration, Logger.getLogger(cleaner.getClass().getName()));
+                new WeaveEnvironment(classpath, target, classLoader, configuration, Logger.getLogger(cleaner.getClass()
+                    .getName()));
             cleaner.clean(env, finder);
         }
     }

Modified: commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/Finder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/Finder.java?rev=1512980&r1=1512979&r2=1512980&view=diff
==============================================================================
--- commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/Finder.java (original)
+++ commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/Finder.java Sun Aug 11 17:55:39 2013
@@ -681,10 +681,10 @@ class Finder extends AnnotationFinder im
                     // should we log something?
                     break;
             }
-            for (Class<?> supertype : request.getSupertypes()) {
-                for (Annotated<Class<?>> type : this.withAnnotations().findAssignableTypes(supertype)) {
-                    result.getWeavable(type.get()).addAnnotations(type.getAnnotations());
-                }
+        }
+        for (Class<?> supertype : request.getSupertypes()) {
+            for (Annotated<Class<?>> type : this.withAnnotations().findAssignableTypes(supertype)) {
+                result.getWeavable(type.get()).addAnnotations(type.getAnnotations());
             }
         }
         return inflater.inflate(result);

Modified: commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java?rev=1512980&r1=1512979&r2=1512980&view=diff
==============================================================================
--- commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java (original)
+++ commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java Sun Aug 11 17:55:39 2013
@@ -86,7 +86,8 @@ public class WeaveProcessor {
         final Finder finder = new Finder(new FileArchive(classLoader, target));
         for (Weaver weaver : WEAVERS) {
             final WeaveEnvironment env =
-                new WeaveEnvironment(classpath, target, configuration, Logger.getLogger(weaver.getClass().getName()));
+                new WeaveEnvironment(classpath, target, classLoader, configuration, Logger.getLogger(weaver.getClass()
+                    .getName()));
             weaver.process(env, finder);
         }
     }

Modified: commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeaveEnvironment.java
URL: http://svn.apache.org/viewvc/commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeaveEnvironment.java?rev=1512980&r1=1512979&r2=1512980&view=diff
==============================================================================
--- commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeaveEnvironment.java (original)
+++ commons/sandbox/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeaveEnvironment.java Sun Aug 11 17:55:39 2013
@@ -38,9 +38,14 @@ public class WeaveEnvironment {
     public final List<String> classpath;
 
     /**
-     * Target where scannable/weavable classes reside.
+     * Target where weavable classes reside.
      */
     public final File target;
+    
+    /**
+     * ClassLoader containing scannable and weavable classes.
+     */
+    public final ClassLoader classLoader;
 
     /**
      * Configuration properties. By convention, any configuration property should start with its name, e.g.
@@ -55,13 +60,15 @@ public class WeaveEnvironment {
      * 
      * @param classpath
      * @param target
+     * @param classLoader
      * @param config
      * @param log
      */
-    public WeaveEnvironment(List<String> classpath, File target, Properties config, Logger log) {
+    public WeaveEnvironment(List<String> classpath, File target, ClassLoader classLoader, Properties config, Logger log) {
         super();
         this.classpath = Collections.unmodifiableList(Validate.notNull(classpath, "classpath"));
         this.target = Validate.notNull(target, "target");
+        this.classLoader = classLoader;
         this.config = (Properties) Validate.notNull(config, "config").clone();
         this.log = log;
     }