You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2008/09/14 13:09:20 UTC

svn commit: r695189 - in /maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources: CopyResourcesMojo.java PropertyUtils.java ReflectionProperties.java Resource.java ResourcesMojo.java

Author: bentmann
Date: Sun Sep 14 04:09:20 2008
New Revision: 695189

URL: http://svn.apache.org/viewvc?rev=695189&view=rev
Log:
o Fixed Checkstyle errors

Modified:
    maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/CopyResourcesMojo.java
    maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/PropertyUtils.java
    maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ReflectionProperties.java
    maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/Resource.java
    maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java

Modified: maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/CopyResourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/CopyResourcesMojo.java?rev=695189&r1=695188&r2=695189&view=diff
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/CopyResourcesMojo.java (original)
+++ maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/CopyResourcesMojo.java Sun Sep 14 04:09:20 2008
@@ -1,8 +1,5 @@
 package org.apache.maven.plugin.resources;
 
-import java.io.File;
-import java.util.List;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -12,7 +9,7 @@
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
@@ -22,6 +19,9 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.List;
+
 /**
  * Copy resources of the configured plugin attribute resources
  * 

Modified: maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/PropertyUtils.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/PropertyUtils.java?rev=695189&r1=695188&r2=695189&view=diff
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/PropertyUtils.java (original)
+++ maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/PropertyUtils.java Sun Sep 14 04:09:20 2008
@@ -28,7 +28,6 @@
 import java.util.Iterator;
 import java.util.Properties;
 
-
 /**
  * @deprecated use classes in the component maven-filtering
  * TODO remove the class ?
@@ -46,8 +45,8 @@
     /**
      * Reads a property file, resolving all internal variables, using the supplied base properties.
      * <p>
-     * The properties are resolved iteratively, so if the value of property A refers to property B, then after resolution
-     * the value of property B will contain the value of property B.
+     * The properties are resolved iteratively, so if the value of property A refers to property B, then after
+     * resolution the value of property B will contain the value of property B.
      * </p>
      *
      * @param propFile The property file to load.
@@ -111,32 +110,32 @@
 
         final Properties baseProps = new Properties();
 
-        if (useSystemProps)
+        if ( useSystemProps )
         {
-            baseProps.putAll(System.getProperties());
+            baseProps.putAll( System.getProperties() );
         }
 
         final Properties resolvedProps = new Properties();
         try
         {
-            resolvedProps.putAll(loadPropertyFile(propfile, baseProps));
-        } catch (FileNotFoundException e)
+            resolvedProps.putAll( loadPropertyFile( propfile, baseProps ) );
+        }
+        catch ( FileNotFoundException e )
         {
-            if (fail)
+            if ( fail )
             {
-                throw new FileNotFoundException(propfile.toString());
+                throw new FileNotFoundException( propfile.toString() );
             }
         }
 
-        if (useSystemProps)
+        if ( useSystemProps )
         {
-            resolvedProps.putAll(baseProps);
+            resolvedProps.putAll( baseProps );
         }
 
         return resolvedProps;
     }
 
-
     /**
      * Retrieves a property value, replacing values like ${token}
      * using the Properties to look them up.
@@ -166,7 +165,8 @@
             v = v.substring( idx + 2 );
 
             // if no matching } then bail
-            if ( ( idx2 = v.indexOf( '}' ) ) < 0 )
+            idx2 = v.indexOf( '}' );
+            if ( idx2 < 0 )
             {
                 break;
             }

Modified: maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ReflectionProperties.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ReflectionProperties.java?rev=695189&r1=695188&r2=695189&view=diff
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ReflectionProperties.java (original)
+++ maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ReflectionProperties.java Sun Sep 14 04:09:20 2008
@@ -25,7 +25,6 @@
 
 import java.util.Properties;
 
-
 /**
  * @deprecated use classes in the component maven-filtering
  * TODO remove the class ?
@@ -38,15 +37,15 @@
 
     private MavenProject project;
 
-    boolean escapedBackslashesInFilePath;
+    private boolean escapedBackslashesInFilePath;
 
     public ReflectionProperties( MavenProject aProject, boolean escapedBackslashesInFilePath )
     {
-       super();
+        super();
 
-       project = aProject;
+        project = aProject;
 
-       this.escapedBackslashesInFilePath = escapedBackslashesInFilePath;
+        this.escapedBackslashesInFilePath = escapedBackslashesInFilePath;
     }
 
     public Object get( Object key )
@@ -54,24 +53,23 @@
         Object value = null;
         try
         {
-            value = ReflectionValueExtractor.evaluate( "" + key , project );
+            value = ReflectionValueExtractor.evaluate( "" + key, project );
 
-            if ( escapedBackslashesInFilePath && value != null &&
-                "java.lang.String".equals( value.getClass().getName() ) )
+            if ( escapedBackslashesInFilePath && ( value instanceof String ) )
             {
                 String val = (String) value;
 
                 // Check if it's a windows path
                 if ( val.indexOf( ":\\" ) == 1 )
                 {
-                    value = StringUtils.replace( (String)value, "\\", "\\\\" );
-                    value = StringUtils.replace( (String)value, ":", "\\:" );
+                    value = StringUtils.replace( (String) value, "\\", "\\\\" );
+                    value = StringUtils.replace( (String) value, ":", "\\:" );
                 }
             }
         }
         catch ( Exception e )
         {
-            //TODO: remove the try-catch block when ReflectionValueExtractor.evaluate() throws no more exceptions
+            // TODO: remove the try-catch block when ReflectionValueExtractor.evaluate() throws no more exceptions
         }
         return value;
     }

Modified: maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/Resource.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/Resource.java?rev=695189&r1=695188&r2=695189&view=diff
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/Resource.java (original)
+++ maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/Resource.java Sun Sep 14 04:09:20 2008
@@ -9,7 +9,7 @@
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an

Modified: maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java?rev=695189&r1=695188&r2=695189&view=diff
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java (original)
+++ maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java Sun Sep 14 04:09:20 2008
@@ -132,7 +132,8 @@
             }
             
             
-            MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution( getResources(), getOutputDirectory(),
+            MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution( getResources(), 
+                                                                                           getOutputDirectory(),
                                                                                            project, encoding, filters,
                                                                                            Collections.EMPTY_LIST,
                                                                                            session );