maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khmarba...@apache.org
Subject svn commit: r1631136 - 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:38:10 GMT
Author: khmarbaise
Date: Sat Oct 11 23:38:10 2014
New Revision: 1631136

URL: http://svn.apache.org/r1631136
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/AbstractRequireFiles.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java
    maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesDontExist.java
    maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesExist.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/AbstractRequireFiles.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireFiles.java?rev=1631136&r1=1631135&r2=1631136&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireFiles.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireFiles.java
Sat Oct 11 23:38:10 2014
@@ -37,10 +37,10 @@ public abstract class AbstractRequireFil
 {
 
     /** Array of files to check. */
-    File[] files;
+    private File[] files;
 
     /** if null file handles should be allowed. If they are allowed, it means treat it as
a success. */
-    boolean allowNulls = false;
+    private boolean allowNulls = false;
 
     // check the file for the specific condition
     /**
@@ -174,4 +174,24 @@ public abstract class AbstractRequireFil
     {
         return true;
     }
+
+    public File[] getFiles()
+    {
+        return files;
+    }
+
+    public void setFiles( File[] files )
+    {
+        this.files = files;
+    }
+
+    public boolean isAllowNulls()
+    {
+        return allowNulls;
+    }
+
+    public void setAllowNulls( boolean allowNulls )
+    {
+        this.allowNulls = allowNulls;
+    }
 }

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=1631136&r1=1631135&r2=1631136&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:38:10 2014
@@ -61,13 +61,13 @@ public class RequireFilesSize
         this.log = helper.getLog();
 
         // if the file is already defined, use that. Otherwise get the main artifact.
-        if ( files.length == 0 )
+        if ( getFiles().length == 0 )
         {
             try
             {
                 MavenProject project = (MavenProject) helper.evaluate( "${project}" );
-                files = new File[1];
-                files[0] = project.getArtifact().getFile();
+                setFiles( new File[1]);
+                getFiles()[0] = project.getArtifact().getFile();
 
                 super.execute( helper );
             }

Modified: maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesDontExist.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesDontExist.java?rev=1631136&r1=1631135&r2=1631136&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesDontExist.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesDontExist.java
Sat Oct 11 23:38:10 2014
@@ -42,7 +42,7 @@ public class TestRequireFilesDontExist
         File f = File.createTempFile( "enforcer", "tmp" );
         f.deleteOnExit();
 
-        rule.files = new File[] { f };
+        rule.setFiles( new File[] { f } );
 
         try
         {
@@ -59,7 +59,7 @@ public class TestRequireFilesDontExist
     public void testEmptyFile()
         throws EnforcerRuleException, IOException
     {
-        rule.files = new File[] { null };
+        rule.setFiles( new File[] { null } );
         try
         {
             rule.execute( EnforcerTestUtils.getHelper() );
@@ -74,8 +74,8 @@ public class TestRequireFilesDontExist
     public void testEmptyFileAllowNull()
         throws EnforcerRuleException, IOException
     {
-        rule.files = new File[] { null };
-        rule.allowNulls = true;
+        rule.setFiles( new File[] { null } );
+        rule.setAllowNulls( true );
         try
         {
             rule.execute( EnforcerTestUtils.getHelper() );
@@ -89,8 +89,8 @@ public class TestRequireFilesDontExist
     public void testEmptyFileList()
         throws EnforcerRuleException, IOException
     {
-        rule.files = new File[] {};
-        assertEquals( 0, rule.files.length );
+        rule.setFiles( new File[] {} );
+        assertEquals( 0, rule.getFiles().length );
         try
         {
             rule.execute( EnforcerTestUtils.getHelper() );
@@ -105,9 +105,9 @@ public class TestRequireFilesDontExist
     public void testEmptyFileListAllowNull()
         throws EnforcerRuleException, IOException
     {
-        rule.files = new File[] {};
-        assertEquals( 0, rule.files.length );
-        rule.allowNulls = true;
+        rule.setFiles( new File[] {} );
+        assertEquals( 0, rule.getFiles().length );
+        rule.setAllowNulls( true );
         try
         {
             rule.execute( EnforcerTestUtils.getHelper() );
@@ -126,7 +126,7 @@ public class TestRequireFilesDontExist
 
         assertTrue( !f.exists() );
 
-        rule.files = new File[] { f };
+        rule.setFiles( new File[] { f } );
 
         rule.execute( EnforcerTestUtils.getHelper() );
     }

Modified: maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesExist.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesExist.java?rev=1631136&r1=1631135&r2=1631136&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesExist.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesExist.java
Sat Oct 11 23:38:10 2014
@@ -42,7 +42,7 @@ public class TestRequireFilesExist
         File f = File.createTempFile( "enforcer", "tmp" );
         f.deleteOnExit();
 
-        rule.files = new File[] { f };
+        rule.setFiles( new File[] { f } );
 
         rule.execute( EnforcerTestUtils.getHelper() );
 
@@ -52,7 +52,7 @@ public class TestRequireFilesExist
     public void testEmptyFile()
         throws EnforcerRuleException, IOException
     {
-        rule.files = new File[] { null };
+        rule.setFiles( new File[] { null } );
         try
         {
             rule.execute( EnforcerTestUtils.getHelper() );
@@ -67,8 +67,8 @@ public class TestRequireFilesExist
     public void testEmptyFileAllowNull()
         throws EnforcerRuleException, IOException
     {
-        rule.files = new File[] { null };
-        rule.allowNulls = true;
+        rule.setFiles( new File[] { null } );
+        rule.setAllowNulls( true );
         try
         {
             rule.execute( EnforcerTestUtils.getHelper() );
@@ -82,8 +82,8 @@ public class TestRequireFilesExist
     public void testEmptyFileList()
         throws EnforcerRuleException, IOException
     {
-        rule.files = new File[] {};
-        assertEquals(0,rule.files.length);
+        rule.setFiles( new File[] {} );
+        assertEquals( 0, rule.getFiles().length );
         try
         {
             rule.execute( EnforcerTestUtils.getHelper() );
@@ -98,9 +98,9 @@ public class TestRequireFilesExist
     public void testEmptyFileListAllowNull()
         throws EnforcerRuleException, IOException
     {
-        rule.files = new File[] {};
-        assertEquals(0,rule.files.length);
-        rule.allowNulls = true;
+        rule.setFiles( new File[] {} );
+        assertEquals( 0, rule.getFiles().length );
+        rule.setAllowNulls( true );
         try
         {
             rule.execute( EnforcerTestUtils.getHelper() );
@@ -116,8 +116,8 @@ public class TestRequireFilesExist
     {
         File f = File.createTempFile( "enforcer", "tmp" );
         f.delete();
-        assertTrue(!f.exists());
-        rule.files = new File[] { f };
+        assertTrue( !f.exists() );
+        rule.setFiles( new File[] { f } );
 
         try
         {

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=1631136&r1=1631135&r2=1631136&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:38:10 2014
@@ -46,7 +46,7 @@ public class TestRequireFilesSize
         File f = File.createTempFile( "enforcer", "tmp" );
         f.deleteOnExit();
 
-        rule.files = new File[] { f };
+        rule.setFiles( new File[] { f } );
 
         rule.execute( EnforcerTestUtils.getHelper() );
 
@@ -56,7 +56,7 @@ public class TestRequireFilesSize
     public void testEmptyFile()
         throws EnforcerRuleException, IOException
     {
-        rule.files = new File[] { null };
+        rule.setFiles( new File[] { null } );
         try
         {
             rule.execute( EnforcerTestUtils.getHelper() );
@@ -71,8 +71,8 @@ public class TestRequireFilesSize
     public void testEmptyFileAllowNull()
         throws EnforcerRuleException, IOException
     {
-        rule.files = new File[] { null };
-        rule.allowNulls = true;
+        rule.setFiles( new File[] { null } );
+        rule.setAllowNulls( true );
         try
         {
             rule.execute( EnforcerTestUtils.getHelper() );
@@ -86,9 +86,9 @@ public class TestRequireFilesSize
     public void testEmptyFileList()
         throws EnforcerRuleException, IOException
     {
-        rule.files = new File[] {};
+        rule.setFiles( new File[] {} );
 
-        assertEquals( 0, rule.files.length );
+        assertEquals( 0, rule.getFiles().length );
 
         MockProject project = new MockProject();
         File f = File.createTempFile( "enforcer", "tmp" );
@@ -112,7 +112,7 @@ public class TestRequireFilesSize
         File f = File.createTempFile( "enforcer", "tmp" );
         f.delete();
         assertTrue( !f.exists() );
-        rule.files = new File[] { f };
+        rule.setFiles( new File[] { f } );
 
         try
         {
@@ -130,7 +130,7 @@ public class TestRequireFilesSize
     {
         File f = File.createTempFile( "enforcer", "tmp" );
         f.deleteOnExit();
-        rule.files = new File[] { f };
+        rule.setFiles( new File[] { f } );
         rule.setMinsize( 10 );
         try
         {
@@ -163,7 +163,7 @@ public class TestRequireFilesSize
             System.err.println( "Error: " + e.getMessage() );
         }
 
-        rule.files = new File[] { f };
+        rule.setFiles( new File[] { f } );
         rule.setMaxsize( 10 );
         assertTrue( f.length() > 10 );
         try



Mime
View raw message