maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khmarba...@apache.org
Subject svn commit: r1631139 - in /maven/enforcer/trunk/enforcer-rules/src: main/java/org/apache/maven/plugins/enforcer/ test/java/org/apache/maven/plugins/enforcer/
Date Sun, 12 Oct 2014 00:20:37 GMT
Author: khmarbaise
Date: Sun Oct 12 00:20:36 2014
New Revision: 1631139

URL: http://svn.apache.org/r1631139
Log:
- Fixing checkstyle reported issues
  - making variables private and add appropriate get/set methods.

Modified:
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractStandardEnforcerRule.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java
    maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequirePrerequisiteTest.java

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractStandardEnforcerRule.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractStandardEnforcerRule.java?rev=1631139&r1=1631138&r2=1631139&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractStandardEnforcerRule.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractStandardEnforcerRule.java
Sun Oct 12 00:20:36 2014
@@ -29,14 +29,13 @@ public abstract class AbstractStandardEn
     implements EnforcerRule2
 {
 
-    /** Specify a friendly message if the rule fails.
+    /**
+     * Specify a friendly message if the rule fails.
      *
-     * @deprecated the visibility will be reduced to private with the next major version
      * @see {@link #setMessage(String)}
      * @see {@link #getMessage()}
-
      */
-    public String message = null;
+    private String message;
 
     private EnforcerLevel level = EnforcerLevel.ERROR;
 
@@ -55,7 +54,6 @@ public abstract class AbstractStandardEn
      *
      * @return level
      */
-    //@Override
     public EnforcerLevel getLevel()
     {
         return level;

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java?rev=1631139&r1=1631138&r2=1631139&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java
Sun Oct 12 00:20:36 2014
@@ -50,11 +50,10 @@ public abstract class AbstractVersionEnf
      * <li><code>(,2.0.5],[2.1.1,)</code> Versions up to 2.0.5 (included)
and 2.1.1 or higher</li>
      * </ul>
      * 
-     * @deprecated the visibility will be reduced to private with the next major version
      * @see {@link #setVersion(String)}
      * @see {@link #getVersion()}
      */
-    public String version = null;
+    private String version;
 
     /**
      * Compares the specified version to see if it is allowed by the defined version range.
@@ -201,7 +200,14 @@ public abstract class AbstractVersionEnf
     }
 
     /**
-     * Sets the required version.
+     * Specify the required version. Some examples are:
+     * <ul>
+     * <li><code>2.0.4</code> Version 2.0.4 and higher (different from
Maven meaning)</li>
+     * <li><code>[2.0,2.1)</code> Versions 2.0 (included) to 2.1 (not included)</li>
+     * <li><code>[2.0,2.1]</code> Versions 2.0 to 2.1 (both included)</li>
+     * <li><code>[2.0.5,)</code> Versions 2.0.5 and higher</li>
+     * <li><code>(,2.0.5],[2.1.1,)</code> Versions up to 2.0.5 (included)
and 2.1.1 or higher</li>
+     * </ul>
      *
      * @param theVersion the required version to set
      */

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java?rev=1631139&r1=1631138&r2=1631139&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java
Sun Oct 12 00:20:36 2014
@@ -47,9 +47,8 @@ public class BannedDependencies
      * 
      * @see {@link #setExcludes(List)}
      * @see {@link #getExcludes()}
-     * @deprecated the visibility will be reduced to private with the next major version
      */
-    public List<String> excludes = null;
+    private List<String> excludes = null;
 
     /**
      * Specify the allowed dependencies. This can be a list of artifacts in the format
@@ -60,9 +59,8 @@ public class BannedDependencies
      * 
      * @see {@link #setIncludes(List)}
      * @see {@link #getIncludes()}
-     * @deprecated the visibility will be reduced to private with the next major version
      */
-    public List<String> includes = null;
+    private List<String> includes = null;
 
     /**
      * {@inheritDoc}
@@ -165,8 +163,11 @@ public class BannedDependencies
     }
 
     /**
-     * Sets the excludes.
+     * Specify the banned dependencies. This can be a list of artifacts in the format
+     * <code>groupId[:artifactId][:version]</code>. Any of the sections can be
a wildcard by using '*' (ie group:*:1.0) <br>
+     * The rule will fail if any dependency matches any exclude, unless it also matches an
include rule.
      * 
+     * @see {@link #getExcludes()}
      * @param theExcludes the excludes to set
      */
     public void setExcludes( List<String> theExcludes )
@@ -185,8 +186,13 @@ public class BannedDependencies
     }
 
     /**
-     * Sets the includes.
+     * Specify the allowed dependencies. This can be a list of artifacts in the format
+     * <code>groupId[:artifactId][:version]</code>. Any of the sections can be
a wildcard by using '*' (ie group:*:1.0) <br>
+     * Includes override the exclude rules. It is meant to allow wide exclusion rules with
wildcards and still allow a
+     * smaller set of includes. <br>
+     * For example, to ban all xerces except xerces-api -> exclude "xerces", include "xerces:xerces-api"
      * 
+     * @see {@link #setIncludes(List)}
      * @param theIncludes the includes to set
      */
     public void setIncludes( List<String> theIncludes )

Modified: maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequirePrerequisiteTest.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequirePrerequisiteTest.java?rev=1631139&r1=1631138&r2=1631139&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequirePrerequisiteTest.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequirePrerequisiteTest.java
Sun Oct 12 00:20:36 2014
@@ -19,6 +19,10 @@ package org.apache.maven.plugins.enforce
  * under the License.
  */
 
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 import java.util.Collections;
 
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
@@ -30,10 +34,6 @@ import org.codehaus.plexus.component.con
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
 public class RequirePrerequisiteTest
 {
     private MavenProject project;



Mime
View raw message