commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1764366 - in /commons/proper/weaver/trunk: ant/src/main/java/org/apache/commons/weaver/ant/ maven-plugin/src/main/java/org/apache/commons/weaver/maven/ modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/ modules/priviliz...
Date Tue, 11 Oct 2016 23:59:38 GMT
Author: mbenson
Date: Tue Oct 11 23:59:38 2016
New Revision: 1764366

URL: http://svn.apache.org/viewvc?rev=1764366&view=rev
Log:
code quality

Modified:
    commons/proper/weaver/trunk/ant/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java
    commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractCWMojo.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/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java
    commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/Finder.java

Modified: commons/proper/weaver/trunk/ant/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/ant/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java?rev=1764366&r1=1764365&r2=1764366&view=diff
==============================================================================
--- commons/proper/weaver/trunk/ant/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java
(original)
+++ commons/proper/weaver/trunk/ant/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java
Tue Oct 11 23:59:38 2016
@@ -196,7 +196,7 @@ public class WeaverSettings extends Data
      * @since 1.3
      * @see Path#systemClasspath
      */
-    public void setIncludeSystemClasspath(boolean includeSystemClasspath) {
+    public void setIncludeSystemClasspath(final boolean includeSystemClasspath) {
         this.includeSystemClasspath = includeSystemClasspath;
     }
 

Modified: commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractCWMojo.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractCWMojo.java?rev=1764366&r1=1764365&r2=1764366&view=diff
==============================================================================
--- commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractCWMojo.java
(original)
+++ commons/proper/weaver/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/maven/AbstractCWMojo.java
Tue Oct 11 23:59:38 2016
@@ -51,6 +51,7 @@ import org.eclipse.aether.util.filter.Sc
 
 /**
  * Defines common properties and high-level management common to all commons-weaver Maven
goals.
+ * @since 1.3
  */
 abstract class AbstractCWMojo extends AbstractMojo {
     /**
@@ -84,14 +85,14 @@ abstract class AbstractCWMojo extends Ab
 
     /**
      * 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
@@ -126,7 +127,7 @@ abstract class AbstractCWMojo extends Ab
         collect.setRequestContext("project");
         collect.setRepositories(project.getRemoteProjectRepositories());
 
-        for (Dependency dependency : project.getDependencies()) {
+        for (final Dependency dependency : project.getDependencies()) {
             // guard against case where best-effort resolution for invalid models is requested:
             if (StringUtils.isAnyBlank(dependency.getGroupId(), dependency.getArtifactId(),
dependency.getVersion())) {
                 continue;
@@ -139,7 +140,7 @@ abstract class AbstractCWMojo extends Ab
                 .setFilter(new ScopeDependencyFilter(getExcludeScopes())).setCollectRequest(collect));
 
         final Set<String> result = new LinkedHashSet<String>();
-        for (ArtifactResult artifactResult : dependencyResult.getArtifactResults()) {
+        for (final ArtifactResult artifactResult : dependencyResult.getArtifactResults())
{
             result.add(artifactResult.getArtifact().getFile().getAbsolutePath());
         }
         return new ArrayList<String>(result);

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=1764366&r1=1764365&r2=1764366&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
Tue Oct 11 23:59:38 2016
@@ -31,7 +31,8 @@ import org.apache.maven.plugin.MojoExecu
 public abstract class AbstractPrepareMojo extends AbstractCWMojo {
 
     @Override
-    protected void doExecute(File target, List<String> classpath, Properties config)
throws MojoExecutionException {
+    protected void doExecute(final File target, final List<String> classpath, final
Properties config)
+        throws MojoExecutionException {
         if (!target.isDirectory()) {
             return;
         }

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=1764366&r1=1764365&r2=1764366&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
Tue Oct 11 23:59:38 2016
@@ -31,7 +31,8 @@ import org.apache.maven.plugin.MojoExecu
 public abstract class AbstractWeaveMojo extends AbstractCWMojo {
 
     @Override
-    protected void doExecute(File target, List<String> classpath, Properties config)
throws MojoExecutionException {
+    protected void doExecute(final File target, final List<String> classpath, final
Properties config)
+        throws MojoExecutionException {
         try {
             final WeaveProcessor weaveProcessor = new WeaveProcessor(classpath, target, config);
             weaveProcessor.weave();

Modified: commons/proper/weaver/trunk/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java?rev=1764366&r1=1764365&r2=1764366&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java
(original)
+++ commons/proper/weaver/trunk/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java
Tue Oct 11 23:59:38 2016
@@ -221,7 +221,7 @@ public class Normalizer {
         }
     }
 
-    private final class CustomClassWriter extends ClassWriter {
+    private static final class CustomClassWriter extends ClassWriter {
         CustomClassWriter(final int flags) {
             super(flags);
         }

Modified: commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java?rev=1764366&r1=1764365&r2=1764366&view=diff
==============================================================================
--- commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java
(original)
+++ commons/proper/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java
Tue Oct 11 23:59:38 2016
@@ -74,7 +74,7 @@ public class Privilizer {
         }
     }
 
-    private final class CustomClassWriter extends ClassWriter {
+    private static final class CustomClassWriter extends ClassWriter {
         CustomClassWriter(final int flags) {
             super(flags);
         }

Modified: commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/Finder.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/Finder.java?rev=1764366&r1=1764365&r2=1764366&view=diff
==============================================================================
--- commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/Finder.java
(original)
+++ commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/Finder.java
Tue Oct 11 23:59:38 2016
@@ -409,21 +409,22 @@ class Finder extends AnnotationFinder im
             CollectionUtils.filter(annotatedClasses, new Predicate<Annotated<Class<?>>>()
{
 
                 @Override
-                public boolean evaluate(Annotated<Class<?>> annotatedClass) {
+                public boolean evaluate(final Annotated<Class<?>> annotatedClass)
{
                     return annotatedClass.isAnnotationPresent(annotation);
                 }
             });
             return annotatedClasses;
         }
 
-        private List<Annotated<Class<?>>> annotate(Collection<? extends
Info> infos) {
+        private List<Annotated<Class<?>>> annotate(final Collection<?
extends Info> infos) {
             final List<Annotated<Class<?>>> result = new ArrayList<Annotated<Class<?>>>();
             for (final Info info : infos) {
                 if (info instanceof ClassInfo) {
                     final ClassInfo classInfo = (ClassInfo) info;
 
                     try {
-                        result.add(new IncludesClassfile<Class<?>>(classInfo.get(),
classfileAnnotationsFor(classInfo)));
+                        result
+                            .add(new IncludesClassfile<Class<?>>(classInfo.get(),
classfileAnnotationsFor(classInfo)));
                     } catch (final ClassNotFoundException e) {
                         continue;
                     }
@@ -712,21 +713,24 @@ class Finder extends AnnotationFinder im
                     }
                     break;
                 case FIELD:
-                    for (final Annotated<Field> fld : this.withAnnotations().findAnnotatedFields(interest.annotationType))
{
-                        result.getWeavable(fld.get()).addAnnotations(fld.getAnnotations());
-                    }
-                    break;
+                        for (final Annotated<Field> fld : this.withAnnotations()
+                            .findAnnotatedFields(interest.annotationType)) {
+                            result.getWeavable(fld.get()).addAnnotations(fld.getAnnotations());
+                        }
+                        break;
                 case PARAMETER:
                     for (final Annotated<Parameter<Method>> parameter : this.withAnnotations()
                         .findAnnotatedMethodParameters(interest.annotationType)) {
-                        result.getWeavable(parameter.get().getDeclaringExecutable())
-                            .getWeavableParameter(parameter.get().getIndex()).addAnnotations(parameter.getAnnotations());
-                    }
+                            result.getWeavable(parameter.get().getDeclaringExecutable())
+                                .getWeavableParameter(parameter.get().getIndex())
+                                .addAnnotations(parameter.getAnnotations());
+                        }
                     for (final Annotated<Parameter<Constructor<?>>> parameter
: this.withAnnotations()
                         .findAnnotatedConstructorParameters(interest.annotationType)) {
-                        result.getWeavable(parameter.get().getDeclaringExecutable())
-                            .getWeavableParameter(parameter.get().getIndex()).addAnnotations(parameter.getAnnotations());
-                    }
+                            result.getWeavable(parameter.get().getDeclaringExecutable())
+                                .getWeavableParameter(parameter.get().getIndex())
+                                .addAnnotations(parameter.getAnnotations());
+                        }
                     break;
                 default:
                     // should we log something?



Mime
View raw message