maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khmarba...@apache.org
Subject svn commit: r1631135 - in /maven/enforcer/trunk/enforcer-rules/src: main/java/org/apache/maven/plugins/enforcer/ test/java/org/apache/maven/plugins/enforcer/
Date Sat, 11 Oct 2014 23:27:07 GMT
Author: khmarbaise
Date: Sat Oct 11 23:27:06 2014
New Revision: 1631135

URL: http://svn.apache.org/r1631135
Log:
- Improved code style to reduce number of checkstyle warnings.
- Reduced the visibility of variables and added appropriate
  set/get methods in RequireFilesSize


Modified:
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java
    maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesSize.java

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java?rev=1631135&r1=1631134&r2=1631135&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java
Sat Oct 11 23:27:06 2014
@@ -36,7 +36,6 @@ public abstract class AbstractPropertyEn
     /**
      * Match the property value to a given regular expression. Defaults to <code>null</code>
(any value is ok).
      * 
-     * @deprecated the visibility will be reduced to private with the next major version
      * @see {@link #setRegex(String)}
      * @see {@link #getRegex()}
      */
@@ -45,7 +44,6 @@ public abstract class AbstractPropertyEn
     /**
      * Specify a warning message if the regular expression is not matched.
      * 
-     * @deprecated the visibility will be reduced to private with the next major version
      * @see {@link #setRegexMessage(String)}
      * @see {@link #getRegexMessage()}
      */

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java?rev=1631135&r1=1631134&r2=1631135&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java
Sat Oct 11 23:27:06 2014
@@ -161,8 +161,11 @@ public class BanDuplicatePomDependencyVe
         if ( summary.length() > 0 )
         {
             StringBuilder message = new StringBuilder();
-            message.append( "Found " ).append( duplicates ).append( " duplicate dependency
" );
-            message.append( duplicateDependencies.size() == 1 ? "declaration" : "declarations"
).append( " in this project:\n" );
+            message.append( "Found " )
+                .append( duplicates )
+                .append( " duplicate dependency " );
+            message.append( duplicateDependencies.size() == 1 ? "declaration" : "declarations"
)
+                .append( " in this project:\n" );
             message.append( summary );
             throw new EnforcerRuleException( message.toString() );
         }
@@ -174,7 +177,13 @@ public class BanDuplicatePomDependencyVe
         {
             for ( Map.Entry<String, Integer> entry : duplicateDependencies.entrySet()
)
             {
-                message.append( " - " ).append( prefix ).append( '[' ).append( entry.getKey()
).append( "] ( " ).append( entry.getValue() ).append( " times )\n" );
+                message.append( " - " )
+                    .append( prefix )
+                    .append( '[' )
+                    .append( entry.getKey() )
+                    .append( "] ( " )
+                    .append( entry.getValue() )
+                    .append( " times )\n" );
             }
         }
     }

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java?rev=1631135&r1=1631134&r2=1631135&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java
Sat Oct 11 23:27:06 2014
@@ -39,10 +39,10 @@ public class RequireFilesSize
 {
 
     /** the max size allowed. */
-    long maxsize = 10000;
+    private long maxsize = 10000;
 
     /** the min size allowed. */
-    long minsize = 0;
+    private long minsize = 0;
 
     /** The error msg. */
     private String errorMsg;
@@ -52,8 +52,8 @@ public class RequireFilesSize
 
     /*
      * (non-Javadoc)
-     *
-     * @see org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper)
+     * @see
+     * org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper)
      */
     public void execute( EnforcerRuleHelper helper )
         throws EnforcerRuleException
@@ -85,7 +85,6 @@ public class RequireFilesSize
 
     /*
      * (non-Javadoc)
-     *
      * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isCacheable()
      */
     public boolean isCacheable()
@@ -95,22 +94,23 @@ public class RequireFilesSize
 
     /*
      * (non-Javadoc)
-     *
-     * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule)
+     * @see
+     * org.apache.maven.enforcer.rule.api.EnforcerRule#isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule)
      */
     public boolean isResultValid( EnforcerRule cachedRule )
     {
         return false;
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
      * @see org.apache.maven.plugins.enforcer.AbstractRequireFiles#checkFile(java.io.File)
      */
     boolean checkFile( File file )
     {
         if ( file == null )
         {
-            //if we get here and it's null, treat it as a success.
+            // if we get here and it's null, treat it as a success.
             return true;
         }
 
@@ -148,11 +148,32 @@ public class RequireFilesSize
         }
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
      * @see org.apache.maven.plugins.enforcer.AbstractRequireFiles#getErrorMsg()
      */
     String getErrorMsg()
     {
         return this.errorMsg;
     }
+
+    public long getMaxsize()
+    {
+        return maxsize;
+    }
+
+    public void setMaxsize( long maxsize )
+    {
+        this.maxsize = maxsize;
+    }
+
+    public long getMinsize()
+    {
+        return minsize;
+    }
+
+    public void setMinsize( long minsize )
+    {
+        this.minsize = minsize;
+    }
 }

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java?rev=1631135&r1=1631134&r2=1631135&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java
Sat Oct 11 23:27:06 2014
@@ -571,9 +571,11 @@ public class RequirePluginVersions
         }
         catch ( ArtifactResolutionException e )
         {
+            //What does this mean?
         }
         catch ( ArtifactNotFoundException e )
         {
+            //What does this mean?
         }
 
         return plugin;

Modified: maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesSize.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesSize.java?rev=1631135&r1=1631134&r2=1631135&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesSize.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesSize.java
Sat Oct 11 23:27:06 2014
@@ -97,12 +97,12 @@ public class TestRequireFilesSize
         Artifact a = factory.getReleaseArtifact();
         a.setFile( f );
 
-        project.setArtifact(a);
+        project.setArtifact( a );
 
         // sanity check the mockProject
         assertSame( f, project.getArtifact().getFile() );
 
-        rule.execute( EnforcerTestUtils.getHelper(project) );
+        rule.execute( EnforcerTestUtils.getHelper( project ) );
 
     }
 
@@ -131,7 +131,7 @@ public class TestRequireFilesSize
         File f = File.createTempFile( "enforcer", "tmp" );
         f.deleteOnExit();
         rule.files = new File[] { f };
-        rule.minsize = 10;
+        rule.setMinsize( 10 );
         try
         {
             rule.execute( EnforcerTestUtils.getHelper() );
@@ -164,7 +164,7 @@ public class TestRequireFilesSize
         }
 
         rule.files = new File[] { f };
-        rule.maxsize = 10;
+        rule.setMaxsize( 10 );
         assertTrue( f.length() > 10 );
         try
         {



Mime
View raw message