directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r110013 - in incubator/directory/naming/trunk/core/src: java/org/apache/naming java/org/apache/naming/resources test/org/apache/naming test/org/apache/naming/resources
Date Mon, 06 Dec 2004 20:04:29 GMT
Author: bayard
Date: Mon Dec  6 12:04:29 2004
New Revision: 110013

URL: http://svn.apache.org/viewcvs?view=rev&rev=110013
Log:
Fixed usage of enum to enumeration in line with jdk 1.5 new keyword
Modified:
   incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextBindingsEnumeration.java
   incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextEnumeration.java
   incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/DirContextURLConnection.java
   incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/RecyclableNamingEnumeration.java
   incubator/directory/naming/trunk/core/src/test/org/apache/naming/AbstractContextTest.java
   incubator/directory/naming/trunk/core/src/test/org/apache/naming/BasicContextTest.java
   incubator/directory/naming/trunk/core/src/test/org/apache/naming/resources/AbstractDirContextTest.java

Modified: incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextBindingsEnumeration.java
Url: http://svn.apache.org/viewcvs/incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextBindingsEnumeration.java?view=diff&rev=110013&p1=incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextBindingsEnumeration.java&r1=110012&p2=incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextBindingsEnumeration.java&r2=110013
==============================================================================
--- incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextBindingsEnumeration.java
(original)
+++ incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextBindingsEnumeration.java
Mon Dec  6 12:04:29 2004
@@ -38,12 +38,12 @@
 
 
     public NamingContextBindingsEnumeration(Vector entries) {
-        enum = entries.elements();
+        enumeration = entries.elements();
     }
 
 
-    public NamingContextBindingsEnumeration(Enumeration enum) {
-        this.enum = enum;
+    public NamingContextBindingsEnumeration(Enumeration enumeration) {
+        this.enumeration = enumeration;
     }
 
 
@@ -53,7 +53,7 @@
     /**
      * Underlying enumeration.
      */
-    protected Enumeration enum;
+    protected Enumeration enumeration;
 
 
     // --------------------------------------------------------- Public Methods
@@ -73,7 +73,7 @@
      */
     public boolean hasMore()
         throws NamingException {
-        return enum.hasMoreElements();
+        return enumeration.hasMoreElements();
     }
 
 
@@ -86,12 +86,12 @@
 
 
     public boolean hasMoreElements() {
-        return enum.hasMoreElements();
+        return enumeration.hasMoreElements();
     }
 
 
     public Object nextElement() {
-        NamingEntry entry = (NamingEntry) enum.nextElement();
+        NamingEntry entry = (NamingEntry) enumeration.nextElement();
         return new Binding(entry.name, entry.value.getClass().getName(), 
                            entry.value, true);
     }

Modified: incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextEnumeration.java
Url: http://svn.apache.org/viewcvs/incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextEnumeration.java?view=diff&rev=110013&p1=incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextEnumeration.java&r1=110012&p2=incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextEnumeration.java&r2=110013
==============================================================================
--- incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextEnumeration.java
(original)
+++ incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContextEnumeration.java
Mon Dec  6 12:04:29 2004
@@ -38,12 +38,12 @@
 
 
     public NamingContextEnumeration(Vector entries) {
-        enum = entries.elements();
+        enumeration = entries.elements();
     }
 
 
-    public NamingContextEnumeration(Enumeration enum) {
-        this.enum = enum;
+    public NamingContextEnumeration(Enumeration enumeration) {
+        this.enumeration = enumeration;
     }
 
 
@@ -53,7 +53,7 @@
     /**
      * Underlying enumeration.
      */
-    protected Enumeration enum;
+    protected Enumeration enumeration;
 
 
     // --------------------------------------------------------- Public Methods
@@ -73,7 +73,7 @@
      */
     public boolean hasMore()
         throws NamingException {
-        return enum.hasMoreElements();
+        return enumeration.hasMoreElements();
     }
 
 
@@ -86,12 +86,12 @@
 
 
     public boolean hasMoreElements() {
-        return enum.hasMoreElements();
+        return enumeration.hasMoreElements();
     }
 
 
     public Object nextElement() {
-        NamingEntry entry = (NamingEntry) enum.nextElement();
+        NamingEntry entry = (NamingEntry) enumeration.nextElement();
         return new NameClassPair(entry.name, entry.value.getClass().getName());
     }
 

Modified: incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/DirContextURLConnection.java
Url: http://svn.apache.org/viewcvs/incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/DirContextURLConnection.java?view=diff&rev=110013&p1=incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/DirContextURLConnection.java&r1=110012&p2=incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/DirContextURLConnection.java&r2=110013
==============================================================================
--- incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/DirContextURLConnection.java
(original)
+++ incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/DirContextURLConnection.java
Mon Dec  6 12:04:29 2004
@@ -339,9 +339,9 @@
         
         if (collection != null) {
             try {
-                NamingEnumeration enum = context.list(getURL().getFile());
-                while (enum.hasMoreElements()) {
-                    NameClassPair ncp = (NameClassPair) enum.nextElement();
+                NamingEnumeration enumeration = context.list(getURL().getFile());
+                while (enumeration.hasMoreElements()) {
+                    NameClassPair ncp = (NameClassPair) enumeration.nextElement();
                     result.addElement(ncp.getName());
                 }
             } catch (NamingException e) {

Modified: incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/RecyclableNamingEnumeration.java
Url: http://svn.apache.org/viewcvs/incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/RecyclableNamingEnumeration.java?view=diff&rev=110013&p1=incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/RecyclableNamingEnumeration.java&r1=110012&p2=incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/RecyclableNamingEnumeration.java&r2=110013
==============================================================================
--- incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/RecyclableNamingEnumeration.java
(original)
+++ incubator/directory/naming/trunk/core/src/java/org/apache/naming/resources/RecyclableNamingEnumeration.java
Mon Dec  6 12:04:29 2004
@@ -53,7 +53,7 @@
     /**
      * Underlying enumeration.
      */
-    protected Enumeration enum;
+    protected Enumeration enumeration;
 
 
     // --------------------------------------------------------- Public Methods
@@ -73,7 +73,7 @@
      */
     public boolean hasMore()
         throws NamingException {
-        return enum.hasMoreElements();
+        return enumeration.hasMoreElements();
     }
 
 
@@ -86,12 +86,12 @@
 
 
     public boolean hasMoreElements() {
-        return enum.hasMoreElements();
+        return enumeration.hasMoreElements();
     }
 
 
     public Object nextElement() {
-        return enum.nextElement();
+        return enumeration.nextElement();
     }
 
 
@@ -102,7 +102,7 @@
      * Recycle.
      */
     void recycle() {
-        enum = entries.elements();
+        enumeration = entries.elements();
     }
 
 

Modified: incubator/directory/naming/trunk/core/src/test/org/apache/naming/AbstractContextTest.java
Url: http://svn.apache.org/viewcvs/incubator/directory/naming/trunk/core/src/test/org/apache/naming/AbstractContextTest.java?view=diff&rev=110013&p1=incubator/directory/naming/trunk/core/src/test/org/apache/naming/AbstractContextTest.java&r1=110012&p2=incubator/directory/naming/trunk/core/src/test/org/apache/naming/AbstractContextTest.java&r2=110013
==============================================================================
--- incubator/directory/naming/trunk/core/src/test/org/apache/naming/AbstractContextTest.java
(original)
+++ incubator/directory/naming/trunk/core/src/test/org/apache/naming/AbstractContextTest.java
Mon Dec  6 12:04:29 2004
@@ -238,7 +238,7 @@
     }
 
     public void testList() throws NamingException {
-        NamingEnumeration enum;
+        NamingEnumeration enumeration;
         Map expected;
         Map result;
 
@@ -247,22 +247,22 @@
             Map.Entry entry = (Map.Entry) i.next();
             expected.put(entry.getKey(), entry.getValue().getClass().getName());
         }
-        enum = secondContext.list("");
+        enumeration = secondContext.list("");
         result = new HashMap();
-        while (enum.hasMore()) {
-            NameClassPair pair = (NameClassPair) enum.next();
+        while (enumeration.hasMore()) {
+            NameClassPair pair = (NameClassPair) enumeration.next();
             result.put(pair.getName(), pair.getClassName());
         }
         verifyList(expected, result);
 
         try {
-            enum.next();
+            enumeration.next();
             fail("Expecting NoSuchElementException");
         } catch (NoSuchElementException e) {
             // expected
         }
         try {
-            enum.nextElement();
+            enumeration.nextElement();
             fail("Expecting NoSuchElementException");
         } catch (NoSuchElementException e) {
             // expected
@@ -270,24 +270,24 @@
     }
 
     public void testListBindings() throws NamingException {
-        NamingEnumeration enum;
+        NamingEnumeration enumeration;
         Map result;
-        enum = secondContext.listBindings("");
+        enumeration = secondContext.listBindings("");
         result = new HashMap();
-        while (enum.hasMore()) {
-            Binding pair = (Binding) enum.next();
+        while (enumeration.hasMore()) {
+            Binding pair = (Binding) enumeration.next();
             result.put(pair.getName(), pair.getObject());
         }
         verifyListBindings(binding, result);
 
         try {
-            enum.next();
+            enumeration.next();
             fail("Expecting NoSuchElementException");
         } catch (NoSuchElementException e) {
             // expected
         }
         try {
-            enum.nextElement();
+            enumeration.nextElement();
             fail("Expecting NoSuchElementException");
         } catch (NoSuchElementException e) {
             // expected
@@ -322,12 +322,12 @@
         secondContext.rebind(secondBoundName(), firstBoundObject());
         binding.put(firstBoundName(), secondBoundObject());
         binding.put(secondBoundName(), firstBoundObject());      
-        NamingEnumeration enum;
+        NamingEnumeration enumeration;
         Map result;
-        enum = secondContext.listBindings("");
+        enumeration = secondContext.listBindings("");
         result = new HashMap();
-        while (enum.hasMore()) {
-            Binding pair = (Binding) enum.next();
+        while (enumeration.hasMore()) {
+            Binding pair = (Binding) enumeration.next();
             result.put(pair.getName(), pair.getObject());
         }
         verifyListBindings(binding, result);     

Modified: incubator/directory/naming/trunk/core/src/test/org/apache/naming/BasicContextTest.java
Url: http://svn.apache.org/viewcvs/incubator/directory/naming/trunk/core/src/test/org/apache/naming/BasicContextTest.java?view=diff&rev=110013&p1=incubator/directory/naming/trunk/core/src/test/org/apache/naming/BasicContextTest.java&r1=110012&p2=incubator/directory/naming/trunk/core/src/test/org/apache/naming/BasicContextTest.java&r2=110013
==============================================================================
--- incubator/directory/naming/trunk/core/src/test/org/apache/naming/BasicContextTest.java
(original)
+++ incubator/directory/naming/trunk/core/src/test/org/apache/naming/BasicContextTest.java
Mon Dec  6 12:04:29 2004
@@ -124,7 +124,7 @@
     }
 
     public void testList() throws NamingException {
-        NamingEnumeration enum;
+        NamingEnumeration enumeration;
         Map expected;
         Map result;
 
@@ -133,22 +133,22 @@
             Map.Entry entry = (Map.Entry) i.next();
             expected.put(entry.getKey(), entry.getValue().getClass().getName());
         }
-        enum = envContext.list("");
+        enumeration = envContext.list("");
         result = new HashMap();
-        while (enum.hasMore()) {
-            NameClassPair pair = (NameClassPair) enum.next();
+        while (enumeration.hasMore()) {
+            NameClassPair pair = (NameClassPair) enumeration.next();
             result.put(pair.getName(), pair.getClassName());
         }
         assertEquals(expected, result);
 
         try {
-            enum.next();
+            enumeration.next();
             fail();
         } catch (NoSuchElementException e) {
             // ok
         }
         try {
-            enum.nextElement();
+            enumeration.nextElement();
             fail();
         } catch (NoSuchElementException e) {
             // ok
@@ -156,24 +156,24 @@
     }
 
     public void testListBindings() throws NamingException {
-        NamingEnumeration enum;
+        NamingEnumeration enumeration;
         Map result;
-        enum = envContext.listBindings("");
+        enumeration = envContext.listBindings("");
         result = new HashMap();
-        while (enum.hasMore()) {
-            Binding pair = (Binding) enum.next();
+        while (enumeration.hasMore()) {
+            Binding pair = (Binding) enumeration.next();
             result.put(pair.getName(), pair.getObject());
         }
         assertEquals(envBinding, result);
 
         try {
-            enum.next();
+            enumeration.next();
             fail();
         } catch (NoSuchElementException e) {
             // ok
         }
         try {
-            enum.nextElement();
+            enumeration.nextElement();
             fail();
         } catch (NoSuchElementException e) {
             // ok

Modified: incubator/directory/naming/trunk/core/src/test/org/apache/naming/resources/AbstractDirContextTest.java
Url: http://svn.apache.org/viewcvs/incubator/directory/naming/trunk/core/src/test/org/apache/naming/resources/AbstractDirContextTest.java?view=diff&rev=110013&p1=incubator/directory/naming/trunk/core/src/test/org/apache/naming/resources/AbstractDirContextTest.java&r1=110012&p2=incubator/directory/naming/trunk/core/src/test/org/apache/naming/resources/AbstractDirContextTest.java&r2=110013
==============================================================================
--- incubator/directory/naming/trunk/core/src/test/org/apache/naming/resources/AbstractDirContextTest.java
(original)
+++ incubator/directory/naming/trunk/core/src/test/org/apache/naming/resources/AbstractDirContextTest.java
Mon Dec  6 12:04:29 2004
@@ -225,9 +225,9 @@
    public void testAttributes() throws Exception {
       DirContext context = (DirContext) initialContext.lookup(firstContextName()+ "/" + secondContextName());
       Attributes attrs = (Attributes) context.getAttributes(firstBoundName());
-      NamingEnumeration enum = attrs.getAll();
-      while (enum.hasMoreElements()) {
-          assertTrue(enum.nextElement() instanceof Attribute);
+      NamingEnumeration enumeration = attrs.getAll();
+      while (enumeration.hasMoreElements()) {
+          assertTrue(enumeration.nextElement() instanceof Attribute);
       }
       Attributes expected = expectedAttributes();
       if (expected != null) {

Mime
View raw message