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.7 by jsr166, Mon Dec 5 02:56:59 2005 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  
# Line 147 | Line 147 | public class Vector<E>
147       * @since   1.2
148       */
149      public Vector(Collection<? extends E> c) {
150 <        Object[] a = c.toArray();
151 <        elementCount = a.length;
152 <        // If c.toArray incorrectly doesn't return Object[], copy it.
153 <        if (a.getClass() == Object[].class)
154 <            elementData = a;
155 <        else
156 <            elementData = Arrays.copyOf(a, a.length, Object[].class);
150 >        elementData = c.toArray();
151 >        elementCount = elementData.length;
152 >        // c.toArray might (incorrectly) not return Object[] (see 6260652)
153 >        if (elementData.getClass() != Object[].class)
154 >            elementData = Arrays.copyOf(elementData, elementCount, Object[].class);
155      }
156  
157      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines