You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stefan Bodewig <bo...@apache.org> on 2005/01/26 16:26:02 UTC

[ATTRIBUTES] make it compile on JDK 1.5

subject says it all.  Some trivial "enum" replacements.

Stefan

Index: api/src/java/org/apache/commons/attributes/AttributeIndex.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/AttributeIndex.java,v
retrieving revision 1.2
diff -u -r1.2 AttributeIndex.java
--- api/src/java/org/apache/commons/attributes/AttributeIndex.java	27 Aug 2004 21:30:10 -0000	1.2
+++ api/src/java/org/apache/commons/attributes/AttributeIndex.java	26 Jan 2005 15:24:48 -0000
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2003-2005 The Apache Software Foundation
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -219,9 +219,9 @@
      */
     public AttributeIndex (ClassLoader cl) throws Exception {
         this.classLoader = cl;
-        Enumeration enum = cl.getResources ("META-INF/attrs.index");
-        while (enum.hasMoreElements ()) {
-            URL url = (URL) enum.nextElement ();
+        Enumeration e = cl.getResources ("META-INF/attrs.index");
+        while (e.hasMoreElements ()) {
+            URL url = (URL) e.nextElement ();
             loadFromURL (url);
         }
         
Index: compiler/src/java/org/apache/commons/attributes/compiler/AttributeIndexer.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/attributes/compiler/src/java/org/apache/commons/attributes/compiler/AttributeIndexer.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 AttributeIndexer.java
--- compiler/src/java/org/apache/commons/attributes/compiler/AttributeIndexer.java	6 Jul 2004 20:42:04 -0000	1.1.1.1
+++ compiler/src/java/org/apache/commons/attributes/compiler/AttributeIndexer.java	26 Jan 2005 15:24:48 -0000
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2003-2005 The Apache Software Foundation
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -150,9 +150,9 @@
             File newJarFile = new File (jarFile.getPath () + ".new");
             JarOutputStream output = new JarOutputStream (new FileOutputStream (newJarFile));
             try {
-                Enumeration enum = jar.entries ();
-                while (enum.hasMoreElements ()) {
-                    JarEntry entry = (JarEntry) enum.nextElement ();
+                Enumeration e = jar.entries ();
+                while (e.hasMoreElements ()) {
+                    JarEntry entry = (JarEntry) e.nextElement ();
                     if (!entry.isDirectory ()) {
                         String className = entry.getName ();
                         if (className.endsWith (SUFFIX)) {
Index: compiler/src/java/org/apache/commons/attributes/validation/AttributeValidatorTask.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/attributes/compiler/src/java/org/apache/commons/attributes/validation/AttributeValidatorTask.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 AttributeValidatorTask.java
--- compiler/src/java/org/apache/commons/attributes/validation/AttributeValidatorTask.java	6 Jul 2004 20:42:09 -0000	1.1.1.1
+++ compiler/src/java/org/apache/commons/attributes/validation/AttributeValidatorTask.java	26 Jan 2005 15:24:49 -0000
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2003-2005 The Apache Software Foundation
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -143,9 +143,9 @@
             
             JarFile jar = new JarFile (jarFile);
             try {
-                Enumeration enum = jar.entries ();
-                while (enum.hasMoreElements ()) {
-                    JarEntry entry = (JarEntry) enum.nextElement ();
+                Enumeration e = jar.entries ();
+                while (e.hasMoreElements ()) {
+                    JarEntry entry = (JarEntry) e.nextElement ();
                     if (!entry.isDirectory ()) {
                         String className = entry.getName ();
                         if (className.endsWith (SUFFIX)) {

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


Re: [ATTRIBUTES] make it compile on JDK 1.5

Posted by Davanum Srinivas <da...@gmail.com>.
fixed.

-- dims


On Wed, 26 Jan 2005 16:26:02 +0100, Stefan Bodewig <bo...@apache.org> wrote:
> subject says it all.  Some trivial "enum" replacements.
> 
> Stefan
> 
> Index: api/src/java/org/apache/commons/attributes/AttributeIndex.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/AttributeIndex.java,v
> retrieving revision 1.2
> diff -u -r1.2 AttributeIndex.java
> --- api/src/java/org/apache/commons/attributes/AttributeIndex.java      27 Aug 2004 21:30:10 -0000      1.2
> +++ api/src/java/org/apache/commons/attributes/AttributeIndex.java      26 Jan 2005 15:24:48 -0000
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright 2003-2004 The Apache Software Foundation
> + * Copyright 2003-2005 The Apache Software Foundation
>   *
>   * Licensed under the Apache License, Version 2.0 (the "License");
>   * you may not use this file except in compliance with the License.
> @@ -219,9 +219,9 @@
>       */
>      public AttributeIndex (ClassLoader cl) throws Exception {
>          this.classLoader = cl;
> -        Enumeration enum = cl.getResources ("META-INF/attrs.index");
> -        while (enum.hasMoreElements ()) {
> -            URL url = (URL) enum.nextElement ();
> +        Enumeration e = cl.getResources ("META-INF/attrs.index");
> +        while (e.hasMoreElements ()) {
> +            URL url = (URL) e.nextElement ();
>              loadFromURL (url);
>          }
> 
> Index: compiler/src/java/org/apache/commons/attributes/compiler/AttributeIndexer.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-commons/attributes/compiler/src/java/org/apache/commons/attributes/compiler/AttributeIndexer.java,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 AttributeIndexer.java
> --- compiler/src/java/org/apache/commons/attributes/compiler/AttributeIndexer.java      6 Jul 2004 20:42:04 -0000       1.1.1.1
> +++ compiler/src/java/org/apache/commons/attributes/compiler/AttributeIndexer.java      26 Jan 2005 15:24:48 -0000
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright 2003-2004 The Apache Software Foundation
> + * Copyright 2003-2005 The Apache Software Foundation
>   *
>   * Licensed under the Apache License, Version 2.0 (the "License");
>   * you may not use this file except in compliance with the License.
> @@ -150,9 +150,9 @@
>              File newJarFile = new File (jarFile.getPath () + ".new");
>              JarOutputStream output = new JarOutputStream (new FileOutputStream (newJarFile));
>              try {
> -                Enumeration enum = jar.entries ();
> -                while (enum.hasMoreElements ()) {
> -                    JarEntry entry = (JarEntry) enum.nextElement ();
> +                Enumeration e = jar.entries ();
> +                while (e.hasMoreElements ()) {
> +                    JarEntry entry = (JarEntry) e.nextElement ();
>                      if (!entry.isDirectory ()) {
>                          String className = entry.getName ();
>                          if (className.endsWith (SUFFIX)) {
> Index: compiler/src/java/org/apache/commons/attributes/validation/AttributeValidatorTask.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-commons/attributes/compiler/src/java/org/apache/commons/attributes/validation/AttributeValidatorTask.java,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 AttributeValidatorTask.java
> --- compiler/src/java/org/apache/commons/attributes/validation/AttributeValidatorTask.java      6 Jul 2004 20:42:09 -0000       1.1.1.1
> +++ compiler/src/java/org/apache/commons/attributes/validation/AttributeValidatorTask.java      26 Jan 2005 15:24:49 -0000
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright 2003-2004 The Apache Software Foundation
> + * Copyright 2003-2005 The Apache Software Foundation
>   *
>   * Licensed under the Apache License, Version 2.0 (the "License");
>   * you may not use this file except in compliance with the License.
> @@ -143,9 +143,9 @@
> 
>              JarFile jar = new JarFile (jarFile);
>              try {
> -                Enumeration enum = jar.entries ();
> -                while (enum.hasMoreElements ()) {
> -                    JarEntry entry = (JarEntry) enum.nextElement ();
> +                Enumeration e = jar.entries ();
> +                while (e.hasMoreElements ()) {
> +                    JarEntry entry = (JarEntry) e.nextElement ();
>                      if (!entry.isDirectory ()) {
>                          String className = entry.getName ();
>                          if (className.endsWith (SUFFIX)) {
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 


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

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