werken      2002/11/25 10:30:24

  Modified:    .        project.properties
               src/java/org/apache/maven CreateDependencyClasspath.java
               src/java/org/apache/maven/cli App.java
               src/java/org/apache/maven/jelly MavenExpressionFactory.java
               src/java/org/apache/maven/util Expand.java HttpUtils.java
                        MD5Sum.java StringInputStream.java
  Log:
  Checkstyle violations.
  
  Revision  Changes    Path
  1.33      +2 -0      jakarta-turbine-maven/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/project.properties,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- project.properties        25 Nov 2002 17:43:53 -0000      1.32
  +++ project.properties        25 Nov 2002 18:30:24 -0000      1.33
  @@ -21,6 +21,8 @@
   checkstyle.paren.pad = ignore
   checkstyle.maxlinelen = 132
   
  +checkstyle.maxmethodlen = 175
  +
   checkstyle.ignore.whitespace = yes
   
   checkstyle.header.file = LICENSE.txt
  
  
  
  1.18      +6 -3      
jakarta-turbine-maven/src/java/org/apache/maven/CreateDependencyClasspath.java
  
  Index: CreateDependencyClasspath.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/CreateDependencyClasspath.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- CreateDependencyClasspath.java    24 Nov 2002 23:41:12 -0000      1.17
  +++ CreateDependencyClasspath.java    25 Nov 2002 18:30:24 -0000      1.18
  @@ -185,8 +185,11 @@
               }
   
               Object b = context.getVariable( MavenConstants.JAR_OVERRIDE );
  -            boolean mavenJarOverride = ( b != null && b instanceof Boolean &&
  -                ( (Boolean) b ).booleanValue() );
  +            boolean mavenJarOverride = ( ( b != null )
  +                                         &&
  +                                         ( b instanceof Boolean )
  +                                         &&
  +                                         ( ( (Boolean) b ).booleanValue() ) );
   
               String mavenRepoLocal =
                   (String) context.getVariable( MavenConstants.REPO_LOCAL );
  
  
  
  1.8       +130 -105  jakarta-turbine-maven/src/java/org/apache/maven/cli/App.java
  
  Index: App.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/cli/App.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- App.java  24 Nov 2002 23:41:12 -0000      1.7
  +++ App.java  25 Nov 2002 18:30:24 -0000      1.8
  @@ -562,85 +562,8 @@
           catch ( UnattainableGoalException e )
           {
               failed = true;
  -            returnCode = RC_GOAL_FAILED;
  -
  -            System.out.println( "" );
  -            System.err.println( "BUILD FAILED" );
  -
  -            String msg = null;
  -
  -            String fileName = null;
  -            String elementName = null;
  -
  -            int lineNumber = -1;
  -            int column = -1;
  -
  -            Throwable rootCause = e.getRootCause();
  -
  -            if ( rootCause != null )
  -            {
  -                if ( rootCause instanceof JellyException )
  -                {
  -                    returnCode = RC_JELLY_FAILED;
  -                    JellyException jellyEx = (JellyException) rootCause;
  -
  -                    fileName = jellyEx.getFileName();
  -                    elementName = jellyEx.getElementName();
  -
  -                    lineNumber = jellyEx.getLineNumber();
  -                    column = jellyEx.getColumnNumber();
  -
  -                    rootCause = jellyEx.getCause();
  -
  -                    if ( rootCause == null )
  -                    {
  -                        msg = jellyEx.getReason();
  -                    }
  -                    else
  -                    {
  -                        if ( getCli().hasOption( DISPLAY_STACKTRACE ) )
  -                        {
  -                            rootCause.printStackTrace();
  -                        }
  -
  -                        msg = rootCause.getLocalizedMessage();
  -
  -                        if ( msg == null )
  -                        {
  -                            msg = rootCause.getClass().getName();
  -                        }
  -                    }
  -                }
  -                else
  -                {
  -                    rootCause.printStackTrace();
  -                    msg = rootCause.getLocalizedMessage();
  -
  -                    if ( msg == null )
  -                    {
  -                        msg = rootCause.getClass().getName();
  -                    }
  -                }
  -            }
  -            else
  -            {
  -                msg = e.getLocalizedMessage();
  -            }
  -
  -            if ( fileName != null )
  -            {
  -                System.err.println( "File...... " + fileName );
  -                System.err.println( "Element... " + elementName );
  -                System.err.println( "Line...... " + lineNumber );
  -                System.err.println( "Column.... " + column );
  -            }
  -
  -            System.err.println( msg );
  -
  -            if ( getCli().hasOption( DEBUG_X ) )
  -            {
  -                e.printStackTrace();
  -            }
  +            returnCode = handleUnattainableGoalException( e );
  +            // returnCode = RC_GOAL_FAILED;
           }
           catch ( JellyException e )
           {
  @@ -682,6 +605,97 @@
           System.exit( returnCode );
       }
   
  +    /** Handle an <code>UnattainableGoalException</code>.
  +     *
  +     *  @param e The exception.
  +     *
  +     *  @return The return code.
  +     */
  +    private int handleUnattainableGoalException(UnattainableGoalException e)
  +    {
  +        int returnCode =  RC_GOAL_FAILED;
  +
  +        System.out.println( "" );
  +        System.err.println( "BUILD FAILED" );
  +        
  +        String msg = null;
  +        
  +        String fileName = null;
  +        String elementName = null;
  +        
  +        int lineNumber = -1;
  +        int column = -1;
  +        
  +        Throwable rootCause = e.getRootCause();
  +        
  +        if ( rootCause != null )
  +        {
  +            if ( rootCause instanceof JellyException )
  +            {
  +                returnCode = RC_JELLY_FAILED;
  +                JellyException jellyEx = (JellyException) rootCause;
  +                
  +                fileName = jellyEx.getFileName();
  +                elementName = jellyEx.getElementName();
  +                
  +                lineNumber = jellyEx.getLineNumber();
  +                column = jellyEx.getColumnNumber();
  +                
  +                rootCause = jellyEx.getCause();
  +                
  +                if ( rootCause == null )
  +                {
  +                    msg = jellyEx.getReason();
  +                }
  +                else
  +                {
  +                    if ( getCli().hasOption( DISPLAY_STACKTRACE ) )
  +                    {
  +                        rootCause.printStackTrace();
  +                    }
  +                    
  +                    msg = rootCause.getLocalizedMessage();
  +                    
  +                    if ( msg == null )
  +                    {
  +                        msg = rootCause.getClass().getName();
  +                    }
  +                }
  +            }
  +            else
  +            {
  +                rootCause.printStackTrace();
  +                msg = rootCause.getLocalizedMessage();
  +                
  +                if ( msg == null )
  +                {
  +                    msg = rootCause.getClass().getName();
  +                }
  +            }
  +        }
  +        else
  +        {
  +            msg = e.getLocalizedMessage();
  +        }
  +        
  +        if ( fileName != null )
  +        {
  +            System.err.println( "File...... " + fileName );
  +            System.err.println( "Element... " + elementName );
  +            System.err.println( "Line...... " + lineNumber );
  +            System.err.println( "Column.... " + column );
  +        }
  +        
  +        System.err.println( msg );
  +        
  +        if ( getCli().hasOption( DEBUG_X ) )
  +        {
  +            e.printStackTrace();
  +        }
  +
  +        return returnCode;
  +    }
  +
       /**
        * From the CWD search through the directory hierarchy for
        * an XML-based POM.
  @@ -893,33 +907,44 @@
   
           if ( haveGoalsWithNoDescription )
           {
  -            System.out.println();
  -            System.out.println();
  -            System.out.println( "Non documented goals : " );
  -            System.out.println();
  -
  -            for ( Iterator i = list.iterator(); i.hasNext(); )
  -            {
  -                String goalName = (String) i.next();
  -
  -                String goalDescription = 
getMaven().getPluginManager().getGoalDescription( goalName );
  +            displayGoalsWithoutDescriptions( list );
  +        }
  +    }
   
  -                /*
  -                 * prepare the description
  -                 */
  -                if ( goalDescription == null )
  -                {
  -                    hasDesc = false;
  -                }
  -                else
  -                {
  -                    hasDesc = goalDescription.trim().length() != 0;
  -                }
  +    /** Display goals without descriptions.
  +     *
  +     *  @param list List of undocument goal names.
  +     */
  +    private void displayGoalsWithoutDescriptions(List list)
  +    {
  +        System.out.println();
  +        System.out.println();
  +        System.out.println( "Non documented goals : " );
  +        System.out.println();
  +        
  +        for ( Iterator i = list.iterator(); i.hasNext(); )
  +        {
  +            String goalName = (String) i.next();
  +            
  +            String goalDescription = 
getMaven().getPluginManager().getGoalDescription( goalName );
  +            
  +            boolean hasDesc = false;
   
  -                if ( !hasDesc )
  -                {
  -                    System.out.println( "  " + goalName );
  -                }
  +            /*
  +             * prepare the description
  +             */
  +            if ( goalDescription == null )
  +            {
  +                hasDesc = false;
  +            }
  +            else
  +            {
  +                hasDesc = goalDescription.trim().length() != 0;
  +            }
  +            
  +            if ( !hasDesc )
  +            {
  +                System.out.println( "  " + goalName );
               }
           }
       }
  
  
  
  1.5       +2 -2      
jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenExpressionFactory.java
  
  Index: MavenExpressionFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenExpressionFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MavenExpressionFactory.java       25 Nov 2002 17:43:53 -0000      1.4
  +++ MavenExpressionFactory.java       25 Nov 2002 18:30:24 -0000      1.5
  @@ -147,7 +147,7 @@
        * Sets whether we should allow Ant-style expresssions, using dots as part
        * of variable name
        *
  -     * @param supportAntVariable <code>true</code> to indicate that ant variable
  +     * @param supportAntVariables <code>true</code> to indicate that ant variable
        *        should be supported, otherwise <code>false</code>.
        */
       public void setSupportAntVariables( boolean supportAntVariables )
  
  
  
  1.5       +60 -37    jakarta-turbine-maven/src/java/org/apache/maven/util/Expand.java
  
  Index: Expand.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/util/Expand.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Expand.java       24 Nov 2002 19:00:40 -0000      1.4
  +++ Expand.java       25 Nov 2002 18:30:24 -0000      1.5
  @@ -1,7 +1,9 @@
  -/*
  +package org.apache.maven.util;
  +
  +/* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -16,21 +18,21 @@
    *    the documentation and/or other materials provided with the
    *    distribution.
    *
  - * 3. The end-user documentation included with the redistribution, if
  - *    any, must include the following acknowlegement:
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowlegement may appear in the software itself,
  - *    if and wherever such third-party acknowlegements normally appear.
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Apache" and "Apache Software Foundation" and
  + *    "Apache Maven" must not be used to endorse or promote products
  + *    derived from this software without prior written permission. For
  + *    written permission, please contact [EMAIL PROTECTED]
    *
  - * 4. The names "The Jakarta Project", "Ant", and "Apache Software
  - *    Foundation" must not be used to endorse or promote products derived
  - *    from this software without prior written permission. For written
  - *    permission, please contact [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache"
  - *    nor may "Apache" appear in their names without prior written
  - *    permission of the Apache Group.
  + * 5. Products derived from this software may not be called "Apache",
  + *    "Apache Maven", nor may "Apache" appear in their name, without
  + *    prior written permission of the Apache Software Foundation.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  @@ -50,10 +52,10 @@
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * ====================================================================
    */
   
  -package org.apache.maven.util;
  -
   import org.apache.tools.ant.util.FileUtils;
   
   import java.io.File;
  @@ -77,14 +79,19 @@
    */
   public class Expand
   {
  -    private File dest;//req
  +    /** Destination. */
  +    private File dest;
  +
  +    /** Source. */
       private File source;// req
  +
  +    /** Should overwrite flag. */
       private boolean overwrite = true;
   
       /**
        * Do the work.
        *
  -     * @exception BuildException Thrown in unrecoverable error.
  +     * @throws Exception If an error occurs.
        */
       public void execute()
           throws Exception
  @@ -93,11 +100,11 @@
           expandFile( fileUtils, source, dest );
       }
   
  -    /*
  -     * This method is to be overridden by extending unarchival tasks.
  -     */
  -    /**
  -     * Description of the Method
  +    /** Expand a file.
  +     *
  +     *  @param fileUtils File util helper.
  +     *  @param srcF The source file.
  +     *  @param dir The directory
        */
       protected void expandFile( FileUtils fileUtils, File srcF, File dir )
       {
  @@ -132,13 +139,24 @@
                   }
                   catch ( IOException e )
                   {
  +                    // intentionally left blank
                   }
               }
           }
       }
   
  -    /**
  -     * Description of the Method
  +    /** Extract a file.
  +     *
  +     *  @param fileUtils File util helper.
  +     *  @param srcF The source file to extract.
  +     *  @param dir The directory.
  +     *  @param compressedInputStream The input stream.
  +     *  @param entryName The entry name.
  +     *  @param entryDate The entry date.
  +     *  @param isDirectory Flag indicating if is directory.
  +     *
  +     *  @throws IOException If an error occurs while attempting to
  +     *          extract the file.
        */
       protected void extractFile( FileUtils fileUtils, File srcF, File dir,
                                   InputStream compressedInputStream,
  @@ -146,24 +164,25 @@
                                   Date entryDate, boolean isDirectory )
           throws IOException
       {
  -        File f = fileUtils.resolveFile( dir, entryName );
           try
           {
  +            File f = fileUtils.resolveFile( dir, entryName );
  +            
               if ( !overwrite && f.exists()
  -                && f.lastModified() >= entryDate.getTime() )
  +                 && f.lastModified() >= entryDate.getTime() )
               {
                   //log("Skipping " + f + " as it is up-to-date",
                   //  Project.MSG_DEBUG);
                   return;
               }
  -
  +            
               //log("expanding " + entryName + " to " + f,
               //  Project.MSG_VERBOSE);
               // create intermediary directories - sometimes zip don't add them
               File dirF = f.getParentFile();
               //File dirF = fileUtils.getParentFile(f);
               dirF.mkdirs();
  -
  +            
               if ( isDirectory )
               {
                   f.mkdirs();
  @@ -176,13 +195,13 @@
                   try
                   {
                       fos = new FileOutputStream( f );
  -
  +                    
                       while ( ( length =
  -                        compressedInputStream.read( buffer ) ) >= 0 )
  +                              compressedInputStream.read( buffer ) ) >= 0 )
                       {
                           fos.write( buffer, 0, length );
                       }
  -
  +                    
                       fos.close();
                       fos = null;
                   }
  @@ -196,17 +215,18 @@
                           }
                           catch ( IOException e )
                           {
  +                            // intentionally left blank
                           }
                       }
                   }
               }
  -
  +            
               fileUtils.setFileLastModified( f, entryDate.getTime() );
           }
  -        catch ( FileNotFoundException ex )
  +        catch (FileNotFoundException e)
           {
  +            // intentionally left blank??
           }
  -
       }
   
       /**
  @@ -233,9 +253,12 @@
       /**
        * Should we overwrite files in dest, even if they are newer than the
        * corresponding entries in the archive?
  +     *
  +     *  @param shouldOverwrite <code>true</code> to indicate that files
  +     *         should be overwritten, otherwise <code>false</code>.
        */
  -    public void setOverwrite( boolean b )
  +    public void setOverwrite( boolean shouldOverwrite )
       {
  -        overwrite = b;
  +        overwrite = shouldOverwrite;
       }
   }
  
  
  
  1.11      +21 -15    
jakarta-turbine-maven/src/java/org/apache/maven/util/HttpUtils.java
  
  Index: HttpUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/util/HttpUtils.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- HttpUtils.java    24 Nov 2002 19:00:40 -0000      1.10
  +++ HttpUtils.java    25 Nov 2002 18:30:24 -0000      1.11
  @@ -131,10 +131,18 @@
        *        or null
        * @return true if the retrieval succeeded, false otherwise
        */
  -    public static boolean getFile( URL source, File destinationFile, String file,
  -                                   boolean verbose, boolean ignoreErrors, boolean 
useTimestamp,
  -                                   String uname, String pword,
  -                                   String proxyHost, String proxyPort, String 
proxyUserName, String proxyPassword )
  +    public static boolean getFile( URL source,
  +                                   File destinationFile,
  +                                   String file,
  +                                   boolean verbose,
  +                                   boolean ignoreErrors,
  +                                   boolean useTimestamp,
  +                                   String uname,
  +                                   String pword,
  +                                   String proxyHost,
  +                                   String proxyPort,
  +                                   String proxyUserName,
  +                                   String proxyPassword )
       {
           boolean retrievedFile = false;
           try
  @@ -185,8 +193,8 @@
                       // auth and we will eventually move over httpclient
                       // in the commons.
                   }
  -                connection.setRequestProperty( "Authorization", "Basic " +
  -                                                                encoding );
  +                connection.setRequestProperty( "Authorization",
  +                                               "Basic " + encoding );
               }
   
               //connect to the remote site (may take some time)
  @@ -196,8 +204,7 @@
               {
                   HttpURLConnection httpConnection = (HttpURLConnection)
                       connection;
  -                if ( httpConnection.getResponseCode() ==
  -                    HttpURLConnection.HTTP_NOT_MODIFIED )
  +                if ( httpConnection.getResponseCode() == 
HttpURLConnection.HTTP_NOT_MODIFIED )
                   {
                       //not modified so no file download. just return instead
                       //and trace out something so the user doesn't think that the
  @@ -210,11 +217,9 @@
                       return true;
                   }
                   // test for 401 result (HTTP only)
  -                if ( httpConnection.getResponseCode() ==
  -                    HttpURLConnection.HTTP_UNAUTHORIZED )
  +                if ( httpConnection.getResponseCode() == 
HttpURLConnection.HTTP_UNAUTHORIZED )
                   {
  -                    logx( "Not authorized - check " + destinationFile +
  -                          " for details" );
  +                    logx( "Not authorized - check " + destinationFile + " for 
details" );
                       return false;
                   }
               }
  @@ -275,9 +280,10 @@
                   if ( verbose )
                   {
                       Date t = new Date( remoteTimestamp );
  -                    logx( "last modified = " + t.toString() +
  -                          ( ( remoteTimestamp == 0 ) ?
  -                            " - using current time instead" : "" ) );
  +                    logx( "last modified = " + t.toString()
  +                          + ( ( remoteTimestamp == 0 )
  +                              ? " - using current time instead"
  +                              : "" ) );
                   }
                   if ( remoteTimestamp != 0 )
                   {
  
  
  
  1.6       +85 -17    jakarta-turbine-maven/src/java/org/apache/maven/util/MD5Sum.java
  
  Index: MD5Sum.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/util/MD5Sum.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MD5Sum.java       24 Nov 2002 19:00:40 -0000      1.5
  +++ MD5Sum.java       25 Nov 2002 18:30:24 -0000      1.6
  @@ -1,5 +1,61 @@
   package org.apache.maven.util;
   
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Apache" and "Apache Software Foundation" and
  + *    "Apache Maven" must not be used to endorse or promote products
  + *    derived from this software without prior written permission. For
  + *    written permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    "Apache Maven", nor may "Apache" appear in their name, without
  + *    prior written permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + *
  + * ====================================================================
  + */
  +
   import java.io.ByteArrayOutputStream;
   import java.io.File;
   import java.io.FileInputStream;
  @@ -19,45 +75,50 @@
    */
   public class MD5Sum
   {
  -    /**
  -     * File that will be checksummed.
  -     */
  +    /** File that will be checksummed. */
       private File file;
   
  -    /**
  -     * Checksum
  -     */
  +    /** Checksum */
       private String checksum;
   
  +    /** Hex digits. */
       private static final char[] hexadecimal =
           {
               '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
               'a', 'b', 'c', 'd', 'e', 'f'
           };
   
  -    /**
  -     * Set the file to perform the checksum on.
  +    /** Set the file to perform the checksum on.
  +     *
  +     *  @param file The file.
        */
       public void setFile( File file )
       {
           this.file = file;
       }
   
  -    /**
  -     * Get the file that the checksum will be perform on.
  +    /** Get the file that the checksum will be perform on.
  +     *
  +     *  @return the file.
        */
       public File getFile()
       {
           return file;
       }
   
  -    /** Set the checksum */
  +    /** Set the checksum
  +     *
  +     *  @param checksum The checksum.
  +     */
       public void setChecksum( String checksum )
       {
           this.checksum = checksum;
       }
   
  -    /** Get the checksum */
  +    /** Get the checksum
  +     *
  +     *  @return The calculated checksum.
  +     */
       public String getChecksum()
       {
           return checksum;
  @@ -67,6 +128,7 @@
        * Encodes the 128 bit (16 bytes) MD5 into a 32 character String.
        *
        * @param binaryData Array containing the digest
  +     *
        * @return Encoded MD5, or null if encoding failed
        */
       public String encode( byte[] binaryData )
  @@ -90,8 +152,13 @@
           return new String( buffer );
       }
   
  -    /**
  -     * Pull in static content and store it
  +    /** Pull in static content and store it
  +     *
  +     *  @param file The file to read.
  +     *
  +     *  @return The bytes of the file.
  +     *
  +     *  @throws Exception If an error occurs reading in the file's bytes.
        */
       public byte[] getBytes( File file )
           throws Exception
  @@ -110,8 +177,9 @@
           return baos.toByteArray();
       }
   
  -    /**
  -     * The main program for the MD5Sum class
  +    /** Perform the MD5-Sum work.
  +     *
  +     *  @throws Exception If an error occurs while calculating the sum.
        */
       public void execute()
           throws Exception
  
  
  
  1.4       +7 -5      
jakarta-turbine-maven/src/java/org/apache/maven/util/StringInputStream.java
  
  Index: StringInputStream.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/util/StringInputStream.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StringInputStream.java    24 Nov 2002 19:00:40 -0000      1.3
  +++ StringInputStream.java    25 Nov 2002 18:30:24 -0000      1.4
  @@ -3,7 +3,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -26,13 +26,13 @@
    *    if and wherever such third-party acknowledgments normally appear.
    *
    * 4. The names "Apache" and "Apache Software Foundation" and
  - *    "Ant" must not be used to endorse or promote products
  + *    "Apache Maven" must not be used to endorse or promote products
    *    derived from this software without prior written permission. For
    *    written permission, please contact [EMAIL PROTECTED]
    *
  - * 5. Products derived from this software may not be called "Apache"
  - *    nor may "Apache" appear in their names without prior written
  - *    permission of the Apache Group.
  + * 5. Products derived from this software may not be called "Apache",
  + *    "Apache Maven", nor may "Apache" appear in their name, without
  + *    prior written permission of the Apache Software Foundation.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  @@ -52,6 +52,8 @@
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * ====================================================================
    */
   
   import java.io.IOException;
  
  
  

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

Reply via email to