From 44efc72e44c864b96d9655f1b8ba53114003d14e Mon Sep 17 00:00:00 2001 From: dims Date: Mon, 6 Dec 2004 16:49:40 +0000 Subject: [PATCH] enum ==> en (for JDK1.5) git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@226175 13f79535-47bb-0310-9956-ffa450edef68 --- java/src/org/apache/xml/resolver/Catalog.java | 120 +++++++++--------- .../src/org/apache/xml/resolver/Resolver.java | 30 ++--- 2 files changed, 75 insertions(+), 75 deletions(-) diff --git a/java/src/org/apache/xml/resolver/Catalog.java b/java/src/org/apache/xml/resolver/Catalog.java index 5f12324..bc4474e 100644 --- a/java/src/org/apache/xml/resolver/Catalog.java +++ b/java/src/org/apache/xml/resolver/Catalog.java @@ -486,9 +486,9 @@ public class Catalog { 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 @@ public class Catalog { } // 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 @@ public class Catalog { // 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 @@ public class Catalog { 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 @@ public class Catalog { // 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 @@ public class Catalog { // 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 @@ public class Catalog { // 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 @@ public class Catalog { // 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; @@ -1626,21 +1626,21 @@ public class Catalog { } if (delCats.size() > 0) { - Enumeration enumCats = delCats.elements(); + Enumeration enCats = delCats.elements(); if (catalogManager.debug.getDebug() > 1) { catalogManager.debug.message(2, "Switching to delegated catalog(s):"); - while (enumCats.hasMoreElements()) { - String delegatedCatalog = (String) enumCats.nextElement(); + while (enCats.hasMoreElements()) { + String delegatedCatalog = (String) enCats.nextElement(); catalogManager.debug.message(2, "\t" + delegatedCatalog); } } Catalog dcat = newCatalog(); - enumCats = delCats.elements(); - while (enumCats.hasMoreElements()) { - String delegatedCatalog = (String) enumCats.nextElement(); + enCats = delCats.elements(); + while (enCats.hasMoreElements()) { + String delegatedCatalog = (String) enCats.nextElement(); dcat.parseCatalog(delegatedCatalog); } @@ -1712,9 +1712,9 @@ public class Catalog { 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 @@ public class Catalog { } // 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 @@ public class Catalog { } // 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); @@ -1767,21 +1767,21 @@ public class Catalog { } if (delCats.size() > 0) { - Enumeration enumCats = delCats.elements(); + Enumeration enCats = delCats.elements(); if (catalogManager.debug.getDebug() > 1) { catalogManager.debug.message(2, "Switching to delegated catalog(s):"); - while (enumCats.hasMoreElements()) { - String delegatedCatalog = (String) enumCats.nextElement(); + while (enCats.hasMoreElements()) { + String delegatedCatalog = (String) enCats.nextElement(); catalogManager.debug.message(2, "\t" + delegatedCatalog); } } Catalog dcat = newCatalog(); - enumCats = delCats.elements(); - while (enumCats.hasMoreElements()) { - String delegatedCatalog = (String) enumCats.nextElement(); + enCats = delCats.elements(); + while (enCats.hasMoreElements()) { + String delegatedCatalog = (String) enCats.nextElement(); dcat.parseCatalog(delegatedCatalog); } @@ -1846,9 +1846,9 @@ public class Catalog { */ 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 @@ public class Catalog { } // 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 @@ public class Catalog { } // 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); @@ -1899,21 +1899,21 @@ public class Catalog { } if (delCats.size() > 0) { - Enumeration enumCats = delCats.elements(); + Enumeration enCats = delCats.elements(); if (catalogManager.debug.getDebug() > 1) { catalogManager.debug.message(2, "Switching to delegated catalog(s):"); - while (enumCats.hasMoreElements()) { - String delegatedCatalog = (String) enumCats.nextElement(); + while (enCats.hasMoreElements()) { + String delegatedCatalog = (String) enCats.nextElement(); catalogManager.debug.message(2, "\t" + delegatedCatalog); } } Catalog dcat = newCatalog(); - enumCats = delCats.elements(); - while (enumCats.hasMoreElements()) { - String delegatedCatalog = (String) enumCats.nextElement(); + enCats = delCats.elements(); + while (enCats.hasMoreElements()) { + String delegatedCatalog = (String) enCats.nextElement(); dcat.parseCatalog(delegatedCatalog); } diff --git a/java/src/org/apache/xml/resolver/Resolver.java b/java/src/org/apache/xml/resolver/Resolver.java index 621f50c..54fa21b 100644 --- a/java/src/org/apache/xml/resolver/Resolver.java +++ b/java/src/org/apache/xml/resolver/Resolver.java @@ -197,9 +197,9 @@ public class Resolver extends Catalog { 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 @@ public class Resolver extends Catalog { 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 @@ public class Resolver extends Catalog { 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 @@ public class Resolver extends Catalog { 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 @@ public class Resolver extends Catalog { 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