I'm checking this in.

This fixes PR 26971.  The mauve test is already in.

Tom

2006-04-03  Tom Tromey  <[EMAIL PROTECTED]>

        PR classpath/26971:
        * javax/naming/directory/BasicAttribute.java: Added missing @since.
        (BasicAttributeEnumeration.where): Initialize to 0.
        (BasicAttributeEnumeration.nextElement): Post-increment 'where'.

Index: javax/naming/directory/BasicAttribute.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/naming/directory/BasicAttribute.java,v
retrieving revision 1.4
diff -u -r1.4 BasicAttribute.java
--- javax/naming/directory/BasicAttribute.java  2 Jul 2005 20:32:45 -0000       
1.4
+++ javax/naming/directory/BasicAttribute.java  3 Apr 2006 20:57:39 -0000
@@ -48,6 +48,7 @@
 /**
  * @author Tom Tromey ([EMAIL PROTECTED])
  * @date June 20, 2001
+ * @since 1.3
  */
 public class BasicAttribute implements Attribute
 {
@@ -301,7 +302,7 @@
   // Used when enumerating this attribute.
   private class BasicAttributeEnumeration implements NamingEnumeration
   {
-    int where = -1;
+    int where = 0;
 
     public BasicAttributeEnumeration ()
     {
@@ -328,10 +329,9 @@
 
     public Object nextElement () throws NoSuchElementException
     {
-      if (where + 1 >= values.size ())
+      if (where == values.size ())
        throw new NoSuchElementException ("no more elements");
-      ++where;
-      return values.get (where);
+      return values.get (where++);
     }
   }
 }

Reply via email to