ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/Vector.java
(Generate patch)

Comparing jsr166/src/main/java/util/Vector.java (file contents):
Revision 1.5 by dl, Mon Nov 28 23:53:32 2005 UTC vs.
Revision 1.8 by jsr166, Tue Feb 7 20:54:24 2006 UTC

# Line 1 | Line 1
1   /*
2   * %W% %E%
3   *
4 < * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
4 > * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5   * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6   */
7  
8   package java.util;
9 import java.util.*; // for javadoc (till 6280605 is fixed)
9  
10   /**
11   * The <code>Vector</code> class implements a growable array of
# Line 147 | Line 146 | public class Vector<E>
146       * @since   1.2
147       */
148      public Vector(Collection<? extends E> c) {
149 <        Object[] a = c.toArray();
150 <        elementCount = a.length;
151 <        // If c.toArray incorrectly doesn't return Object[], copy it.
152 <        if (a.getClass() == Object[].class)
153 <            elementData = a;
155 <        else
156 <            elementData = Arrays.copyOf(a, a.length, Object[].class);
149 >        elementData = c.toArray();
150 >        elementCount = elementData.length;
151 >        // c.toArray might (incorrectly) not return Object[] (see 6260652)
152 >        if (elementData.getClass() != Object[].class)
153 >            elementData = Arrays.copyOf(elementData, elementCount, Object[].class);
154      }
155  
156      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines