maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1626497 - in /maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer: ./ utils/
Date Sat, 20 Sep 2014 21:03:05 GMT
Author: hboutemy
Date: Sat Sep 20 21:03:05 2014
New Revision: 1626497

URL: http://svn.apache.org/r1626497
Log:
fixed code style

Modified:
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java
    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/DependencyConvergence.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java?rev=1626497&r1=1626496&r2=1626497&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java
Sat Sep 20 21:03:05 2014
@@ -123,7 +123,7 @@ public abstract class AbstractBanDepende
         try
         {
             DependencyNode node = graphBuilder.buildDependencyGraph( project, null );
-            if( searchTransitive )
+            if ( searchTransitive )
             {
                 dependencies  = getAllDescendants( node );
             }
@@ -147,14 +147,14 @@ public abstract class AbstractBanDepende
     private Set<Artifact> getAllDescendants( DependencyNode node )
     {
         Set<Artifact> children = null; 
-        if( node.getChildren() != null )
+        if ( node.getChildren() != null )
         {
             children = new HashSet<Artifact>();
-            for( DependencyNode depNode : node.getChildren() )
+            for ( DependencyNode depNode : node.getChildren() )
             {
                 children.add( depNode.getArtifact() );
                 Set<Artifact> subNodes = getAllDescendants( depNode );
-                if( subNodes != null )
+                if ( subNodes != null )
                 {
                     children.addAll( subNodes );
                 }

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=1626497&r1=1626496&r2=1626497&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 Sep 20 21:03:05 2014
@@ -149,4 +149,4 @@ public abstract class AbstractPropertyEn
     public abstract Object resolveValue( EnforcerRuleHelper helper )
         throws EnforcerRuleException;
 
-}
\ No newline at end of file
+}

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=1626497&r1=1626496&r2=1626497&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 Sep 20 21:03:05 2014
@@ -118,7 +118,6 @@ public class BanDuplicatePomDependencyVe
     private void maven2Validation( EnforcerRuleHelper helper, Model model )
         throws EnforcerRuleException
     {
-        @SuppressWarnings( "unchecked" )
         List<Dependency> dependencies = model.getDependencies();
         Map<String, Integer> duplicateDependencies = validateDependencies( dependencies
);
 
@@ -129,7 +128,6 @@ public class BanDuplicatePomDependencyVe
 
         if ( model.getDependencyManagement() != null )
         {
-            @SuppressWarnings( "unchecked" )
             List<Dependency> managementDependencies = model.getDependencies();
             Map<String, Integer> duplicateManagementDependencies = validateDependencies(
managementDependencies );
             duplicates += duplicateManagementDependencies.size();
@@ -137,12 +135,9 @@ public class BanDuplicatePomDependencyVe
             messageBuilder( duplicateManagementDependencies, "dependencyManagement.dependencies.dependency",
summary );
         }
         
-        
-        @SuppressWarnings( "unchecked" )
         List<Profile> profiles = model.getProfiles();
         for ( Profile profile : profiles )
         {
-            @SuppressWarnings( "unchecked" )
             List<Dependency> profileDependencies = profile.getDependencies();
 
             Map<String, Integer> duplicateProfileDependencies = validateDependencies(
profileDependencies );
@@ -154,7 +149,6 @@ public class BanDuplicatePomDependencyVe
 
             if ( model.getDependencyManagement() != null )
             {
-                @SuppressWarnings( "unchecked" )
                 List<Dependency> profileManagementDependencies = profile.getDependencies();
                 
                 Map<String, Integer> duplicateProfileManagementDependencies =

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java?rev=1626497&r1=1626496&r2=1626497&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java
Sat Sep 20 21:03:05 2014
@@ -229,4 +229,4 @@ public class DependencyConvergence
     {
         return false;
     }
-}
\ No newline at end of file
+}

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java?rev=1626497&r1=1626496&r2=1626497&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java
Sat Sep 20 21:03:05 2014
@@ -19,8 +19,6 @@ package org.apache.maven.plugins.enforce
  * under the License.
  */
 
-import java.util.List;
-
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
 import org.apache.maven.plugin.logging.Log;

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java?rev=1626497&r1=1626496&r2=1626497&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java
Sat Sep 20 21:03:05 2014
@@ -100,7 +100,7 @@ public class RequireActiveProfile
                 boolean fail = false;
                 if ( !missingProfiles.isEmpty() )
                 {
-                    if (all || missingProfiles.size() == profs.length )
+                    if ( all || missingProfiles.size() == profs.length )
                     {
                       fail = true;
                     }

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java?rev=1626497&r1=1626496&r2=1626497&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java
Sat Sep 20 21:03:05 2014
@@ -150,7 +150,6 @@ public class RequireNoRepositories
             {
                 if ( banRepositories )
                 {
-                    @SuppressWarnings( "unchecked" )
                     List<Repository> repos = model.getRepositories();
                     if ( repos != null && !repos.isEmpty() )
                     {
@@ -167,7 +166,6 @@ public class RequireNoRepositories
                 }
                 if ( banPluginRepositories )
                 {
-                    @SuppressWarnings( "unchecked" )
                     List<Repository> repos = model.getPluginRepositories();
                     if ( repos != null && !repos.isEmpty() )
                     {
@@ -227,7 +225,8 @@ public class RequireNoRepositories
      * @param allowSnapshots 
      * @return
      */
-    private static List<String> findBannedRepositories( List<Repository> repos,
List<String> allowedRepos, boolean allowSnapshots )
+    private static List<String> findBannedRepositories( List<Repository> repos,
List<String> allowedRepos,
+                                                        boolean allowSnapshots )
     {
         List<String> bannedRepos = new ArrayList<String>( allowedRepos.size()
);
         for ( Repository r : repos )

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java?rev=1626497&r1=1626496&r2=1626497&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java
Sat Sep 20 21:03:05 2014
@@ -141,7 +141,7 @@ public class RequireOS
         else
         {
             StringBuilder buffer = new StringBuilder( 50 );
-            Iterator iter = Os.getValidFamilies().iterator();
+            Iterator<?> iter = Os.getValidFamilies().iterator();
             while ( iter.hasNext() )
             {
                 buffer.append( iter.next() );

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=1626497&r1=1626496&r2=1626497&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 Sep 20 21:03:05 2014
@@ -502,7 +502,6 @@ public class RequirePluginVersions
                 BuildBase b = p.getBuild();
                 if ( b != null )
                 {
-                    @SuppressWarnings( "unchecked" )
                     List<Plugin> plugins = b.getPlugins();
                     if ( plugins != null )
                     {
@@ -1108,7 +1107,6 @@ public class RequirePluginVersions
             }
 
             // Add plugins in profiles
-            @SuppressWarnings( "unchecked" )
             List<Profile> profiles = model.getProfiles();
             for ( Profile profile : profiles )
             {

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java?rev=1626497&r1=1626496&r2=1626497&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java
Sat Sep 20 21:03:05 2014
@@ -95,17 +95,17 @@ public class RequirePrerequisite extends
             
             Prerequisites prerequisites = project.getPrerequisites(); 
             
-            if( prerequisites == null )
+            if ( prerequisites == null )
             {
                 throw new EnforcerRuleException( "Requires prerequisite not set" );
             }
 
-            if( mavenVersion != null )
+            if ( mavenVersion != null )
             {
                 
                 VersionRange requiredVersionRange = VersionRange.createFromVersionSpec( mavenVersion
);
-                
-                if( !requiredVersionRange.hasRestrictions() )
+
+                if ( !requiredVersionRange.hasRestrictions() )
                 {
                     requiredVersionRange = VersionRange.createFromVersionSpec( "[" + mavenVersion
+ ",)" );
                 }
@@ -116,7 +116,8 @@ public class RequirePrerequisite extends
                 
                 if ( restrictedVersionRange.getRecommendedVersion() == null )
                 {
-                    throw new EnforcerRuleException( "The specified Maven prerequisite( "
+ specifiedVersion + " ) doesn't match the required version: " + mavenVersion );
+                    throw new EnforcerRuleException( "The specified Maven prerequisite( "
+ specifiedVersion
+                        + " ) doesn't match the required version: " + mavenVersion );
                 }
             }
         }

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java?rev=1626497&r1=1626496&r2=1626497&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java
Sat Sep 20 21:03:05 2014
@@ -19,8 +19,6 @@ package org.apache.maven.plugins.enforce
  * under the License.
  */
 
-import java.util.List;
-
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
 import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java?rev=1626497&r1=1626496&r2=1626497&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java
Sat Sep 20 21:03:05 2014
@@ -123,14 +123,7 @@ public final class ArtifactMatcher
                         return false;
                     }
                 case 1:
-                    if ( !matches( parts[0], artifact.getGroupId() ) )
-                    {
-                        return false;
-                    }
-                    else
-                    {
-                        return true;
-                    }
+                    return matches( parts[0], artifact.getGroupId() );
                 default:
                     throw new AssertionError();
             }
@@ -138,10 +131,12 @@ public final class ArtifactMatcher
 
         private boolean matches( String expression, String input )
         {
-            String regex = expression.replace( ".", "\\." ).replace( "*", ".*" ).replace(
":", "\\:" ).replace( '?', '.' );
+            String regex =
+                expression.replace( ".", "\\." ).replace( "*", ".*" ).replace( ":", "\\:"
).replace( '?', '.' );
 
             //TODO: Check if this can be done better or prevented earlier.
-            if (input == null) {
+            if ( input == null )
+            {
                 input = "";
             }
 

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java?rev=1626497&r1=1626496&r2=1626497&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java
(original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java
Sat Sep 20 21:03:05 2014
@@ -18,13 +18,13 @@ package org.apache.maven.plugins.enforce
  * specific language governing permissions and limitations
  * under the License.
  */
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.shared.dependency.tree.DependencyNode;
 import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor;



Mime
View raw message