dion        2002/07/14 08:32:01

  Modified:    src/java/org/apache/maven/app Maven.java
  Log:
  Style violations
  
  Revision  Changes    Path
  1.62      +59 -40    jakarta-turbine-maven/src/java/org/apache/maven/app/Maven.java
  
  Index: Maven.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/app/Maven.java,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- Maven.java        11 Jul 2002 22:19:43 -0000      1.61
  +++ Maven.java        14 Jul 2002 15:32:01 -0000      1.62
  @@ -57,10 +57,8 @@
    */
   
   import org.apache.maven.ProjectVerifier;
  -import org.apache.maven.MavenException;
   import org.apache.maven.build.DescriptorException;
   import org.apache.maven.build.ProjectDescriptor;
  -import org.apache.maven.plugin.Plugin;
   import org.apache.maven.project.Project;
   import org.apache.maven.jelly.tags.project.MavenTagLibrary;
   
  @@ -84,24 +82,19 @@
   
   import org.apache.tools.ant.DemuxOutputStream;
   
  -import org.xml.sax.SAXException;
  -
   import com.werken.werkz.Goal;
   import com.werken.werkz.Session;
   import com.werken.werkz.UnattainableGoalException;
   import com.werken.werkz.NoActionDefinitionException;
   
  -import java.beans.IntrospectionException;
   import java.io.File;
   import java.io.FileInputStream;
   import java.io.Writer;
   import java.io.OutputStreamWriter;
  -import java.io.FileNotFoundException;
   import java.io.IOException;
   import java.io.PrintStream;
   
   import java.net.URL;
  -import java.net.URLClassLoader;
   import java.net.MalformedURLException;
   
   import java.text.BreakIterator;
  @@ -114,7 +107,6 @@
   import java.util.Enumeration;
   import java.util.Iterator;
   import java.util.List;
  -import java.util.Map;
   import java.util.Properties;
   import java.util.StringTokenizer;
   
  @@ -250,7 +242,7 @@
   
       /** Set the project descriptor file name.
        *
  -     *  @param projectFile The project descriptor file name.
  +     *  @param projectFileName The project descriptor file name.
        */
       public void setProjectFileName(String projectFileName)
       {
  @@ -318,6 +310,10 @@
           return this.antProject;
       }
   
  +    /**
  +     * retrieve the werkz project object
  +     * @return the {@link com.werken.werkz.Project Werkz Project}
  +     */
       private com.werken.werkz.Project getWerkzProject()
       {
           return this.werkzProject;
  @@ -358,6 +354,9 @@
                                    "bin");
       }
   
  +    /**
  +     * @return the {@link File} used to drive the build process
  +     */
       public File getDriverFile()
       {
           return new File( getMavenBin(),
  @@ -429,7 +428,8 @@
   
       /** Retrieve a property.
        *
  -     *  @return The value of the property or <code>null</code>
  +     * @param name the property name to retrieve
  +     * @return The value of the property or <code>null</code>
        *          if the property has not been set.
        */
       public String getProperty(String name)
  @@ -443,7 +443,7 @@
   
           if ( val instanceof CompositeExpression )
           {
  -            val = ((CompositeExpression)val).evaluate( getJellyContext() );
  +            val = ((CompositeExpression) val).evaluate( getJellyContext() );
           }
   
           return val.toString();
  @@ -469,17 +469,15 @@
        *
        *  @throws ParseException If there is an error parsing the
        *          command-line.
  -     *  @throws IntrospectionException If there is an error while
  -     *          reading the project descriptor.
        *  @throws IOException If there is an error while
        *          reading the project descriptor.
        *  @throws MalformedURLException If any of the the URLs denoting
        *          the local or remote repositories is malformed.
  -     *  @throws SAXException If there is an error while
  -     *          reading the project descriptor.
  +     *  @throws DescriptorException when there are errors creating the 
  +     *          descriptor from a file
        */
  -    public void initializeCore(String[] args)
  -        throws ParseException, IOException, MalformedURLException, 
DescriptorException
  +    public void initializeCore(String[] args) throws 
  +        ParseException, IOException, MalformedURLException, DescriptorException
       {
   
           setMavenHome(new File(System.getProperty("maven.home")));
  @@ -591,7 +589,11 @@
           antProject.init();
       }
   
  -    /** Initialize the IO streams.
  +    /**
  +     *  Initialize the IO streams.
  +     * 
  +     * @throws IOException on error creating XML output and handling System.err
  +     *         and out
        */
       private void initializeIO() throws IOException
       {
  @@ -599,7 +601,7 @@
           this.consoleErr = System.err;
   
           this.writer = new OutputStreamWriter(this.consoleOut);
  -        this.output = XMLOutput.createXMLOutput(writer,false);
  +        this.output = XMLOutput.createXMLOutput(writer, false);
   
           GrantProject project = getAntProject();
   
  @@ -637,6 +639,11 @@
           loadProjectBuildFile();
       }
   
  +    /**
  +     * Initialise the jelly script that drives the build
  +     * 
  +     * @throws Exception when any error occurs
  +     */
       private void initializeDriver() throws Exception
       {
           getJellyContext().setVariable("pom",
  @@ -644,7 +651,7 @@
   
           File driver = getDriverFile();
   
  -        if ( ! driver.exists() )
  +        if ( !driver.exists() )
           {
               return;
           }
  @@ -704,7 +711,8 @@
   
           // sort by name
           Comparator comparator = new Comparator() {
  -            public int compare(Object o1, Object o2) {
  +            public int compare(Object o1, Object o2)
  +            {
                   Goal g1 = (Goal) o1;
                   Goal g2 = (Goal) o2;
                   return g1.getName().compareTo( g2.getName() );
  @@ -738,7 +746,7 @@
               StringTokenizer st = new StringTokenizer(goalName, ":");
               pluginName = st.nextToken();
   
  -            if(pluginName.equals(goalName))
  +            if (pluginName.equals(goalName))
               {
                   isMain = true;
                   newPackage = true;
  @@ -758,9 +766,9 @@
   
               hadDesc = true;
   
  -            if(isMain && newPackage)
  +            if (isMain && newPackage)
               {
  -                if(!isFirst)
  +                if (!isFirst)
                   {
                   System.out.println();
                   }
  @@ -770,18 +778,19 @@
                   // the indent here is dynamic
                   wrapIndent = msgPrefix.length();
               }
  -             else if(isMain)
  +            else if (isMain)
               {
                   wrapIndent = 30;
  -                msgPrefix = "o " + format(goalName + " ", wrapIndent, '.') + " ";
  +                msgPrefix = "o " + format(goalName + " ", wrapIndent, '.')
  +                    + " ";
                   // add 3 for spaces and 'o' used to pad the message
  -                wrapIndent+=3;
  +                wrapIndent += 3;
               }
               else
               {
  -                if(newPackage)
  +                if (newPackage)
                   {
  -                    if(isFirst)
  +                    if (isFirst)
                       {
                           msgPrefix = "[";
                           isFirst = false;
  @@ -799,13 +808,14 @@
   
                   wrapIndent = 30;
                   String shortName =
  -                    goalName.substring( pluginName.length()+1,goalName.length() );
  +                    goalName.substring( pluginName.length() + 1, 
  +                        goalName.length() );
   
                   msgPrefix = msgPrefix + "  "
                               + format(shortName + " ", wrapIndent, '.' )
                               + " ";
                   // add 3 for spaces used to pad the message
  -                wrapIndent+=3;
  +                wrapIndent += 3;
               }
   
   
  @@ -843,12 +853,12 @@
        * @param wrapIndent the number of characters to indent all lines
        * after the first one
        * @param lineWidth the console width that determines where to wrap
  -     *
  +     * @return the message wrapped for the console
        */
       private String wrapConsoleMessage(String msg, int wrapIndent, int lineWidth)
       {
  -        int offset = lineWidth-wrapIndent;
  -        if(msg.length() <= offset)
  +        int offset = lineWidth - wrapIndent;
  +        if (msg.length() <= offset)
           {
               return msg;
           }
  @@ -1121,7 +1131,7 @@
       {
           //!! FIXME: the value for the remote repo shouldn't be hard-coded.
           this.properties.setProperty("maven.repo.remote",
  -                                     "http://jakarta.apache.org/turbine/jars2/";);
  +            "http://jakarta.apache.org/turbine/jars2/";);
   
           Enumeration propNames = System.getProperties().propertyNames();
           String      eachName  = null;
  @@ -1214,6 +1224,12 @@
           }
       }
   
  +    /**
  +     * Add the specified properties to the 
  +     * {@link #getJellyContext() jelly context}
  +     * 
  +     * @param props the {@link Properties} to add
  +     */
       private void integrateProps(Properties props)
       {
           if (props == null)
  @@ -1314,23 +1330,24 @@
   
           File localRepo = new File(localRepoProp);
   
  -        if (! localRepo.exists())
  +        if (!localRepo.exists())
           {
               System.err.println("Directory '" + localRepo + "' does not exist.");
               System.err.println("Attempting to create.");
   
               if (!localRepo.mkdirs())
               {
  -                throw new RepoConfigException("Unable to create directory '" + 
localRepo + "'");
  +                throw new RepoConfigException("Unable to create directory '"
  +                    + localRepo + "'");
               }
           }
   
  -        if (! localRepo.isDirectory())
  +        if (!localRepo.isDirectory())
           {
               throw new RepoConfigException(localRepo + " is not a directory.");
           }
   
  -        if (! localRepo.canWrite())
  +        if (!localRepo.canWrite())
           {
               throw new RepoConfigException(localRepo + " is not writable.");
           }
  @@ -1363,8 +1380,10 @@
         System.out.println("|_|  |_\\__,_|\\_/\\___|_||_|   v. " + APP_VERSION);
       }
   
  -      /**
  +    /**
        * Prints the Project header to System.out
  +     * 
  +     * @param mavenProject the project the print
        */
       private void printConsoleProjectHeader(Project mavenProject)
       {
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to