ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml ValidatorErrorHandler.java
Date Sun, 17 Feb 2002 10:02:37 GMT
donaldp     02/02/17 02:02:37

  Modified:    proposal/myrmidon/src/java/org/apache/antlib/xml
                        ValidatorErrorHandler.java
  Log:
  touchups
  
  Revision  Changes    Path
  1.3       +12 -11    jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml/ValidatorErrorHandler.java
  
  Index: ValidatorErrorHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml/ValidatorErrorHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ValidatorErrorHandler.java	26 Jan 2002 12:09:09 -0000	1.2
  +++ ValidatorErrorHandler.java	17 Feb 2002 10:02:37 -0000	1.3
  @@ -7,12 +7,12 @@
    */
   package org.apache.antlib.xml;
   
  -import java.io.File;
   import java.net.MalformedURLException;
   import java.net.URL;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.xml.sax.ErrorHandler;
   import org.xml.sax.SAXParseException;
  +import javax.xml.transform.ErrorListener;
   
   /*
    * ValidatorErrorHandler role :
  @@ -25,9 +25,8 @@
       extends AbstractLogEnabled
       implements ErrorHandler
   {
  -    private File m_file;
  -    private boolean m_failed;
       private final boolean m_warn;
  +    private boolean m_failed;
   
       protected ValidatorErrorHandler( final boolean warn )
       {
  @@ -56,9 +55,8 @@
           }
       }
   
  -    protected void init( final File file )
  +    protected void reset()
       {
  -        m_file = file;
           m_failed = false;
       }
   
  @@ -70,19 +68,22 @@
   
       private String getMessage( final SAXParseException spe )
       {
  -        final String sysID = spe.getSystemId();
  -        if( sysID != null )
  +        final String systemID = spe.getSystemId();
  +        if( null != systemID )
           {
  +            final int line = spe.getLineNumber();
  +            final int col = spe.getColumnNumber();
  +
               try
               {
  -                final int line = spe.getLineNumber();
  -                final int col = spe.getColumnNumber();
  -                return new URL( sysID ).getFile() +
  +                //Build a message using standard compiler
  +                //error format
  +                return new URL( systemID ).getFile() +
                       ( line == -1 ? "" : ( ":" + line +
                       ( col == -1 ? "" : ( ":" + col ) ) ) ) +
                       ": " + spe.getMessage();
               }
  -            catch( MalformedURLException mfue )
  +            catch( final MalformedURLException mue )
               {
               }
           }
  
  
  

--
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