commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1557247 [1/2] - in /commons/proper/weaver/trunk: ./ ant/lib/src/main/java/org/apache/commons/weaver/ant/ build-tools/ build-tools/src/main/resources/org/apache/commons/proxy2/ build-tools/src/main/resources/org/apache/commons/weaver/ examp...
Date Fri, 10 Jan 2014 20:14:42 GMT
Author: mbenson
Date: Fri Jan 10 20:14:41 2014
New Revision: 1557247

URL: http://svn.apache.org/r1557247
Log:
checkstyle

Added:
    commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/package-info.java   (with props)
    commons/proper/weaver/trunk/build-tools/
      - copied from r1556597, commons/proper/proxy/branches/version-2.0-work/build-tools/
    commons/proper/weaver/trunk/build-tools/src/main/resources/org/apache/commons/weaver/
      - copied from r1556597, commons/proper/proxy/branches/version-2.0-work/build-tools/src/main/resources/org/apache/commons/proxy2/
    commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/package-info.java   (with props)
    commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/package-info.java   (with props)
    commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/package-info.java   (with props)
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/package-info.java   (with props)
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/package-info.java   (with props)
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/package-info.java   (with props)
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/spi/package-info.java   (with props)
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/utils/package-info.java   (with props)
Removed:
    commons/proper/weaver/trunk/build-tools/src/main/resources/org/apache/commons/proxy2/
Modified:
    commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/AbstractWeaverTask.java
    commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/CleanTask.java
    commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/InlineProperties.java
    commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/WeaveTask.java
    commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java
    commons/proper/weaver/trunk/build-tools/pom.xml
    commons/proper/weaver/trunk/build-tools/src/main/resources/org/apache/commons/weaver/checkstyle.xml
    commons/proper/weaver/trunk/example/pom.xml
    commons/proper/weaver/trunk/example/src/main/java/org/apache/commons/weaver/privilizer/example/Setup.java
    commons/proper/weaver/trunk/example/src/main/java/org/apache/commons/weaver/privilizer/example/Utils.java
    commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractPrepareMojo.java
    commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractWeaveMojo.java
    commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/JavaLoggingToMojoLoggingRedirector.java
    commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/PrepareMojo.java
    commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestPrepareMojo.java
    commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestWeaveMojo.java
    commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/WeaveMojo.java
    commons/proper/weaver/trunk/modules/normalizer/example/pom.xml
    commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/ContrivedWrapper.java
    commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/InstanceMembers.java
    commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/StaticMembers.java
    commons/proper/weaver/trunk/modules/normalizer/example/src/test/java/org/apache/commons/weaver/normalizer/example/NormalizerTest.java
    commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java
    commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/NormalizerWeaver.java
    commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/Utils.java
    commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/Privileged.java
    commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/Privilizing.java
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/AccessLevel.java
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/ActionGenerator.java
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/BlueprintingVisitor.java
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Field.java
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/FieldAccess.java
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/InlineNestedPrivilegedCalls.java
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Policy.java
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilized.java
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/PrivilizerWeaver.java
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/PrivilizingVisitor.java
    commons/proper/weaver/trunk/pom.xml
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/CleanProcessor.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/Finder.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/Inflater.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/AnnotatedElements.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/NestedWeavable.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/ScanRequest.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/ScanResult.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/Scanner.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/Weavable.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeavableClass.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeavableConstructor.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeavableConstructorParameter.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeavableExecutable.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeavableField.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeavableMethod.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeavableMethodParameter.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeavablePackage.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeavableParameter.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeaveEnvironment.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/model/WeaveInterest.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/spi/Cleaner.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/spi/Weaver.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/utils/Annotations.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/utils/Args.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/utils/URLArray.java
    commons/proper/weaver/trunk/src/site/markdown/index.md

Modified: commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/AbstractWeaverTask.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/AbstractWeaverTask.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/AbstractWeaverTask.java (original)
+++ commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/AbstractWeaverTask.java Fri Jan 10 20:14:41 2014
@@ -29,11 +29,19 @@ import org.apache.tools.ant.types.Refere
 public abstract class AbstractWeaverTask extends Task {
     private WeaverSettings settings;
 
+    /**
+     * Create a new {@link AbstractWeaverTask} instance.
+     * @param project owner
+     */
     protected AbstractWeaverTask(Project project) {
         super();
         setProject(project);
     }
 
+    /**
+     * Add a nested {@link WeaverSettings}.
+     * @param settings to add
+     */
     public void add(WeaverSettings settings) {
         if (this.settings != null) {
             throw new BuildException("settings already specified");
@@ -41,10 +49,18 @@ public abstract class AbstractWeaverTask
         this.settings = settings;
     }
 
+    /**
+     * Get the {@link WeaverSettings} in use.
+     * @return {@link WeaverSettings}
+     */
     public WeaverSettings getSettings() {
         return settings;
     }
 
+    /**
+     * Set a project reference to a {@link WeaverSettings} object.
+     * @param refid key
+     */
     public void setSettingsRef(String refid) {
         final WeaverSettings settings = new WeaverSettings(getProject());
         settings.setRefid(new Reference(getProject(), refid));

Modified: commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/CleanTask.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/CleanTask.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/CleanTask.java (original)
+++ commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/CleanTask.java Fri Jan 10 20:14:41 2014
@@ -27,12 +27,19 @@ import org.apache.tools.ant.Project;
  * Clean Ant task.
  */
 public class CleanTask extends AbstractWeaverTask {
+    /**
+     * Create a new {@link CleanTask} instance.
+     * @param project owner
+     */
     public CleanTask(Project project) {
         super(project);
     }
 
+    /**
+     * Execute the clean task.
+     */
     @Override
-    public void execute() throws BuildException {
+    public void execute() {
         try {
             final WeaverSettings settings = Validate.notNull(getSettings(), "settings");
             final CleanProcessor cp =

Modified: commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/InlineProperties.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/InlineProperties.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/InlineProperties.java (original)
+++ commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/InlineProperties.java Fri Jan 10 20:14:41 2014
@@ -24,36 +24,51 @@ import org.apache.commons.lang3.StringUt
 import org.apache.tools.ant.DynamicElement;
 
 /**
- * Structure to allow inline specification of properties.
- * 
- * Example:
- * {pre}<foo>foo-value</foo>
- * <bar>bar-value</bar>
- * <baz>baz
- * -nextline-value</baz>
+ * <p>Structure to allow inline specification of properties.</p>
+ * <p>Example:
+ * {pre}&lt;foo&gt;foo-value&lt;/foo&gt;
+ * &lt;bar&gt;bar-value&lt;/bar&gt;
+ * &lt;baz&gt;baz
+ * -nextline-value&lt;/baz&gt;
  * {/pre}
+ * </p>
  */
 public class InlineProperties implements DynamicElement {
     /**
      * Represents a single inline property.
      */
-    public class InlineProperty {
+    public final class InlineProperty {
         private final String name;
 
         private InlineProperty(String name) {
             this.name = name;
         }
 
+        /**
+         * Add text to this property.
+         * @param text to add
+         */
         public void addText(String text) {
+            final String value;
             if (properties.containsKey(name)) {
-                text = StringUtils.join(properties.getProperty(name), text);
+                value = StringUtils.join(properties.getProperty(name), text);
+            } else {
+                value = text;
             }
-            properties.setProperty(name, text);
+            properties.setProperty(name, value);
         }
     }
 
+    /**
+     * {@link Properties} object maintained by the {@link InlineProperties}.
+     */
     final Properties properties = new Properties();
 
+    /**
+     * Handle the specified nested element.
+     * @param name property name
+     * @return {@link InlineProperty}
+     */
     public InlineProperty createDynamicElement(String name) {
         return new InlineProperty(name);
     }

Modified: commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/WeaveTask.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/WeaveTask.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/WeaveTask.java (original)
+++ commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/WeaveTask.java Fri Jan 10 20:14:41 2014
@@ -27,12 +27,19 @@ import org.apache.tools.ant.Project;
  * Weave Ant task.
  */
 public class WeaveTask extends AbstractWeaverTask {
+    /**
+     * Create a new {@link WeaveTask} instance.
+     * @param project owner
+     */
     public WeaveTask(Project project) {
         super(project);
     }
 
+    /**
+     * Execute the weave task.
+     */
     @Override
-    public void execute() throws BuildException {
+    public void execute() {
         try {
             final WeaverSettings settings = Validate.notNull(getSettings(), "settings");
             final WeaveProcessor wp =

Modified: commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java (original)
+++ commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java Fri Jan 10 20:14:41 2014
@@ -52,11 +52,19 @@ public class WeaverSettings extends Data
     private PropertySet propertySet;
     private InlineProperties inlineProperties;
 
+    /**
+     * Create a new {@link WeaverSettings} object.
+     * @param project owner
+     */
     public WeaverSettings(Project project) {
         super();
         setProject(project);
     }
 
+    /**
+     * Get the {@code target} directory.
+     * @return {@link File}
+     */
     public File getTarget() {
         if (isReference()) {
             return getRef().getTarget();
@@ -64,6 +72,10 @@ public class WeaverSettings extends Data
         return target;
     }
 
+    /**
+     * Set the {@code target} directory.
+     * @param target {@link File}
+     */
     public void setTarget(File target) {
         if (isReference()) {
             throw tooManyAttributes();
@@ -71,6 +83,10 @@ public class WeaverSettings extends Data
         this.target = target;
     }
 
+    /**
+     * Get the {@code classpathref}.
+     * @return {@link String}
+     */
     public String getClasspathref() {
         if (isReference()) {
             return getRef().getClasspathref();
@@ -78,6 +94,10 @@ public class WeaverSettings extends Data
         return classpathref;
     }
 
+    /**
+     * Set the {@code classpathref}.
+     * @param classpathref {@link String}
+     */
     public void setClasspathRef(String classpathref) {
         if (isReference()) {
             throw tooManyAttributes();
@@ -88,7 +108,6 @@ public class WeaverSettings extends Data
     /**
      * Return the effective classpath (system classpath + configured classpath) as a {@link List} of {@link String}
      * filesystem paths.
-     * 
      * @return List<String>
      */
     public List<String> getClasspathEntries() {
@@ -102,6 +121,10 @@ public class WeaverSettings extends Data
         return Arrays.asList(p.list());
     }
 
+    /**
+     * Get the {@code classpath}.
+     * @return {@link Path}
+     */
     public Path getClasspath() {
         if (isReference()) {
             return getRef().getClasspath();
@@ -118,6 +141,10 @@ public class WeaverSettings extends Data
         return classpath;
     }
 
+    /**
+     * Set the {@code classpath}.
+     * @param classpath {@link Path}
+     */
     public void setClasspath(Path classpath) {
         if (isReference()) {
             throw tooManyAttributes();
@@ -128,6 +155,10 @@ public class WeaverSettings extends Data
         this.classpath = classpath;
     }
 
+    /**
+     * Create the nested {@code properties}.
+     * @return {@link InlineProperties}
+     */
     public InlineProperties createProperties() {
         if (isReference()) {
             throw noChildrenAllowed();
@@ -139,6 +170,10 @@ public class WeaverSettings extends Data
         return inlineProperties;
     }
 
+    /**
+     * Create a nested {@code propertyset}.
+     * @return {@link PropertySet}
+     */
     public PropertySet createPropertySet() {
         if (isReference()) {
             throw noChildrenAllowed();
@@ -153,7 +188,6 @@ public class WeaverSettings extends Data
 
     /**
      * Merge nested {@code propertyset} and {@code properties}; latter takes precedence.
-     * 
      * @return Properties
      */
     public Properties getProperties() {

Added: commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/package-info.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/package-info.java?rev=1557247&view=auto
==============================================================================
--- commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/package-info.java (added)
+++ commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/package-info.java Fri Jan 10 20:14:41 2014
@@ -0,0 +1,4 @@
+/**
+ * Integration with Apache Ant.
+ */
+package org.apache.commons.weaver.ant;
\ No newline at end of file

Propchange: commons/proper/weaver/trunk/ant/lib/src/main/java/org/apache/commons/weaver/ant/package-info.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: commons/proper/weaver/trunk/build-tools/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/build-tools/pom.xml?rev=1557247&r1=1556597&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/build-tools/pom.xml (original)
+++ commons/proper/weaver/trunk/build-tools/pom.xml Fri Jan 10 20:14:41 2014
@@ -18,11 +18,11 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>org.apache.commons</groupId>
-        <artifactId>commons-proxy2-parent</artifactId>
-        <version>2.0-SNAPSHOT</version>
+        <artifactId>commons-weaver-parent</artifactId>
+        <version>1.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>commons-proxy2-build-tools</artifactId>
-    <name>Commons Proxy Build Tools</name>
+    <artifactId>commons-weaver-build-tools</artifactId>
+    <name>Apache Commons Weaver Build Tools</name>
     <description>Provide common setup, from http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html</description>
 </project>

Modified: commons/proper/weaver/trunk/build-tools/src/main/resources/org/apache/commons/weaver/checkstyle.xml
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/build-tools/src/main/resources/org/apache/commons/weaver/checkstyle.xml?rev=1557247&r1=1556597&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/build-tools/src/main/resources/org/apache/commons/weaver/checkstyle.xml (original)
+++ commons/proper/weaver/trunk/build-tools/src/main/resources/org/apache/commons/weaver/checkstyle.xml Fri Jan 10 20:14:41 2014
@@ -1,45 +1,207 @@
 <?xml version="1.0"?>
-
 <!--
-  ~ 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.
-  -->     
+   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.
+-->
 <!DOCTYPE module PUBLIC
-    "-//Puppy Crawl//DTD Check Configuration 1.1//EN"
-    "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+<!--
+
+  Checkstyle configuration that checks the sun coding conventions from:
+
+    - the Java Language Specification at
+      http://java.sun.com/docs/books/jls/second_edition/html/index.html
+
+    - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
+
+    - the Javadoc guidelines at
+      http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
+
+    - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
+
+    - some best practices
+
+  Checkstyle is very configurable. Be sure to read the documentation at
+  http://checkstyle.sf.net (or in your downloaded distribution).
+
+  Most Checks are configurable, be sure to consult the documentation.
+
+  To completely disable a check, just comment it out or delete it from the file.
+
+  Finally, it is worth reading the documentation.
+
+-->
 
-<!-- commons proxy2 customization of default Checkstyle behavior -->
 <module name="Checker">
-  <property name="localeLanguage" value="en"/>
+    <!--
+        If you set the basedir property below, then all reported file
+        names will be relative to the specified directory. See
+        http://checkstyle.sourceforge.net/5.x/config.html#Checker
+
+        <property name="basedir" value="${basedir}" />
+    -->
+
+    <!-- Checks that each Java package has a Javadoc file used for commenting. -->
+    <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage       -->
+    <module name="JavadocPackage" />
+
+    <!-- Checks that property files contain the same keys.         -->
+    <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
+    <module name="Translation" />
 
-  <module name="Header">
-    <property name="headerFile" value="${checkstyle.header.file}"/>
-  </module>
-
-  <!-- no tabs allowed in files -->
-  <module name="FileTabCharacter"/>
-
-  <module name="TreeWalker">
-    <!-- Verify that EVERY source file has the appropriate license -->
-    <!-- check sane import statements -->
-    <module name="AvoidStarImport"/>
-    <module name="RedundantImport"/>
-    <module name="UnusedImports"/>
+    <module name="FileLength" />
+
+    <!-- Following interprets the header file as regular expressions. -->
+    <!-- <module name="RegexpHeader" />                                -->
+
+    <module name="FileTabCharacter">
+        <property name="eachLine" value="true" />
+    </module>
 
-    <module name="LineLength">
-      <property name="max" value="120"/>
+    <module name="RegexpSingleline">
+        <!-- \s matches whitespace character, $ matches end of line. -->
+        <property name="format" value="\s+$" />
+        <property name="message" value="Line has trailing spaces." />
     </module>
-  </module>
+
+    <module name="TreeWalker">
+
+        <property name="cacheFile" value="${checkstyle.cache.file}" />
+
+        <!-- Checks for Javadoc comments.                     -->
+        <!-- See http://checkstyle.sf.net/config_javadoc.html -->
+        <module name="JavadocMethod">
+            <property name="scope" value="protected" />
+            <property name="allowUndeclaredRTE" value="true" />
+        </module>
+        <module name="JavadocType">
+            <property name="scope" value="protected" />
+        </module>
+        <module name="JavadocVariable">
+            <property name="scope" value="protected" />
+        </module>
+        <module name="JavadocStyle" />
+
+
+        <!-- Checks for Naming Conventions.                  -->
+        <!-- See http://checkstyle.sf.net/config_naming.html -->
+        <module name="ConstantName" />
+        <module name="LocalFinalVariableName" />
+        <module name="LocalVariableName" />
+        <module name="MemberName" />
+        <module name="MethodName" />
+        <module name="PackageName" />
+        <module name="ParameterName" />
+        <module name="StaticVariableName" />
+        <module name="TypeName" />
+
+
+        <!-- Checks for Headers                                -->
+        <!-- See http://checkstyle.sf.net/config_header.html   -->
+        <!-- <module name="Header">                            -->
+            <!-- The follow property value demonstrates the ability     -->
+            <!-- to have access to ANT properties. In this case it uses -->
+            <!-- the ${basedir} property to allow Checkstyle to be run  -->
+            <!-- from any directory within a project. See property      -->
+            <!-- expansion,                                             -->
+            <!-- http://checkstyle.sf.net/config.html#properties        -->
+            <!-- <property                                              -->
+            <!--     name="headerFile"                                  -->
+            <!--     value="${basedir}/java.header" />                   -->
+        <!-- </module> -->
+
+
+        <!-- Checks for imports                              -->
+        <!-- See http://checkstyle.sf.net/config_import.html -->
+        <module name="AvoidStarImport" />
+        <module name="IllegalImport" /> <!-- defaults to sun.* packages -->
+        <module name="RedundantImport" />
+        <module name="UnusedImports">
+            <property name="processJavadoc" value="true" />
+        </module>
+
+
+        <!-- Checks for Size Violations.                    -->
+        <!-- See http://checkstyle.sf.net/config_sizes.html -->
+        <module name="LineLength">
+            <property name="max" value="120" />
+        </module>
+        <module name="MethodLength" />
+        <module name="ParameterNumber" />
+
+
+        <!-- Checks for whitespace                               -->
+        <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+        <module name="EmptyForIteratorPad" />
+        <module name="MethodParamPad" />
+        <module name="NoWhitespaceAfter">
+            <property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS" />
+        </module>
+        <module name="NoWhitespaceBefore" />
+        <module name="OperatorWrap" />
+        <module name="ParenPad" />
+        <module name="TypecastParenPad" />
+        <module name="WhitespaceAfter" />
+        <module name="WhitespaceAround" />
+
+
+        <!-- Modifier Checks                                    -->
+        <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+        <module name="ModifierOrder" />
+        <module name="RedundantModifier" />
+
+
+        <!-- Checks for blocks. You know, those {}'s         -->
+        <!-- See http://checkstyle.sf.net/config_blocks.html -->
+        <module name="EmptyBlock">
+            <property name="option" value="text" />
+        </module>
+        <module name="LeftCurly" />
+        <module name="NeedBraces" />
+        <module name="RightCurly" />
+
+
+        <!-- Checks for common coding problems               -->
+        <!-- See http://checkstyle.sf.net/config_coding.html -->
+        <module name="EmptyStatement" />
+        <module name="EqualsHashCode" />
+        <module name="IllegalInstantiation" />
+        <module name="InnerAssignment" />
+        <module name="MissingSwitchDefault" />
+        <module name="ModifiedControlVariable" />
+        <module name="ParameterAssignment" />
+        <module name="RedundantThrows" />
+        <module name="SimplifyBooleanExpression" />
+        <module name="SimplifyBooleanReturn" />
+        <module name="StringLiteralEquality" />
+
+        <!-- Checks for class design                         -->
+        <!-- See http://checkstyle.sf.net/config_design.html -->
+        <module name="FinalClass" />
+        <module name="HideUtilityClassConstructor" />
+        <module name="InterfaceIsType" />
+
+
+        <!-- Miscellaneous other checks.                   -->
+        <!-- See http://checkstyle.sf.net/config_misc.html -->
+        <module name="ArrayTypeStyle" />
+        <module name="TodoComment" />
+        <module name="UpperEll" />
+
+    </module>
+
 </module>

Modified: commons/proper/weaver/trunk/example/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/example/pom.xml?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/example/pom.xml (original)
+++ commons/proper/weaver/trunk/example/pom.xml Fri Jan 10 20:14:41 2014
@@ -30,6 +30,7 @@ under the License.
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <privilizer.policy>ON_INIT</privilizer.policy>
     <privilizer.verify>true</privilizer.verify>
+    <checkstyle.skip>true</checkstyle.skip>
   </properties>
   <dependencies>
     <dependency>

Modified: commons/proper/weaver/trunk/example/src/main/java/org/apache/commons/weaver/privilizer/example/Setup.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/example/src/main/java/org/apache/commons/weaver/privilizer/example/Setup.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/example/src/main/java/org/apache/commons/weaver/privilizer/example/Setup.java (original)
+++ commons/proper/weaver/trunk/example/src/main/java/org/apache/commons/weaver/privilizer/example/Setup.java Fri Jan 10 20:14:41 2014
@@ -18,7 +18,10 @@ package org.apache.commons.weaver.privil
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-class Setup {
+final class Setup {
+    private Setup() {
+    }
+
     /**
      * This simply allows us to to set up test classes by doing
      * privileged things without granting privileges to the test

Modified: commons/proper/weaver/trunk/example/src/main/java/org/apache/commons/weaver/privilizer/example/Utils.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/example/src/main/java/org/apache/commons/weaver/privilizer/example/Utils.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/example/src/main/java/org/apache/commons/weaver/privilizer/example/Utils.java (original)
+++ commons/proper/weaver/trunk/example/src/main/java/org/apache/commons/weaver/privilizer/example/Utils.java Fri Jan 10 20:14:41 2014
@@ -18,8 +18,8 @@
  */
 package org.apache.commons.weaver.privilizer.example;
 
-public class Utils {
-    public static class More {
+public final class Utils {
+    public static final class More {
         private More() {
         }
 
@@ -49,7 +49,8 @@ public class Utils {
         if (i <= 0) {
             return getProperty(key);
         }
-        return getProperty(--i, key);
+        int counter = i;
+        return getProperty(--counter, key);
     }
 
     public static String getProperty(String key) {

Modified: commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractPrepareMojo.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractPrepareMojo.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractPrepareMojo.java (original)
+++ commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractPrepareMojo.java Fri Jan 10 20:14:41 2014
@@ -32,16 +32,34 @@ import org.apache.maven.plugins.annotati
  */
 public abstract class AbstractPrepareMojo extends AbstractMojo {
 
+    /**
+     * {@code verbose} parameter.
+     */
     @Parameter(defaultValue = "false")
     protected boolean verbose;
 
+    /**
+     * {@code weaver.config} parameter.
+     */
     @Parameter(property = "weaver.config", required = false)
     protected Properties weaverConfig;
 
+    /**
+     * Get the classpath for this prepare mojo.
+     * @return {@link List} of {@link String}
+     */
     protected abstract List<String> getClasspath();
 
+    /**
+     * Get the target directory for this prepare mojo.
+     * @return {@link File}
+     */
     protected abstract File getTarget();
 
+    /**
+     * Execute this mojo.
+     * @throws MojoExecutionException in the event of failure
+     */
     @Override
     public void execute() throws MojoExecutionException {
         if (!getTarget().isDirectory()) {

Modified: commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractWeaveMojo.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractWeaveMojo.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractWeaveMojo.java (original)
+++ commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractWeaveMojo.java Fri Jan 10 20:14:41 2014
@@ -32,16 +32,34 @@ import org.apache.maven.plugins.annotati
  */
 public abstract class AbstractWeaveMojo extends AbstractMojo {
 
+    /**
+     * {@code verbose} parameter.
+     */
     @Parameter(defaultValue = "false")
     protected boolean verbose;
 
+    /**
+     * {@code weaver.config} parameter.
+     */
     @Parameter(property = "weaver.config", required = false)
     protected Properties weaverConfig;
 
+    /**
+     * Get the classpath for this weave mojo.
+     * @return {@link List} of {@link String}
+     */
     protected abstract List<String> getClasspath();
 
+    /**
+     * Get the target directory for this weave mojo.
+     * @return {@link File}
+     */
     protected abstract File getTarget();
 
+    /**
+     * Execute this mojo.
+     * @throws MojoExecutionException in the event of failure
+     */
     @Override
     public void execute() throws MojoExecutionException {
         final JavaLoggingToMojoLoggingRedirector logRedirector = new JavaLoggingToMojoLoggingRedirector(getLog());

Modified: commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/JavaLoggingToMojoLoggingRedirector.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/JavaLoggingToMojoLoggingRedirector.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/JavaLoggingToMojoLoggingRedirector.java (original)
+++ commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/JavaLoggingToMojoLoggingRedirector.java Fri Jan 10 20:14:41 2014
@@ -53,6 +53,7 @@ public class JavaLoggingToMojoLoggingRed
 
     /**
      * Activates this feature.
+     * @throws MojoExecutionException in the event of failure
      */
     public void activate() throws MojoExecutionException {
         try {
@@ -62,7 +63,7 @@ public class JavaLoggingToMojoLoggingRed
                 rootLogger.removeHandler(handler);
                 removedHandlers.add(handler);
             }
-            if (removedHandlers.size() == 0) {
+            if (removedHandlers.isEmpty()) {
                 throw new MojoExecutionException("could not remove any handler. aborting.");
             }
 
@@ -78,7 +79,7 @@ public class JavaLoggingToMojoLoggingRed
     }
 
     /**
-     * deactivate the redirection and put the original Handlers back in place
+     * Deactivate the redirection and put the original Handlers back in place
      * again.
      */
     public void deactivate() {
@@ -131,7 +132,7 @@ public class JavaLoggingToMojoLoggingRed
         private String getMessage(LogRecord record) {
             String message = record.getMessage();
             ResourceBundle bundle = record.getResourceBundle();
-            Object params[] = record.getParameters();
+            Object[] params = record.getParameters();
             if (bundle != null && bundle.containsKey(message)) {
                 // todo: cannot enforce Locale.ENGLISH here
                 message = bundle.getString(message);

Modified: commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/PrepareMojo.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/PrepareMojo.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/PrepareMojo.java (original)
+++ commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/PrepareMojo.java Fri Jan 10 20:14:41 2014
@@ -21,27 +21,45 @@ package org.apache.commons.weaver.maven;
 import java.io.File;
 import java.util.List;
 
+import org.apache.maven.model.Build;
 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;
+import org.apache.maven.project.MavenProject;
 
 /**
  * Goal to clean woven classes.
  */
-@Mojo(name = "prepare", defaultPhase = LifecyclePhase.INITIALIZE, requiresDependencyCollection = ResolutionScope.COMPILE)
+@Mojo(
+    name = "prepare",
+    defaultPhase = LifecyclePhase.INITIALIZE,
+    requiresDependencyCollection = ResolutionScope.COMPILE
+)
 public class PrepareMojo extends AbstractPrepareMojo {
+    /**
+     * {@link MavenProject#getCompileClasspathElements()}.
+     */
     @Parameter(readonly = true, required = true, defaultValue = "${project.compileClasspathElements}")
     protected List<String> classpath;
 
+    /**
+     * {@link Build#getOutputDirectory()}.
+     */
     @Parameter(readonly = true, required = true, defaultValue = "${project.build.outputDirectory}")
     protected File target;
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected List<String> getClasspath() {
         return classpath;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected File getTarget() {
         return target;

Modified: commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestPrepareMojo.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestPrepareMojo.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestPrepareMojo.java (original)
+++ commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestPrepareMojo.java Fri Jan 10 20:14:41 2014
@@ -21,28 +21,46 @@ package org.apache.commons.weaver.maven;
 import java.io.File;
 import java.util.List;
 
+import org.apache.maven.model.Build;
 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;
+import org.apache.maven.project.MavenProject;
 
 /**
  * Goal to clean woven test classes.
  */
-@Mojo(name = "test-prepare", defaultPhase = LifecyclePhase.INITIALIZE, requiresDependencyCollection = ResolutionScope.TEST)
+@Mojo(
+    name = "test-prepare",
+    defaultPhase = LifecyclePhase.INITIALIZE,
+    requiresDependencyCollection = ResolutionScope.TEST
+)
 public class TestPrepareMojo extends AbstractPrepareMojo {
 
+    /**
+     * {@link MavenProject#getTestClasspathElements()}.
+     */
     @Parameter(readonly = true, required = true, defaultValue = "${project.testClasspathElements}")
     protected List<String> classpath;
 
+    /**
+     * {@link Build#getTestOutputDirectory()}.
+     */
     @Parameter(readonly = true, required = true, defaultValue = "${project.build.testOutputDirectory}")
     protected File target;
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected List<String> getClasspath() {
         return classpath;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected File getTarget() {
         return target;

Modified: commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestWeaveMojo.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestWeaveMojo.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestWeaveMojo.java (original)
+++ commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/TestWeaveMojo.java Fri Jan 10 20:14:41 2014
@@ -21,28 +21,46 @@ package org.apache.commons.weaver.maven;
 import java.io.File;
 import java.util.List;
 
+import org.apache.maven.model.Build;
 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;
+import org.apache.maven.project.MavenProject;
 
 /**
  * Goal to weave test classes.
  */
-@Mojo(name = "test-weave", defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES, requiresDependencyCollection = ResolutionScope.TEST)
+@Mojo(
+    name = "test-weave",
+    defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES,
+    requiresDependencyCollection = ResolutionScope.TEST
+)
 public class TestWeaveMojo extends AbstractWeaveMojo {
 
+    /**
+     * {@link MavenProject#getTestClasspathElements()}.
+     */
     @Parameter(readonly = true, required = true, defaultValue = "${project.testClasspathElements}")
     protected List<String> classpath;
 
+    /**
+     * {@link Build#getTestOutputDirectory()}.
+     */
     @Parameter(readonly = true, required = true, defaultValue = "${project.build.testOutputDirectory}")
     protected File target;
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected List<String> getClasspath() {
         return classpath;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected File getTarget() {
         return target;

Modified: commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/WeaveMojo.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/WeaveMojo.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/WeaveMojo.java (original)
+++ commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/WeaveMojo.java Fri Jan 10 20:14:41 2014
@@ -21,28 +21,46 @@ package org.apache.commons.weaver.maven;
 import java.io.File;
 import java.util.List;
 
+import org.apache.maven.model.Build;
 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;
+import org.apache.maven.project.MavenProject;
 
 /**
  * Goal to weave classes.
  */
-@Mojo(name = "weave", defaultPhase = LifecyclePhase.PROCESS_CLASSES, requiresDependencyCollection = ResolutionScope.COMPILE)
+@Mojo(
+    name = "weave",
+    defaultPhase = LifecyclePhase.PROCESS_CLASSES,
+    requiresDependencyCollection = ResolutionScope.COMPILE
+)
 public class WeaveMojo extends AbstractWeaveMojo {
 
+    /**
+     * {@link MavenProject#getCompileClasspathElements()}.
+     */
     @Parameter(readonly = true, required = true, defaultValue = "${project.compileClasspathElements}")
     protected List<String> classpath;
 
+    /**
+     * {@link Build#getOutputDirectory()}.
+     */
     @Parameter(readonly = true, required = true, defaultValue = "${project.build.outputDirectory}")
     protected File target;
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected List<String> getClasspath() {
         return classpath;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected File getTarget() {
         return target;

Added: commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/package-info.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/package-info.java?rev=1557247&view=auto
==============================================================================
--- commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/package-info.java (added)
+++ commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/package-info.java Fri Jan 10 20:14:41 2014
@@ -0,0 +1,4 @@
+/**
+ * Integration with Apache Maven.
+ */
+package org.apache.commons.weaver.maven;
\ No newline at end of file

Propchange: commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/package-info.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: commons/proper/weaver/trunk/modules/normalizer/example/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/normalizer/example/pom.xml?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/normalizer/example/pom.xml (original)
+++ commons/proper/weaver/trunk/modules/normalizer/example/pom.xml Fri Jan 10 20:14:41 2014
@@ -28,6 +28,7 @@ under the License.
   <name>Apache Commons Weaver Normalizer Example</name>
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <checkstyle.skip>true</checkstyle.skip>
   </properties>
   <dependencies>
     <dependency>
@@ -49,7 +50,7 @@ under the License.
         <configuration>
           <weaverConfig>
             <normalizer.superTypes>
-              org.apache.commons.weaver.normalizer.example.TypeLiteral,
+              org.apache.commons.lang3.reflect.TypeLiteral,
               org.apache.commons.weaver.normalizer.example.ContrivedWrapper
             </normalizer.superTypes>
             <normalizer.targetPackage>org.apache.commons.weaver.normalizer.example.normalized</normalizer.targetPackage>

Modified: commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/ContrivedWrapper.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/ContrivedWrapper.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/ContrivedWrapper.java (original)
+++ commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/ContrivedWrapper.java Fri Jan 10 20:14:41 2014
@@ -34,7 +34,7 @@ public abstract class ContrivedWrapper {
         if (obj == this) {
             return true;
         }
-        if (obj instanceof ContrivedWrapper == false) {
+        if (!(obj instanceof ContrivedWrapper)) {
             return false;
         }
         final ContrivedWrapper other = (ContrivedWrapper) obj;

Modified: commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/InstanceMembers.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/InstanceMembers.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/InstanceMembers.java (original)
+++ commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/InstanceMembers.java Fri Jan 10 20:14:41 2014
@@ -18,14 +18,16 @@
  */
 package org.apache.commons.weaver.normalizer.example;
 
+import org.apache.commons.lang3.reflect.TypeLiteral;
+
 public class InstanceMembers {
-    public final TypeLiteral<String> STRING_TYPE = new TypeLiteral<String>() {};
-    public final TypeLiteral<String> STRING_TYPE2 = new TypeLiteral<String>() {};
-    public final TypeLiteral<Iterable<Integer>> INTEGER_ITERABLE_TYPE = new TypeLiteral<Iterable<Integer>>() {};
-    
-    public final ContrivedWrapper WRAPPED_OBJECT = new ContrivedWrapper(new Object()) {};
-    public final ContrivedWrapper WRAPPED_STRING = new ContrivedWrapper("foo") {};
-    public final ContrivedWrapper WRAPPED_STRING2 = new ContrivedWrapper("foo") {};
-    public final ContrivedWrapper WRAPPED_INTEGER = new ContrivedWrapper(Integer.valueOf(1)) {};
-    public final ContrivedWrapper WRAPPED_INT = new ContrivedWrapper(1) {};
+    public final TypeLiteral<String> stringType = new TypeLiteral<String>() { };
+    public final TypeLiteral<String> stringType2 = new TypeLiteral<String>() { };
+    public final TypeLiteral<Iterable<Integer>> integerIterableType = new TypeLiteral<Iterable<Integer>>() { };
+
+    public final ContrivedWrapper wrappedObject = new ContrivedWrapper(new Object()) { };
+    public final ContrivedWrapper wrappedString = new ContrivedWrapper("foo") { };
+    public final ContrivedWrapper wrappedString2 = new ContrivedWrapper("foo") { };
+    public final ContrivedWrapper wrappedInteger = new ContrivedWrapper(Integer.valueOf(1)) { };
+    public final ContrivedWrapper wrappedInt = new ContrivedWrapper(1) { };
 }

Modified: commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/StaticMembers.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/StaticMembers.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/StaticMembers.java (original)
+++ commons/proper/weaver/trunk/modules/normalizer/example/src/main/java/org/apache/commons/weaver/normalizer/example/StaticMembers.java Fri Jan 10 20:14:41 2014
@@ -18,14 +18,19 @@
  */
 package org.apache.commons.weaver.normalizer.example;
 
-public class StaticMembers {
-    public static final TypeLiteral<String> STRING_TYPE = new TypeLiteral<String>() {};
-    public static final TypeLiteral<String> STRING_TYPE2 = new TypeLiteral<String>() {};
-    public static final TypeLiteral<Iterable<Integer>> INTEGER_ITERABLE_TYPE = new TypeLiteral<Iterable<Integer>>() {};
-    
-    public static final ContrivedWrapper WRAPPED_OBJECT = new ContrivedWrapper(new Object()) {};
-    public static final ContrivedWrapper WRAPPED_STRING = new ContrivedWrapper("foo") {};
-    public static final ContrivedWrapper WRAPPED_STRING2 = new ContrivedWrapper("foo") {};
-    public static final ContrivedWrapper WRAPPED_INTEGER = new ContrivedWrapper(Integer.valueOf(1)) {};
-    public static final ContrivedWrapper WRAPPED_INT = new ContrivedWrapper(1) {};
+import org.apache.commons.lang3.reflect.TypeLiteral;
+
+public final class StaticMembers {
+    private StaticMembers() {
+    }
+
+    public static final TypeLiteral<String> STRING_TYPE = new TypeLiteral<String>() { };
+    public static final TypeLiteral<String> STRING_TYPE2 = new TypeLiteral<String>() { };
+    public static final TypeLiteral<Iterable<Integer>> INTEGER_ITERABLE_TYPE = new TypeLiteral<Iterable<Integer>>() { };
+
+    public static final ContrivedWrapper WRAPPED_OBJECT = new ContrivedWrapper(new Object()) { };
+    public static final ContrivedWrapper WRAPPED_STRING = new ContrivedWrapper("foo") { };
+    public static final ContrivedWrapper WRAPPED_STRING2 = new ContrivedWrapper("foo") { };
+    public static final ContrivedWrapper WRAPPED_INTEGER = new ContrivedWrapper(Integer.valueOf(1)) { };
+    public static final ContrivedWrapper WRAPPED_INT = new ContrivedWrapper(1) { };
 }

Modified: commons/proper/weaver/trunk/modules/normalizer/example/src/test/java/org/apache/commons/weaver/normalizer/example/NormalizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/normalizer/example/src/test/java/org/apache/commons/weaver/normalizer/example/NormalizerTest.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/normalizer/example/src/test/java/org/apache/commons/weaver/normalizer/example/NormalizerTest.java (original)
+++ commons/proper/weaver/trunk/modules/normalizer/example/src/test/java/org/apache/commons/weaver/normalizer/example/NormalizerTest.java Fri Jan 10 20:14:41 2014
@@ -37,12 +37,12 @@ public class NormalizerTest {
         final Class<?> stringLiteral = StaticMembers.STRING_TYPE.getClass();
         assertTrue(stringLiteral.isInstance(StaticMembers.STRING_TYPE2));
         assertFalse(stringLiteral.isInstance(StaticMembers.INTEGER_ITERABLE_TYPE));
-        assertTrue(stringLiteral.isInstance(instanceMembers.STRING_TYPE));
-        assertTrue(stringLiteral.isInstance(instanceMembers.STRING_TYPE2));
-        assertFalse(stringLiteral.isInstance(instanceMembers.INTEGER_ITERABLE_TYPE));
+        assertTrue(stringLiteral.isInstance(instanceMembers.stringType));
+        assertTrue(stringLiteral.isInstance(instanceMembers.stringType2));
+        assertFalse(stringLiteral.isInstance(instanceMembers.integerIterableType));
 
         final Class<?> integerIterable = StaticMembers.INTEGER_ITERABLE_TYPE.getClass();
-        assertTrue(integerIterable.isInstance(instanceMembers.INTEGER_ITERABLE_TYPE));
+        assertTrue(integerIterable.isInstance(instanceMembers.integerIterableType));
     }
 
     @Test
@@ -52,12 +52,12 @@ public class NormalizerTest {
         assertTrue(objectWrapper.isInstance(StaticMembers.WRAPPED_STRING2));
         assertTrue(objectWrapper.isInstance(StaticMembers.WRAPPED_INTEGER));
         assertFalse(objectWrapper.isInstance(StaticMembers.WRAPPED_INT));
-        assertTrue(objectWrapper.isInstance(instanceMembers.WRAPPED_OBJECT));
-        assertTrue(objectWrapper.isInstance(instanceMembers.WRAPPED_STRING));
-        assertTrue(objectWrapper.isInstance(instanceMembers.WRAPPED_STRING2));
-        assertTrue(objectWrapper.isInstance(instanceMembers.WRAPPED_INTEGER));
-        assertFalse(objectWrapper.isInstance(instanceMembers.WRAPPED_INT));
+        assertTrue(objectWrapper.isInstance(instanceMembers.wrappedObject));
+        assertTrue(objectWrapper.isInstance(instanceMembers.wrappedString));
+        assertTrue(objectWrapper.isInstance(instanceMembers.wrappedString2));
+        assertTrue(objectWrapper.isInstance(instanceMembers.wrappedInteger));
+        assertFalse(objectWrapper.isInstance(instanceMembers.wrappedInt));
         final Class<?> intWrapper = StaticMembers.WRAPPED_INT.getClass();
-        assertTrue(intWrapper.isInstance(instanceMembers.WRAPPED_INT));
+        assertTrue(intWrapper.isInstance(instanceMembers.wrappedInt));
     }
 }

Modified: commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java (original)
+++ commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java Fri Jan 10 20:14:41 2014
@@ -95,8 +95,8 @@ public class Normalizer {
         }
 
         @Override
-        public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-            super.visit(version, access, name, signature, superName, interfaces);
+        public void visit(int version, int access, String name, String signature, String superName, String[] intrfces) {
+            super.visit(version, access, name, signature, superName, intrfces);
             className = name;
         }
 
@@ -250,16 +250,17 @@ public class Normalizer {
                         return new MethodVisitor(Opcodes.ASM4, mv) {
                             @Override
                             public void visitMethodInsn(int opcode, String owner, String name, String desc) {
+                                String useDescriptor = desc;
                                 if ("<init>".equals(name)) {
                                     final ClassWrapper w = e.getValue().get(owner);
                                     if (w != null && w.mustRewriteConstructor) {
                                         // simply replace first argument type with OBJECT_TYPE:
                                         final Type[] args = Type.getArgumentTypes(desc);
                                         args[0] = OBJECT_TYPE;
-                                        desc = new Method("<init>", Type.VOID_TYPE, args).getDescriptor();
+                                        useDescriptor = new Method("<init>", Type.VOID_TYPE, args).getDescriptor();
                                     }
                                 }
-                                super.visitMethodInsn(opcode, owner, name, desc);
+                                super.visitMethodInsn(opcode, owner, name, useDescriptor);
                             }
                         };
                     }
@@ -281,16 +282,16 @@ public class Normalizer {
     }
 
     /**
-     * Find subclasses/implementors of {code supertype} that:
+     * <p>Find subclasses/implementors of {code supertype} that:
      * <ul>
      * <li>are anonymous</li>
      * <li>declare a single constructor (probably redundant in the case of an anonymous class)</li>
      * <li>do not implement any methods</li>
      * </ul>
-     * 
+     * </p><p>
      * Considered "broadly" eligible because the instructions in the implemented constructor may remove the class from
      * consideration later on.
-     * 
+     * </p>
      * @param supertype whose subtypes are sought
      * @param scanner to use
      * @return {@link Set} of {@link Class}
@@ -319,20 +320,22 @@ public class Normalizer {
     }
 
     /**
-     * Segregate a number of classes (presumed subclasses/implementors of a common supertype/interface). The keys of the
-     * map consist of the important parts for identifying similar anonymous types: the "signature" and the invoked
-     * superclass constructor. For our purposes, the signature consists of the first applicable item of:
+     * <p>Segregate a number of classes (presumed subclasses/implementors of a
+     * common supertype/interface). The keys of the map consist of the important
+     * parts for identifying similar anonymous types: the "signature" and the
+     * invoked superclass constructor. For our purposes, the signature consists
+     * of the first applicable item of:
      * <ol>
      * <li>The generic signature of the class</li>
      * <li>The sole implemented interface</li>
      * <li>The superclass</li>
      * </ol>
-     * 
+     * </p><p>
      * The class will be considered ineligible if its constructor is too "busy" as its side effects cannot be
      * anticipated; the normalizer will err on the side of caution.
-     * 
+     * </p><p>
      * Further, we will here avail ourselves of the opportunity to discard any types we have already normalized.
-     * 
+     * </p>
      * @param subtypes
      * @return Map of Pair<String, String> to Set of Classes
      * @throws Exception
@@ -426,7 +429,6 @@ public class Normalizer {
      * Create the normalized version of a given class in the configured target package. The {@link Normalizer} will
      * gladly do so in a package from which the normalized class will not actually be able to reference any types upon
      * which it relies; in such a situation you must specify the target package as the package of the supertype.
-     * 
      * @param key used to generate the normalized classname.
      * @param classWrapper
      * @return the generated classname.

Modified: commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/NormalizerWeaver.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/NormalizerWeaver.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/NormalizerWeaver.java (original)
+++ commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/NormalizerWeaver.java Fri Jan 10 20:14:41 2014
@@ -28,6 +28,9 @@ import org.apache.commons.weaver.spi.Wea
  */
 public class NormalizerWeaver implements Weaver {
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public boolean process(WeaveEnvironment environment, Scanner scanner) {
         return new Normalizer(environment).normalize(scanner);

Modified: commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/Utils.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/Utils.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/Utils.java (original)
+++ commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/Utils.java Fri Jan 10 20:14:41 2014
@@ -20,43 +20,62 @@ import java.util.LinkedHashSet;
 import java.util.Set;
 
 import org.apache.commons.lang3.ClassUtils;
-import org.apache.commons.lang3.Conversion;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.Validate;
 
-class Utils {
+/**
+ * Normalization utilities.
+ */
+final class Utils {
+    private Utils() {
+    }
 
+    /**
+     * Validate a package name.
+     * @param pkg to validate
+     * @return {@code pkg}, ({@code ""} if {@code null}), having replaced
+     *         {@code '.'} with {@code '/'} and removed any terminating separator
+     * @throws IllegalArgumentException if invalid
+     */
     static String validatePackageName(String pkg) {
         if (StringUtils.isBlank(pkg)) {
             return "";
         }
-        pkg = pkg.trim();
+        String result = pkg.trim();
 
         final String unexpected = "Unexpected character %s at pos %s of package name \"%s\"";
 
         boolean next = true;
-        for (int pos = 0; pos < pkg.length(); pos++) {
-            final char c = pkg.charAt(pos);
+        for (int pos = 0; pos < result.length(); pos++) {
+            final char c = result.charAt(pos);
             if (next) {
                 next = false;
-                Validate.isTrue(Character.isJavaIdentifierStart(c), unexpected, c, pos, pkg);
+                Validate.isTrue(Character.isJavaIdentifierStart(c), unexpected, c, pos, result);
                 continue;
             }
             if (c == '/' || c == '.') {
                 next = true;
                 continue;
             }
-            Validate.isTrue(Character.isJavaIdentifierPart(c), unexpected, c, pos, pkg);
+            Validate.isTrue(Character.isJavaIdentifierPart(c), unexpected, c, pos, result);
         }
 
-        pkg = pkg.replace('.', '/');
-        final int last = pkg.length() - 1;
-        if (pkg.charAt(last) == '/') {
-            pkg = pkg.substring(0, last);
+        result = result.replace('.', '/');
+        final int last = result.length() - 1;
+        if (result.charAt(last) == '/') {
+            result = result.substring(0, last);
         }
-        return pkg;
+        return result;
     }
 
+    /**
+     * Parse a number of Java types speciified as a comma-delimited
+     * {@link String} of fully-qualified or internal names (i.e., slashes are
+     * legal).
+     * @param types to parse
+     * @param cl {@link ClassLoader} to search
+     * @return {@link Set} of {@link Class}
+     */
     static Set<Class<?>> parseTypes(String types, ClassLoader cl) {
         final Set<Class<?>> result = new LinkedHashSet<Class<?>>();
         for (String s : StringUtils.splitByWholeSeparatorPreserveAllTokens(types, ",")) {

Added: commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/package-info.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/package-info.java?rev=1557247&view=auto
==============================================================================
--- commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/package-info.java (added)
+++ commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/package-info.java Fri Jan 10 20:14:41 2014
@@ -0,0 +1,5 @@
+/**
+ * Implements the Normalizer weaver, whose purpose is to collapse identical
+ * anonymous class definitions into a single one.
+ */
+package org.apache.commons.weaver.normalizer;
\ No newline at end of file

Propchange: commons/proper/weaver/trunk/modules/normalizer/weaver/src/main/java/org/apache/commons/weaver/normalizer/package-info.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/Privileged.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/Privileged.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/Privileged.java (original)
+++ commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/Privileged.java Fri Jan 10 20:14:41 2014
@@ -24,7 +24,8 @@ import java.lang.annotation.RetentionPol
 import java.lang.annotation.Target;
 
 /**
- * Marks a method as needing to execute in a privileged fashion in secured environments.
+ * Marks a method as needing to execute in a privileged fashion in secured
+ * environments.
  */
 @Target(ElementType.METHOD)
 @Retention(RetentionPolicy.CLASS)

Modified: commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/Privilizing.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/Privilizing.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/Privilizing.java (original)
+++ commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/Privilizing.java Fri Jan 10 20:14:41 2014
@@ -28,11 +28,23 @@ import java.lang.annotation.Target;
  */
 @Target(ElementType.TYPE)
 public @interface Privilizing {
+    /**
+     * Models calls to blueprint methods defined on a specific class.
+     */
     public @interface CallTo {
+        /**
+         * The class owning one or more blueprint method.
+         */
         Class<?> value();
 
-        String[] methods() default {};
+        /**
+         * The names of the blueprint methods.
+         */
+        String[] methods() default { };
     }
 
+    /**
+     * List of blueprint calls.
+     */
     CallTo[] value();
 }

Added: commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/package-info.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/package-info.java?rev=1557247&view=auto
==============================================================================
--- commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/package-info.java (added)
+++ commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/package-info.java Fri Jan 10 20:14:41 2014
@@ -0,0 +1,4 @@
+/**
+ * Defines the annotations that drive the privilizer weaver.
+ */
+package org.apache.commons.weaver.privilizer;
\ No newline at end of file

Propchange: commons/proper/weaver/trunk/modules/privilizer/api/src/main/java/org/apache/commons/weaver/privilizer/package-info.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/AccessLevel.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/AccessLevel.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/AccessLevel.java (original)
+++ commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/AccessLevel.java Fri Jan 10 20:14:41 2014
@@ -26,8 +26,29 @@ import java.util.Set;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.Validate;
 
+/**
+ * Enumerates the Java access levels.
+ */
 public enum AccessLevel {
-    PUBLIC(Modifier.PUBLIC), PROTECTED(Modifier.PROTECTED), PACKAGE(0), PRIVATE(Modifier.PRIVATE);
+    /**
+     * {@code public}.
+     */
+    PUBLIC(Modifier.PUBLIC),
+
+    /**
+     * {@code protected}.
+     */
+    PROTECTED(Modifier.PROTECTED),
+
+    /**
+     * {@code ""}.
+     */
+    PACKAGE(0),
+
+    /**
+     * {@code private}.
+     */
+    PRIVATE(Modifier.PRIVATE);
 
     private final int flag;
 
@@ -35,6 +56,12 @@ public enum AccessLevel {
         this.flag = flag;
     }
 
+    /**
+     * Get the {@link AccessLevel} specified by a Java modifier.
+     * @param mod from which to extract
+     * @return {@link AccessLevel}
+     * @throws IllegalArgumentException if multiple access modifiers specified
+     */
     public static AccessLevel of(int mod) {
         final Set<AccessLevel> matched = EnumSet.noneOf(AccessLevel.class);
         if (Modifier.isPublic(mod)) {
@@ -53,6 +80,11 @@ public enum AccessLevel {
         return matched.iterator().next();
     }
 
+    /**
+     * Overlay this {@link AccessLevel} onto a Java modifier value.
+     * @param mod input
+     * @return {@code mod}, with this {@link AccessLevel}
+     */
     public int merge(int mod) {
         int remove = 0;
         for (AccessLevel accessLevel : EnumSet.complementOf(EnumSet.of(this))) {
@@ -61,6 +93,10 @@ public enum AccessLevel {
         return mod & ~remove | flag;
     }
 
+    /**
+     * Render this {@link AccessLevel} as a {@link String}.
+     * @return {@link String}
+     */
     @Override
     public String toString() {
         return name().toLowerCase(Locale.US);
@@ -68,7 +104,8 @@ public enum AccessLevel {
 
     /**
      * Get the {@link AccessLevel} value that should be used as a default.
-     * 
+     * This is <em>not</em> "default"/{@code package} access, but rather the default
+     * value that should be used for privilizer weaving.
      * @return {@link AccessLevel#PRIVATE}
      */
     public static AccessLevel defaultValue() {
@@ -77,8 +114,7 @@ public enum AccessLevel {
 
     /**
      * Parse from a {@link String} returning {@link #defaultValue()} for blank/null input.
-     * 
-     * @param s
+     * @param s to parse
      * @return {@link AccessLevel}
      */
     public static AccessLevel parse(String s) {

Modified: commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/ActionGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/ActionGenerator.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/ActionGenerator.java (original)
+++ commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/ActionGenerator.java Fri Jan 10 20:14:41 2014
@@ -54,6 +54,13 @@ class ActionGenerator extends Privilizer
     final Field[] fields;
     private final Type actionInterface;
 
+    /**
+     * Create a new {@link ActionGenerator}.
+     * @param access modifier
+     * @param m {@link Method} to implement
+     * @param exceptions thrown
+     * @param owner of the action class
+     */
     ActionGenerator(final int access, final Method m, final String[] exceptions, PrivilizingVisitor owner) {
         owner.privilizer().super(new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES));
         this.m = m;
@@ -155,13 +162,12 @@ class ActionGenerator extends Privilizer
         final String signature = type.toString();
 
         visit(Opcodes.V1_5, Opcodes.ACC_SUPER | Opcodes.ACC_SYNTHETIC | Opcodes.ACC_FINAL, action.getInternalName(),
-            signature, Type.getType(Object.class).getInternalName(), new String[] { actionInterface.getInternalName() });
+            signature, Type.getType(Object.class).getInternalName(),
+            new String[] { actionInterface.getInternalName() });
     }
 
     /**
      * Add fields and generate constructor.
-     * 
-     * @param cv
      */
     private void init() {
         for (Field field : fields) {
@@ -201,8 +207,6 @@ class ActionGenerator extends Privilizer
 
     /**
      * Generate impl method.
-     * 
-     * @param cv
      */
     private void impl() {
         final Method run = Method.getMethod("Object run()");

Modified: commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/BlueprintingVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/BlueprintingVisitor.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/BlueprintingVisitor.java (original)
+++ commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/BlueprintingVisitor.java Fri Jan 10 20:14:41 2014
@@ -49,6 +49,9 @@ import org.objectweb.asm.commons.Method;
 import org.objectweb.asm.tree.ClassNode;
 import org.objectweb.asm.tree.MethodNode;
 
+/**
+ * {@link ClassVisitor} to import so-called "blueprint methods".
+ */
 class BlueprintingVisitor extends Privilizer.PrivilizerClassVisitor {
 
     private final Set<Type> blueprintTypes = new HashSet<Type>();
@@ -61,6 +64,12 @@ class BlueprintingVisitor extends Privil
 
     private final ClassVisitor next;
 
+    /**
+     * Create a new {@link BlueprintingVisitor}.
+     * @param privilizer owner
+     * @param cv wrapped
+     * @param config annotation
+     */
     BlueprintingVisitor(Privilizer privilizer, ClassVisitor cv, Privilizing config) {
         privilizer.super(new ClassNode(Opcodes.ASM4));
         this.next = cv;
@@ -220,7 +229,8 @@ class BlueprintingVisitor extends Privil
                                     final Pair<Type, String> k = Pair.of(type, name);
                                     // skip shadowed fields:
                                     if (!fieldAccessMap.containsKey(k)) {
-                                        fieldAccessMap.put(k, new FieldAccess(access, target, name, Type.getType(desc)));
+                                        fieldAccessMap.put(k,
+                                            new FieldAccess(access, target, name, Type.getType(desc)));
                                     }
                                 }
                                 return null;
@@ -235,8 +245,6 @@ class BlueprintingVisitor extends Privil
                 }
             } catch (Exception e) {
                 throw new RuntimeException(e);
-            } finally {
-
             }
             Validate.isTrue(fieldAccessMap.containsKey(key), "Could not locate %s.%s", owner.getClassName(), name);
         }

Modified: commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Field.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Field.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Field.java (original)
+++ commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Field.java Fri Jan 10 20:14:41 2014
@@ -27,10 +27,27 @@ import org.objectweb.asm.Type;
  * Represents a Java field.
  */
 public class Field {
+    /**
+     * Access modifier.
+     */
     public final int access;
+
+    /**
+     * Field name.
+     */
     public final String name;
+
+    /**
+     * Field type.
+     */
     public final Type type;
 
+    /**
+     * Create a new {@link Field}.
+     * @param access modifier
+     * @param name of field
+     * @param type of field
+     */
     public Field(int access, String name, Type type) {
         super();
         this.access = access;
@@ -40,8 +57,7 @@ public class Field {
 
     /**
      * Considers name and type.
-     * 
-     * @param obj
+     * @param obj to check for equality
      * @return whether equal
      */
     @Override
@@ -49,7 +65,7 @@ public class Field {
         if (obj == this) {
             return true;
         }
-        if (obj instanceof Field == false) {
+        if (!(obj instanceof Field)) {
             return false;
         }
         final Field other = (Field) obj;
@@ -58,7 +74,6 @@ public class Field {
 
     /**
      * Considers name and type.
-     * 
      * @return hashCode
      */
     @Override

Modified: commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/FieldAccess.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/FieldAccess.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/FieldAccess.java (original)
+++ commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/FieldAccess.java Fri Jan 10 20:14:41 2014
@@ -20,25 +20,48 @@ package org.apache.commons.weaver.privil
 
 import org.objectweb.asm.Type;
 
+/**
+ * Models the action of accessing a field by extending {@link Field} with an
+ * accessing type.
+ */
 public class FieldAccess extends Field {
+    /**
+     * {@link Type} from which field is accessed.
+     */
     public final Type owner;
 
+    /**
+     * Create a new {@link FieldAccess}.
+     * @param access operation
+     * @param owner {@link Type} from which field is accessed.
+     * @param name of field
+     * @param type of field
+     */
     public FieldAccess(int access, Type owner, String name, Type type) {
         super(access, name, type);
         this.owner = owner;
     }
 
+    /**
+     * Compare against {@code obj} for equality.
+     * @param obj to compare
+     * @return whether Objects are equal
+     */
     @Override
     public boolean equals(Object obj) {
         if (obj == this) {
             return true;
         }
-        if (obj instanceof FieldAccess == false) {
+        if (!(obj instanceof FieldAccess)) {
             return false;
         }
         return super.equals(obj) && ((FieldAccess) obj).owner.equals(owner);
     }
 
+    /**
+     * Generate a hashCode.
+     * @return int
+     */
     @Override
     public int hashCode() {
         final int result = super.hashCode() << 4;

Modified: commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/InlineNestedPrivilegedCalls.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/InlineNestedPrivilegedCalls.java?rev=1557247&r1=1557246&r2=1557247&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/InlineNestedPrivilegedCalls.java (original)
+++ commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/InlineNestedPrivilegedCalls.java Fri Jan 10 20:14:41 2014
@@ -38,10 +38,16 @@ class InlineNestedPrivilegedCalls extend
     private final ClassVisitor next;
 
     /**
-     * Map of original method to name of internal implementation method
+     * Map of original method to name of internal implementation method.
      */
     private final Map<Method, String> privilegedMethods;
 
+    /**
+     * Create a new {@link InlineNestedPrivilegedCalls} object.
+     * @param privilizer owner
+     * @param privilegedMethods map of original method to name of internal implementation method
+     * @param next visitor
+     */
     InlineNestedPrivilegedCalls(Privilizer privilizer, Map<Method, String> privilegedMethods, ClassVisitor next) {
         super(Opcodes.ASM4);
         this.privilizer = privilizer;
@@ -62,15 +68,16 @@ class InlineNestedPrivilegedCalls extend
                 if (privilegedMethods.containsValue(name)) {
                     return new MethodVisitor(Opcodes.ASM4, orig) {
                         public void visitMethodInsn(int opcode, String owner, String name, String desc) {
+                            String useName = name;
                             if (owner.equals(InlineNestedPrivilegedCalls.this.name)) {
                                 final Method m = new Method(name, desc);
                                 if (privilegedMethods.containsKey(m)) {
-                                    name = privilegedMethods.get(m);
+                                    useName = privilegedMethods.get(m);
                                     privilizer.env.debug("Inlining call from %s to %s as %s", outer, m,
-                                        name);
+                                        useName);
                                 }
                             }
-                            super.visitMethodInsn(opcode, owner, name, desc);
+                            super.visitMethodInsn(opcode, owner, useName, desc);
                         }
                     };
                 }



Mime
View raw message