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.6 by jsr166, Tue Nov 29 06:19:39 2005 UTC

# 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