You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by di...@apache.org on 2004/01/08 00:14:10 UTC

cvs commit: maven/src/java/org/apache/maven/jelly/tags/maven InputTag.java UserCheck.java ReactorTag.java ConcatTag.java SnapshotSignature.java AddPathTag.java RootRelativePathTag.java MakeRelativePathTag.java CopyResources.java PluginVarTag.java WerkzDependencyResolver.java MavenTag.java

dion        2004/01/07 15:14:09

  Modified:    src/java/org/apache/maven/jelly/tags/maven Tag:
                        MAVEN-1_0-BRANCH InputTag.java UserCheck.java
                        ReactorTag.java ConcatTag.java
                        SnapshotSignature.java AddPathTag.java
                        RootRelativePathTag.java MakeRelativePathTag.java
                        CopyResources.java PluginVarTag.java
                        WerkzDependencyResolver.java MavenTag.java
  Log:
  Code cleanup
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.4.10.1  +5 -5      maven/src/java/org/apache/maven/jelly/tags/maven/InputTag.java
  
  Index: InputTag.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/InputTag.java,v
  retrieving revision 1.4
  retrieving revision 1.4.10.1
  diff -u -r1.4 -r1.4.10.1
  --- InputTag.java	12 Apr 2003 00:02:02 -0000	1.4
  +++ InputTag.java	7 Jan 2004 23:14:09 -0000	1.4.10.1
  @@ -72,13 +72,13 @@
   {
       /** Output file. */
       private File file;
  -    
  +
       /** Set output file. */
       public void setFile( File file )
       {
           this.file = file;
       }
  -    
  +
       /**
        * Perform functionality provided by the tag.
        *
  @@ -88,12 +88,12 @@
           throws JellyTagException
       {
           ConcatTag tag = (ConcatTag) findAncestorWithClass( ConcatTag.class );
  -        
  +
           if ( tag == null )
           {
               throw new JellyTagException( "no current concatenation" );
           }
  -        
  +
           tag.addFile( file );
       }
   }
  
  
  
  1.1.10.2  +7 -7      maven/src/java/org/apache/maven/jelly/tags/maven/UserCheck.java
  
  Index: UserCheck.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/UserCheck.java,v
  retrieving revision 1.1.10.1
  retrieving revision 1.1.10.2
  diff -u -r1.1.10.1 -r1.1.10.2
  --- UserCheck.java	3 Jan 2004 06:45:39 -0000	1.1.10.1
  +++ UserCheck.java	7 Jan 2004 23:14:09 -0000	1.1.10.2
  @@ -67,10 +67,10 @@
   public class UserCheck extends BaseTagSupport
   {
       /** the value that means no value has been set */
  -    private static String NO_VALUE = "USERNAME_NOT_SET";
  -    
  +    private static final String NO_VALUE = "USERNAME_NOT_SET";
  +
       /** Error message */
  -    private static String ERROR = 
  +    private static final String ERROR =
         "+------------------------------------------------------------------\n"
       + "| ERROR!\n"
       + "| \n"
  @@ -80,17 +80,17 @@
       + "|\n"
       + "| maven -Dmaven.username=${user.name} [goal]"
       + "+------------------------------------------------------------------";
  -    
  +
       /** the user to check has a value */
       private String user;
   
  -    /* (non-Javadoc)
  -     * @see org.apache.commons.jelly.Tag#doTag(org.apache.commons.jelly.XMLOutput)
  +    /**
  +     * @see org.apache.commons.jelly.Tag#doTag(XMLOutput)
        */
       public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException
       {
           checkAttribute(user, "user");
  -        
  +
           user = user.trim();
           if ( user.equals("") || user.equals(UserCheck.NO_VALUE))
           {
  
  
  
  1.36.4.4  +15 -14    maven/src/java/org/apache/maven/jelly/tags/maven/ReactorTag.java
  
  Index: ReactorTag.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/ReactorTag.java,v
  retrieving revision 1.36.4.3
  retrieving revision 1.36.4.4
  diff -u -r1.36.4.3 -r1.36.4.4
  --- ReactorTag.java	2 Jan 2004 23:30:24 -0000	1.36.4.3
  +++ ReactorTag.java	7 Jan 2004 23:14:09 -0000	1.36.4.4
  @@ -72,7 +72,7 @@
   /**
    * Reactor tag that processes a set of project descriptors taking into
    * consideration the inter-project dependencies.
  - * 
  + *
    * Used for building a set of projects in the correct order to satisfy any
    * dependencies among the projects being processed.
    *
  @@ -277,14 +277,14 @@
   
           System.out.println( "Our processing order:" );
   
  -        for ( Iterator i = sortedProjects.iterator(); i.hasNext(); )
  +        for ( Iterator i = sortedProjects.iterator(); i.hasNext();)
           {
               Project p = (Project) i.next();
               System.out.println( p.getName() );
           }
   
           Runtime r = Runtime.getRuntime();
  -        for ( Iterator i = sortedProjects.iterator(); i.hasNext(); )
  +        for ( Iterator i = sortedProjects.iterator(); i.hasNext();)
           {
               // The basedir needs to be set for the project
               // We just need the descriptor.
  @@ -293,10 +293,10 @@
               beforeProject(project);
               try
               {
  -                final long MEG = 1024 * 1024;
  +                final long mb = 1024 * 1024;
                   System.out.println( "+----------------------------------------" );
                   System.out.println( "| " + getBanner() + " " + project.getName() );
  -                System.out.println( "| Memory: " + ((r.totalMemory() - r.freeMemory()) / MEG) + "M/" + (r.totalMemory() / MEG) + "M");
  +                System.out.println( "| Memory: " + ((r.totalMemory() - r.freeMemory()) / mb) + "M/" + (r.totalMemory() / mb) + "M");
                   System.out.println( "+----------------------------------------" );
   
                   // We only try to attain goals if they have been set. The reactor
  @@ -305,7 +305,7 @@
                   List goalList = new ArrayList();
                   if ( getGoals() != null )
                   {
  -                    goalList.addAll( MavenUtils.getGoalListFromCsv( getGoals() ) ); 
  +                    goalList.addAll( MavenUtils.getGoalListFromCsv( getGoals() ) );
                   }
   
                   beforeLaunchGoals(project);
  @@ -321,7 +321,7 @@
                   }
               }
               afterProject(project);
  -            
  +
               if ( getPostProcessing() )
               {
                   reactorProjects.add( project );
  @@ -363,7 +363,8 @@
               projectIncludes = getIncludes();
           }
   
  -        List projects = MavenUtils.getProjects( getBasedir(), projectIncludes, getExcludes(), getMavenContext().getMavenSession().getRootContext() );
  +        List projects = MavenUtils.getProjects( getBasedir(), projectIncludes, getExcludes(),
  +            getMavenContext().getMavenSession().getRootContext() );
   
           DependencyResolver dr = new DependencyResolver();
           dr.setProjects( projects );
  @@ -378,7 +379,7 @@
       public void beforeProject(Project project)
       {
       }
  -    
  +
       /**
        * This method is running before launching project goals.
        * @param project the currentProject
  @@ -386,7 +387,7 @@
       public void beforeLaunchGoals(Project project)
       {
       }
  -    
  +
       /**
        * This method is running after launching project goals.
        * @param project the currentProject
  @@ -394,7 +395,7 @@
       public void afterLaunchGoals(Project project)
       {
       }
  -    
  +
       /**
        * This method is running after launching a project.
        * @param project the currentProject
  @@ -402,7 +403,7 @@
       public void afterProject(Project project)
       {
       }
  -    
  +
       /**
        * This method is running when an exception occurs whatever
        * the ignoreFailures value.
  @@ -414,7 +415,7 @@
           getMavenContext().setVariable( MavenConstants.BUILD_FAILURE, "true" );
           failedProjects.add( project );
       }
  -    
  +
       /**
        * This method is running when an exception occurs in
        * dependency resolution.
  
  
  
  1.10.4.1  +3 -3      maven/src/java/org/apache/maven/jelly/tags/maven/ConcatTag.java
  
  Index: ConcatTag.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/ConcatTag.java,v
  retrieving revision 1.10
  retrieving revision 1.10.4.1
  diff -u -r1.10 -r1.10.4.1
  --- ConcatTag.java	19 Aug 2003 04:25:39 -0000	1.10
  +++ ConcatTag.java	7 Jan 2004 23:14:09 -0000	1.10.4.1
  @@ -114,7 +114,7 @@
               // doesn't exists then create it.
               File outputFileDirectory = outputFile.getParentFile();
   
  -            if ( outputFileDirectory.exists() == false )
  +            if ( !outputFileDirectory.exists() )
               {
                   outputFileDirectory.mkdirs();
               }
  @@ -123,7 +123,7 @@
   
               // We should now have all the files we want to concat so
               // lets do it.
  -            for ( Iterator i = files.iterator(); i.hasNext(); )
  +            for ( Iterator i = files.iterator(); i.hasNext();)
               {
                   File f = (File) i.next();
                   FileInputStream in = new FileInputStream( f );
  
  
  
  1.11.4.1  +3 -3      maven/src/java/org/apache/maven/jelly/tags/maven/SnapshotSignature.java
  
  Index: SnapshotSignature.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/SnapshotSignature.java,v
  retrieving revision 1.11
  retrieving revision 1.11.4.1
  diff -u -r1.11 -r1.11.4.1
  --- SnapshotSignature.java	1 Sep 2003 16:09:21 -0000	1.11
  +++ SnapshotSignature.java	7 Jan 2004 23:14:09 -0000	1.11.4.1
  @@ -111,8 +111,8 @@
           SimpleDateFormat formatter = new SimpleDateFormat( "yyyyMMdd.HHmmss" );
           formatter.setTimeZone( TimeZone.getTimeZone( "GMT" ) );
           String snapshotVersion = formatter.format( now );
  -        String snapshotSignature = getProject().getArtifactId() +
  -                                   "-" + snapshotVersion;
  +        String snapshotSignature = getProject().getArtifactId()
  +                                    + "-" + snapshotVersion;
   
           context.setVariable( "snapshotSignature", snapshotSignature );
   
  
  
  
  1.13.4.2  +2 -2      maven/src/java/org/apache/maven/jelly/tags/maven/AddPathTag.java
  
  Index: AddPathTag.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/AddPathTag.java,v
  retrieving revision 1.13.4.1
  retrieving revision 1.13.4.2
  diff -u -r1.13.4.1 -r1.13.4.2
  --- AddPathTag.java	26 Nov 2003 11:45:16 -0000	1.13.4.1
  +++ AddPathTag.java	7 Jan 2004 23:14:09 -0000	1.13.4.2
  @@ -96,7 +96,7 @@
           {
               throw new JellyTagException( "cannot find ant project" );
           }
  -        
  +
           checkAttribute( getId(), "id" );
           checkAttribute( getRefid(), "refid" );
   
  
  
  
  1.1.4.1   +11 -11    maven/src/java/org/apache/maven/jelly/tags/maven/RootRelativePathTag.java
  
  Index: RootRelativePathTag.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/RootRelativePathTag.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- RootRelativePathTag.java	8 Oct 2003 23:44:04 -0000	1.1
  +++ RootRelativePathTag.java	7 Jan 2004 23:14:09 -0000	1.1.4.1
  @@ -69,7 +69,7 @@
    * Converts an absolute path into a path relative to a root dir. For
    * example, if the root dir is "c:/apps/myproject" and the absolute
    * path is "c:/apps/myproject/path/subproject2" then the computed
  - * relative path is "../..".  
  + * relative path is "../..".
    *
    * @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
    * @version $Id$
  @@ -81,7 +81,7 @@
   
       /** The path to convert. */
       private String path;
  -    
  +
       /** The jelly variable to store the result into. */
       private String var;
   
  @@ -115,7 +115,7 @@
       /**
        * @see Tag#doTag(XMLOutput)
        */
  -    public void doTag(XMLOutput output) 
  +    public void doTag(XMLOutput output)
           throws MissingAttributeException, JellyTagException
       {
           checkAttribute(rootdir, "rootdir");
  @@ -131,7 +131,7 @@
           {
               throw new JellyTagException( "Unable to create relative path", e );
           }
  -        getContext().setVariable(var, result);        
  +        getContext().setVariable(var, result);
       }
   
       /**
  @@ -149,21 +149,21 @@
           else if (canonicalPath.startsWith(canonicalRootdir))
           {
               canonicalPath = canonicalPath.substring(
  -                canonicalRootdir.length());            
  +                canonicalRootdir.length());
           }
           else
           {
  -            throw new IOException("Path [" + canonicalPath 
  +            throw new IOException("Path [" + canonicalPath
                   + "] is not a subset of [" + canonicalRootdir + "]");
           }
   
           StringBuffer result = new StringBuffer(".");
           StringTokenizer tokens = new StringTokenizer(canonicalPath, "/\\" );
  -        while (tokens.hasMoreTokens()) 
  +        while (tokens.hasMoreTokens())
           {
  -            String token = (String) tokens.nextToken();
  +            tokens.nextToken();
               result.append("/..");
  -        }        
  -        return result.toString();        
  +        }
  +        return result.toString();
       }
   }
  
  
  
  1.4.4.1   +3 -3      maven/src/java/org/apache/maven/jelly/tags/maven/MakeRelativePathTag.java
  
  Index: MakeRelativePathTag.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/MakeRelativePathTag.java,v
  retrieving revision 1.4
  retrieving revision 1.4.4.1
  diff -u -r1.4 -r1.4.4.1
  --- MakeRelativePathTag.java	1 Sep 2003 05:18:04 -0000	1.4
  +++ MakeRelativePathTag.java	7 Jan 2004 23:14:09 -0000	1.4.4.1
  @@ -78,7 +78,7 @@
   
       /** The path to convert. */
       private String path;
  -    
  +
       /** Force a certain path separator. */
       private String separator = null;
   
  @@ -137,13 +137,13 @@
               {
                   StringBuffer buf = new StringBuffer();
                   StringTokenizer tok = new StringTokenizer( canonicalPath, "/\\" );
  -                while ( tok.hasMoreTokens() ) 
  +                while ( tok.hasMoreTokens() )
                   {
                       buf.append( tok.nextToken() );
                       if ( tok.hasMoreTokens() )
                       {
                           buf.append( separator );
  -                    }                                        
  +                    }
                   }
                   canonicalPath = buf.toString();
               }
  
  
  
  1.2.4.2   +11 -11    maven/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
  
  Index: CopyResources.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java,v
  retrieving revision 1.2.4.1
  retrieving revision 1.2.4.2
  diff -u -r1.2.4.1 -r1.2.4.2
  --- CopyResources.java	3 Jan 2004 06:45:39 -0000	1.2.4.1
  +++ CopyResources.java	7 Jan 2004 23:14:09 -0000	1.2.4.2
  @@ -71,22 +71,22 @@
   import org.apache.tools.ant.types.PatternSet;
   
   /**
  - * A tag to copy resources to a given directory 
  - * 
  + * A tag to copy resources to a given directory
  + *
    * @version $Revision$
    */
   public class CopyResources extends BaseTagSupport
   {
       /** log for debug output */
       private static final Log log = LogFactory.getLog(BaseTagSupport.class);
  -    
  +
       /** the resources to copy */
       private List resources;
  -    
  +
       /** the directory to copy to */
       private String todir;
   
  -    /* (non-Javadoc)
  +    /**
        * @see org.apache.commons.jelly.Tag#doTag(org.apache.commons.jelly.XMLOutput)
        */
       public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException
  @@ -98,7 +98,7 @@
           }
   //      <j:forEach var="resource" items="${resources}">
   //        <j:set var="resourceDirectoryPresent" value="false"/>
  -//          
  +//
   //        <util:available file="${resource.directory}">
   //          <j:set var="resourceDirectoryPresent" value="true"/>
   //        </util:available>
  @@ -128,7 +128,7 @@
   //          </copy>
   //        </j:if>
   //      </j:forEach>
  -        
  +
           for (Iterator iter = resources.iterator(); iter.hasNext();)
           {
               Resource resource = (Resource) iter.next();
  @@ -140,7 +140,7 @@
                   String targetPath = resource.getTargetPath();
                   if (targetPath != null && !targetPath.trim().equals(""))
                   {
  -                    targetDirectoryBuffer.append('/').append(targetPath); 
  +                    targetDirectoryBuffer.append('/').append(targetPath);
                   }
                   File targetDirectory = new File(targetDirectoryBuffer.toString());
                   // copy to targetDirectory....
  @@ -158,7 +158,7 @@
                   }
                   // add includes
                   for (Iterator incIter = resource.getIncludes().iterator();
  -                    incIter.hasNext(); )
  +                    incIter.hasNext();)
                   {
                       String include = (String) incIter.next();
                       PatternSet.NameEntry entry = fileSet.createInclude();
  @@ -166,7 +166,7 @@
                   }
                   // add excludes
                   for (Iterator incIter = resource.getExcludes().iterator();
  -                    incIter.hasNext(); )
  +                    incIter.hasNext();)
                   {
                       String exclude = (String) incIter.next();
                       PatternSet.NameEntry entry = fileSet.createExclude();
  
  
  
  1.1.4.3   +3 -3      maven/src/java/org/apache/maven/jelly/tags/maven/PluginVarTag.java
  
  Index: PluginVarTag.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/PluginVarTag.java,v
  retrieving revision 1.1.4.2
  retrieving revision 1.1.4.3
  diff -u -r1.1.4.2 -r1.1.4.3
  --- PluginVarTag.java	3 Jan 2004 06:45:39 -0000	1.1.4.2
  +++ PluginVarTag.java	7 Jan 2004 23:14:09 -0000	1.1.4.3
  @@ -91,7 +91,7 @@
           checkAttribute(plugin, "plugin");
           checkAttribute(property, "property");
           Project project = getMavenContext().getProject();
  -        try 
  +        try
           {
               MavenJellyContext context = project.getPluginContext(plugin);
               if (context != null)
  @@ -101,8 +101,8 @@
               }
               else
               {
  -                log.error( "context for plugin '" + plugin + "' in project '" + 
  -                           project + "' is null" );
  +                log.error( "context for plugin '" + plugin + "' in project '"
  +                    + project + "' is null" );
               }
           }
           catch ( UnknownPluginException e )
  
  
  
  1.7.4.2   +4 -4      maven/src/java/org/apache/maven/jelly/tags/maven/WerkzDependencyResolver.java
  
  Index: WerkzDependencyResolver.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/WerkzDependencyResolver.java,v
  retrieving revision 1.7.4.1
  retrieving revision 1.7.4.2
  diff -u -r1.7.4.1 -r1.7.4.2
  --- WerkzDependencyResolver.java	26 Nov 2003 11:45:16 -0000	1.7.4.1
  +++ WerkzDependencyResolver.java	7 Jan 2004 23:14:09 -0000	1.7.4.2
  @@ -81,7 +81,7 @@
       private Goal doItAll = null;
       private WerkzProject wproject = null;
   
  -    /** 
  +    /**
        * @see org.apache.maven.jelly.tags.maven.DependencyResolverInterface#clear()
        */
       public void clear()
  @@ -101,7 +101,7 @@
       /**
        * Retrieves the existing goal for a project (based on Id).
        * If no goal exists, an exception is thrown.
  -     * @param project  
  +     * @param project the project to retrieve a goal from
        * @return ProjectGoal
        */
       protected ProjectGoal getExistingGoal(Project project)
  @@ -202,7 +202,7 @@
   
       /**
        * Filters the given list of goals, and returns the associated projects
  -     * 
  +     *
        * If param:sourceBuild == true, include goal
        * If param:sourceBuild == false, include goal if goal:sourceBuild == true
        * @param goals
  
  
  
  1.11.4.2  +2 -2      maven/src/java/org/apache/maven/jelly/tags/maven/MavenTag.java
  
  Index: MavenTag.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/MavenTag.java,v
  retrieving revision 1.11.4.1
  retrieving revision 1.11.4.2
  diff -u -r1.11.4.1 -r1.11.4.2
  --- MavenTag.java	26 Nov 2003 11:45:16 -0000	1.11.4.1
  +++ MavenTag.java	7 Jan 2004 23:14:09 -0000	1.11.4.2
  @@ -115,7 +115,7 @@
               List goalList = new ArrayList();
               if ( getGoals() != null )
               {
  -                goalList.addAll( MavenUtils.getGoalListFromCsv( getGoals() ) ); 
  +                goalList.addAll( MavenUtils.getGoalListFromCsv( getGoals() ) );
               }
   
               getMavenContext().getMavenSession().attainGoals( project, goalList );
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org