Return-Path: Delivered-To: apmail-xml-commons-dev-archive@www.apache.org Received: (qmail 3970 invoked from network); 6 Dec 2004 16:49:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Dec 2004 16:49:54 -0000 Received: (qmail 59099 invoked by uid 500); 6 Dec 2004 16:49:53 -0000 Delivered-To: apmail-xml-commons-dev-archive@xml.apache.org Received: (qmail 59060 invoked by uid 500); 6 Dec 2004 16:49:53 -0000 Mailing-List: contact commons-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list commons-dev@xml.apache.org Received: (qmail 59047 invoked by uid 99); 6 Dec 2004 16:49:52 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of davanum@gmail.com designates 64.233.170.206 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.206) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 06 Dec 2004 08:49:51 -0800 Received: by rproxy.gmail.com with SMTP id y7so277597rne for ; Mon, 06 Dec 2004 08:49:49 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=umIT8mwCSO6W34t9IKNse2I65aFl1Df2VPUNuEW0LACCb1NAYp4PIj1IAaIgWcXEos+5oWZEQifQpNTJt3ct1hFXJ25DMZT1E2Rb1qQxXE2OD1CN/ij130j4+8obki017DiPhCC0aRmA6QHLHyykW9zd0pwphqb0EBXi2/XPm5w= Received: by 10.38.101.37 with SMTP id y37mr552838rnb; Mon, 06 Dec 2004 08:49:49 -0800 (PST) Received: by 10.38.171.49 with HTTP; Mon, 6 Dec 2004 08:49:49 -0800 (PST) Message-ID: <19e0530f0412060849712f462c@mail.gmail.com> Date: Mon, 6 Dec 2004 11:49:49 -0500 From: Davanum Srinivas Reply-To: dims@apache.org To: Stefan Bodewig Subject: Re: [PATCH] Make resolver compile on Java 5 (or whatever it is called) Cc: commons-dev@xml.apache.org In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N done. On Mon, 06 Dec 2004 15:58:53 +0100, Stefan Bodewig 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/