logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject cvs commit: logging-log4j/src/java/org/apache/joran Interpreter.java
Date Thu, 27 May 2004 08:45:06 GMT
ceki        2004/05/27 01:45:06

  Modified:    src/java/org/apache/joran Interpreter.java
  Log:
  Dancing around the discrepancies between the original SAX package and
  the one included in the JDK.
  
  Revision  Changes    Path
  1.12      +15 -3     logging-log4j/src/java/org/apache/joran/Interpreter.java
  
  Index: Interpreter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/joran/Interpreter.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Interpreter.java	26 May 2004 17:56:18 -0000	1.11
  +++ Interpreter.java	27 May 2004 08:45:06 -0000	1.12
  @@ -295,16 +295,28 @@
      * If a specific entityResolver is set for this Interpreter instance, then 
      * we use it to resolve entities. Otherwise, we use the default implementation
      * offered by the super class.
  +   * 
  +   * <p>Due to inexplicable voodoo, the original resolveEntity method in 
  +   * org.xml.sax.helpers.DefaultHandler declares throwing an IOException, 
  +   * whereas the org.xml.sax.helpers.DefaultHandler class included in
  +   * JDK 1.4 masks this exception.
  +   * 
  +   * <p>In order to compile under JDK 1.4, we are forced to mask the IOException
  +   * as well. Since its signatures varies, we cannot call our super class' 
  +   * resolveEntity method. We are forced to implement the default behavior 
  +   * ourselves, which in this case, is just returning null.
  +   * 
      */
     public InputSource resolveEntity(String publicId, String systemId) throws SAXException
{
       if(entityResolver == null) {
  -      return super.resolveEntity(publicId, systemId);
  +      // the default implementation is to return null
  +      return null;
       } else {
         try {
           return entityResolver.resolveEntity(publicId, systemId);
         } catch(IOException ioe) {
  -        // fall back to the default implementation
  -        return super.resolveEntity(publicId, systemId);
  +        // fall back to the default "implementation"
  +        return null;
         }
       }
     }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message