ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs FixCRLF.java
Date Fri, 08 Nov 2002 15:01:58 GMT
bodewig     2002/11/08 07:01:58

  Modified:    src/main/org/apache/tools/ant/taskdefs Tag: ANT_15_BRANCH
                        FixCRLF.java
  Log:
  Merge fix for PR14061 from HEAD
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.37.2.3  +12 -8     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
  
  Index: FixCRLF.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java,v
  retrieving revision 1.37.2.2
  retrieving revision 1.37.2.3
  diff -u -r1.37.2.2 -r1.37.2.3
  --- FixCRLF.java	19 Jun 2002 02:17:27 -0000	1.37.2.2
  +++ FixCRLF.java	8 Nov 2002 15:01:58 -0000	1.37.2.3
  @@ -299,7 +299,7 @@
       public void setTablength(int tlength) throws BuildException {
           if (tlength < 2 || tlength > 80) {
               throw new BuildException("tablength must be between 2 and 80",
  -                                     location);
  +                                     getLocation());
           }
           tablength = tlength;
           StringBuffer sp = new StringBuffer();
  @@ -449,7 +449,7 @@
                               break;
   
                           case IN_MULTI_COMMENT:
  -                            endComment 
  +                            endComment
                                   = lineString.indexOf("*/", line.getNext());
                               if (endComment >= 0) {
                                   // End of multiLineComment on this line
  @@ -486,7 +486,7 @@
                                   if (line.getNextCharInc() == '\t') {
                                       line.setColumn(line.getColumn() +
                                                      tablength -
  -                                                   (line.getColumn() 
  +                                                   (line.getColumn()
                                                       % tablength));
                                   } else {
                                       line.incColumn();
  @@ -495,7 +495,7 @@
   
                               // Now output the substring
                               try {
  -                                outWriter.write(line.substring(begin, 
  +                                outWriter.write(line.substring(begin,
                                                                  line.getNext()));
                               } catch (IOException e) {
                                   throw new BuildException(e);
  @@ -547,7 +547,7 @@
                   lines.close();
                   lines = null;
               } catch (IOException e) {
  -                throw new BuildException("Unable to close source file " 
  +                throw new BuildException("Unable to close source file "
                                            + srcFile);
               }
   
  @@ -807,15 +807,18 @@
           private BufferedReader reader;
           private StringBuffer line = new StringBuffer();
           private boolean reachedEof = false;
  +        private File srcFile;
   
           public OneLiner(File srcFile)
               throws BuildException {
  +            this.srcFile = srcFile;
               try {
                   reader = new BufferedReader
                           (getReader(srcFile), INBUFLEN);
                   nextLine();
               } catch (IOException e) {
  -                throw new BuildException(e);
  +                throw new BuildException(srcFile + ": "+ e.getMessage(),
  +                                         e, getLocation());
               }
           }
   
  @@ -899,7 +902,8 @@
                   } // end of if (eolcount == 0)
   
               } catch (IOException e) {
  -                throw new BuildException(e);
  +                throw new BuildException(srcFile + ": "+ e.getMessage(),
  +                                         e, getLocation());
               }
           }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message