xml-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davanum Srinivas <dava...@gmail.com>
Subject Re: [PATCH] Make resolver compile on Java 5 (or whatever it is called)
Date Mon, 06 Dec 2004 16:49:49 GMT
done.


On Mon, 06 Dec 2004 15:58:53 +0100, Stefan Bodewig <bodewig@apache.org> wrote:
> Hi,
> 
> the appended trivial patch replaces some "enum"s with "en"s and allows
> resolver to compile on JDK 1.5 out of the box.
> 
> Since Xerces now depends on resolver, resolver has moved very high up
> in Gump's dependency chain and our JDK 1.5 builds are going to be very
> short as long as we don't manage to build resolver.  8-(
> 
> Cheers
> 
>         Stefan
> 
> Index: src/org/apache/xml/resolver/Catalog.java
> ===================================================================
> RCS file: /home/cvspublic/xml-commons/java/src/org/apache/xml/resolver/Catalog.java,v
> retrieving revision 1.7
> diff -u -r1.7 Catalog.java
> --- src/org/apache/xml/resolver/Catalog.java    2 Sep 2003 07:05:07 -0000       1.7
> +++ src/org/apache/xml/resolver/Catalog.java    6 Dec 2004 14:52:42 -0000
> @@ -486,9 +486,9 @@
>        mapArr.add(null);
>      }
> 
> -    Enumeration enum = readerMap.keys();
> -    while (enum.hasMoreElements()) {
> -      String mimeType = (String) enum.nextElement();
> +    Enumeration en = readerMap.keys();
> +    while (en.hasMoreElements()) {
> +      String mimeType = (String) en.nextElement();
>        Integer pos = (Integer) readerMap.get(mimeType);
>        mapArr.set(pos.intValue(), mimeType);
>      }
> @@ -1152,9 +1152,9 @@
>      }
> 
>      // Parse all the DELEGATE catalogs
> -    Enumeration enum = catalogEntries.elements();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    Enumeration en = catalogEntries.elements();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
>        if (e.getEntryType() == DELEGATE_PUBLIC
>           || e.getEntryType() == DELEGATE_SYSTEM
>           || e.getEntryType() == DELEGATE_URI) {
> @@ -1228,9 +1228,9 @@
> 
>      // If there's a DOCTYPE entry in this catalog, use it
>      boolean over = default_override;
> -    Enumeration enum = catalogEntries.elements();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    Enumeration en = catalogEntries.elements();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
>        if (e.getEntryType() == OVERRIDE) {
>         over = e.getEntryArg(0).equalsIgnoreCase("YES");
>         continue;
> @@ -1266,9 +1266,9 @@
> 
>      catalogManager.debug.message(3, "resolveDocument");
> 
> -    Enumeration enum = catalogEntries.elements();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    Enumeration en = catalogEntries.elements();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
>        if (e.getEntryType() == DOCUMENT) {
>         return e.getEntryArg(1); //FIXME check this
>        }
> @@ -1341,9 +1341,9 @@
> 
>      // If there's a ENTITY entry in this catalog, use it
>      boolean over = default_override;
> -    Enumeration enum = catalogEntries.elements();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    Enumeration en = catalogEntries.elements();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
>        if (e.getEntryType() == OVERRIDE) {
>         over = e.getEntryArg(0).equalsIgnoreCase("YES");
>         continue;
> @@ -1427,9 +1427,9 @@
> 
>      // If there's a NOTATION entry in this catalog, use it
>      boolean over = default_override;
> -    Enumeration enum = catalogEntries.elements();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    Enumeration en = catalogEntries.elements();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
>        if (e.getEntryType() == OVERRIDE) {
>         over = e.getEntryArg(0).equalsIgnoreCase("YES");
>         continue;
> @@ -1586,9 +1586,9 @@
> 
>      // If there's a PUBLIC entry in this catalog, use it
>      boolean over = default_override;
> -    Enumeration enum = catalogEntries.elements();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    Enumeration en = catalogEntries.elements();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
>        if (e.getEntryType() == OVERRIDE) {
>         over = e.getEntryArg(0).equalsIgnoreCase("YES");
>         continue;
> @@ -1604,10 +1604,10 @@
> 
>      // If there's a DELEGATE_PUBLIC entry in this catalog, use it
>      over = default_override;
> -    enum = catalogEntries.elements();
> +    en = catalogEntries.elements();
>      Vector delCats = new Vector();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
>        if (e.getEntryType() == OVERRIDE) {
>         over = e.getEntryArg(0).equalsIgnoreCase("YES");
>         continue;
> @@ -1712,9 +1712,9 @@
> 
>      String osname = System.getProperty("os.name");
>      boolean windows = (osname.indexOf("Windows") >= 0);
> -    Enumeration enum = catalogEntries.elements();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    Enumeration en = catalogEntries.elements();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
>        if (e.getEntryType() == SYSTEM
>           && (e.getEntryArg(0).equals(systemId)
>               || (windows
> @@ -1724,11 +1724,11 @@
>      }
> 
>      // If there's a REWRITE_SYSTEM entry in this catalog, use it
> -    enum = catalogEntries.elements();
> +    en = catalogEntries.elements();
>      String startString = null;
>      String prefix = null;
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
> 
>        if (e.getEntryType() == REWRITE_SYSTEM) {
>         String p = (String) e.getEntryArg(0);
> @@ -1750,10 +1750,10 @@
>      }
> 
>      // If there's a DELEGATE_SYSTEM entry in this catalog, use it
> -    enum = catalogEntries.elements();
> +    en = catalogEntries.elements();
>      Vector delCats = new Vector();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
> 
>        if (e.getEntryType() == DELEGATE_SYSTEM) {
>         String p = (String) e.getEntryArg(0);
> @@ -1846,9 +1846,9 @@
>     */
>    protected String resolveLocalURI(String uri)
>      throws MalformedURLException, IOException {
> -    Enumeration enum = catalogEntries.elements();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    Enumeration en = catalogEntries.elements();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
>        if (e.getEntryType() == URI
>           && (e.getEntryArg(0).equals(uri))) {
>         return e.getEntryArg(1);
> @@ -1856,11 +1856,11 @@
>      }
> 
>      // If there's a REWRITE_URI entry in this catalog, use it
> -    enum = catalogEntries.elements();
> +    en = catalogEntries.elements();
>      String startString = null;
>      String prefix = null;
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
> 
>        if (e.getEntryType() == REWRITE_URI) {
>         String p = (String) e.getEntryArg(0);
> @@ -1882,10 +1882,10 @@
>      }
> 
>      // If there's a DELEGATE_URI entry in this catalog, use it
> -    enum = catalogEntries.elements();
> +    en = catalogEntries.elements();
>      Vector delCats = new Vector();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
> 
>        if (e.getEntryType() == DELEGATE_URI) {
>         String p = (String) e.getEntryArg(0);
> Index: src/org/apache/xml/resolver/Resolver.java
> ===================================================================
> RCS file: /home/cvspublic/xml-commons/java/src/org/apache/xml/resolver/Resolver.java,v
> retrieving revision 1.5
> diff -u -r1.5 Resolver.java
> --- src/org/apache/xml/resolver/Resolver.java   2 Sep 2003 07:05:07 -0000       1.5
> +++ src/org/apache/xml/resolver/Resolver.java   6 Dec 2004 14:52:42 -0000
> @@ -197,9 +197,9 @@
>        return resolved;
>      }
> 
> -    Enumeration enum = catalogEntries.elements();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    Enumeration en = catalogEntries.elements();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
>        if (e.getEntryType() == RESOLVER) {
>         resolved = resolveExternalSystem(uri, e.getEntryArg(0));
>         if (resolved != null) {
> @@ -254,9 +254,9 @@
>        return resolved;
>      }
> 
> -    Enumeration enum = catalogEntries.elements();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    Enumeration en = catalogEntries.elements();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
>        if (e.getEntryType() == RESOLVER) {
>         resolved = resolveExternalSystem(systemId, e.getEntryArg(0));
>         if (resolved != null) {
> @@ -316,9 +316,9 @@
>        return resolved;
>      }
> 
> -    Enumeration enum = catalogEntries.elements();
> -    while (enum.hasMoreElements()) {
> -      CatalogEntry e = (CatalogEntry) enum.nextElement();
> +    Enumeration en = catalogEntries.elements();
> +    while (en.hasMoreElements()) {
> +      CatalogEntry e = (CatalogEntry) en.nextElement();
>        if (e.getEntryType() == RESOLVER) {
>         if (systemId != null) {
>           resolved = resolveExternalSystem(systemId,
> @@ -557,9 +557,9 @@
>         Vector map = new Vector();
>         String osname = System.getProperty("os.name");
>         boolean windows = (osname.indexOf("Windows") >= 0);
> -       Enumeration enum = catalogEntries.elements();
> -       while (enum.hasMoreElements()) {
> -           CatalogEntry e = (CatalogEntry) enum.nextElement();
> +       Enumeration en = catalogEntries.elements();
> +       while (en.hasMoreElements()) {
> +           CatalogEntry e = (CatalogEntry) en.nextElement();
>             if (e.getEntryType() == SYSTEM
>                 && (e.getEntryArg(0).equals(systemId)
>                     || (windows
> @@ -585,9 +585,9 @@
>         Vector map = new Vector();
>         String osname = System.getProperty("os.name");
>         boolean windows = (osname.indexOf("Windows") >= 0);
> -       Enumeration enum = catalogEntries.elements();
> -       while (enum.hasMoreElements()) {
> -           CatalogEntry e = (CatalogEntry) enum.nextElement();
> +       Enumeration en = catalogEntries.elements();
> +       while (en.hasMoreElements()) {
> +           CatalogEntry e = (CatalogEntry) en.nextElement();
>             if (e.getEntryType() == SYSTEM
>                 && (e.getEntryArg(1).equals(systemId)
>                     || (windows
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

Mime
View raw message