[cvs] / jsr166 / src / main / java / util / Vector.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/Vector.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5, Mon Nov 28 23:53:32 2005 UTC revision 1.6, Tue Nov 29 06:19:39 2005 UTC
# Line 147  Line 147 
147       * @since   1.2       * @since   1.2
148       */       */
149      public Vector(Collection<? extends E> c) {      public Vector(Collection<? extends E> c) {
150          Object[] a = c.toArray();          elementData = c.toArray();
151          elementCount = a.length;          elementCount = elementData.length;
152          // If c.toArray incorrectly doesn't return Object[], copy it.          // c.toArray might (incorrectly) not return Object[] (see 6260652)
153          if (a.getClass() == Object[].class)          if (elementData.getClass() != Object[].class)
154              elementData = a;              elementData = Arrays.copyOf(elementData, elementCount, Object[].class);
         else  
             elementData = Arrays.copyOf(a, a.length, Object[].class);  
155      }      }
156    
157      /**      /**

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8