tcopeland    02/05/22 10:59:00

  Modified:    src/java/org/apache/maven/jxr CodeTransform.java
                        DirectoryIndexer.java JXR.java
  Log:
  Misc fixes: closing streams in finally blocks, removing unused vars, etc
  
  Revision  Changes    Path
  1.11      +0 -6      
jakarta-turbine-maven/src/java/org/apache/maven/jxr/CodeTransform.java
  
  Index: CodeTransform.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jxr/CodeTransform.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- CodeTransform.java        18 Apr 2002 17:43:34 -0000      1.10
  +++ CodeTransform.java        22 May 2002 17:59:00 -0000      1.11
  @@ -135,13 +135,8 @@
        */
       public final static char[] VALID_URI_CHARS = {'?', '+', '%', '&', ':', '/', 
'.', '@', '_'};
   
  -    private BufferedReader in;
  -    private StringBuffer out;
  -    //private HashMap reservedWords = new HashMap();
       private Hashtable reservedWords = new Hashtable();
  -
       private boolean inMultiLineComment = false;
  -
       private boolean inJavadocComment = false;
   
       /**
  @@ -198,7 +193,6 @@
        */
       private final String htmlFilter(String line)
       {
  -        StringBuffer buf = new StringBuffer();
           if (line == null || line.equals(""))
           {
               return "";
  
  
  
  1.11      +19 -15    
jakarta-turbine-maven/src/java/org/apache/maven/jxr/DirectoryIndexer.java
  
  Index: DirectoryIndexer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jxr/DirectoryIndexer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DirectoryIndexer.java     19 Apr 2002 04:35:35 -0000      1.10
  +++ DirectoryIndexer.java     22 May 2002 17:59:00 -0000      1.11
  @@ -73,7 +73,7 @@
    * Handles building a directory index of files and directories.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Kevin A. Burton</a>
  - * @version $Id: DirectoryIndexer.java,v 1.10 2002/04/19 04:35:35 jvanzyl Exp $
  + * @version $Id: DirectoryIndexer.java,v 1.11 2002/05/22 17:59:00 tcopeland Exp $
    */
   public class DirectoryIndexer
   {
  @@ -466,20 +466,24 @@
           throws IOException
       {
   
  -        InputStream is = new FileInputStream(source);
  -        OutputStream os = new FileOutputStream(dest);
  -
  -        //now process the InputStream...
  -        byte bytes[] = new byte[200];
  -
  -        int readCount = 0;
  -        while ((readCount = is.read(bytes)) > 0)
  -        {
  -            os.write(bytes, 0, readCount);
  -        }
  -
  -        is.close();
  -        os.close();
  +                             InputStream is = null;
  +                             OutputStream os = null;
  +                             try {
  +             is = new FileInputStream(source);
  +             os = new FileOutputStream(dest);
  +
  +             //now process the InputStream...
  +             byte bytes[] = new byte[200];
  +     
  +             int readCount = 0;
  +             while ((readCount = is.read(bytes)) > 0)
  +             {
  +                 os.write(bytes, 0, readCount);
  +             }
  +                             } finally {
  +             if (is != null) {is.close();}
  +             if (os != null) {os.close();}
  +                             }
   
       }
   
  
  
  
  1.10      +1 -11     jakarta-turbine-maven/src/java/org/apache/maven/jxr/JXR.java
  
  Index: JXR.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jxr/JXR.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JXR.java  18 Apr 2002 17:43:34 -0000      1.9
  +++ JXR.java  22 May 2002 17:59:00 -0000      1.10
  @@ -63,7 +63,7 @@
    * Main entry point into Maven used to kick off the XReference code building.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Kevin A. Burton</a>
  - * @version $Id: JXR.java,v 1.9 2002/04/18 17:43:34 jvanzyl Exp $
  + * @version $Id: JXR.java,v 1.10 2002/05/22 17:59:00 tcopeland Exp $
    */
   public class JXR
   {
  @@ -259,16 +259,6 @@
       private void log(String message)
       {
           System.out.println("\t" + message);
  -    }
  -
  -    /**
  -     * Get an array of files that you should act on.
  -     *
  -     * @return String[] An array of files to act on.
  -     */
  -    private String[] getFiles()
  -    {
  -        return new String[0];
       }
   
       /**
  
  
  

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

Reply via email to