db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: db-torque/src/generator/src/java/org/apache/torque/engine/database/transform DTDResolver.java
Date Thu, 31 Jul 2003 16:04:06 GMT
dlr         2003/07/31 09:04:06

  Modified:    src/generator/src/java/org/apache/torque/engine/database/transform
                        DTDResolver.java
  Log:
  * src/generator/src/java/org/apache/torque/engine/database/transform/DTDResolver.java
    resolveEntity(): Improved header JavaDoc and logging.
  
    getInputSource(): Obviated the need for the local "src" variable by
    returning directly.  The need for this entire method is...quesitonable.
  
  Revision  Changes    Path
  1.9       +12 -13    db-torque/src/generator/src/java/org/apache/torque/engine/database/transform/DTDResolver.java
  
  Index: DTDResolver.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/database/transform/DTDResolver.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -u -r1.8 -r1.9
  --- DTDResolver.java	28 Jul 2003 16:34:27 -0000	1.8
  +++ DTDResolver.java	31 Jul 2003 16:04:06 -0000	1.9
  @@ -114,11 +114,13 @@
       }
   
       /**
  -     * called by the XML parser
  +     * An implementation of the SAX <code>EntityResolver</code>
  +     * interface to be called by the XML parser.
        *
        * @param publicId The public identifier of the external entity
        * @param systemId The system identifier of the external entity
  -     * @return an InputSource for the database.dtd file
  +     * @return An <code>InputSource</code> for the
  +     * <code>database.dtd</code> file.
        */
       public InputSource resolveEntity(String publicId, String systemId)
               throws IOException
  @@ -126,21 +128,19 @@
           if (databaseDTD != null && WEB_SITE_DTD.equals(systemId))
           {
               String pkg = getClass().getName().substring(0,
  -                    getClass().getName().lastIndexOf("."));
  -
  -            log.info("Resolver: used database.dtd from "
  -                    + pkg + " package ");
  -
  +                    getClass().getName().lastIndexOf('.'));
  +            log.info("Resolver: used database.dtd from '"
  +                     + pkg + "' package");
               return databaseDTD;
           }
  -        else if (systemId == null)
  +        else if (systemId == null || "".equals(systemId.trim()))
           {
  -            log.info("Resolver: used " + WEB_SITE_DTD);
  +            log.info("Resolver: used '" + WEB_SITE_DTD + '\'');
               return getInputSource(WEB_SITE_DTD);
           }
           else
           {
  -            log.info("Resolver: used " + systemId);
  +            log.info("Resolver: used '" + systemId + '\'');
               return getInputSource(systemId);
           }
       }
  @@ -155,7 +155,6 @@
               throws IOException
       {
           URL url = new URL(urlString);
  -        InputSource src = new InputSource(url.openStream());
  -        return src;
  +        return new InputSource(url.openStream());
       }
   }
  
  
  

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


Mime
View raw message