jdk/src/share/classes/java/util/Vector.java
changeset 7020 25638687fe82
parent 5506 202f599c92aa
child 7518 0282db800fe1
equal deleted inserted replaced
7019:f2f6b61d34ac 7020:25638687fe82
   220      * be {@code minCapacity}.
   220      * be {@code minCapacity}.
   221      *
   221      *
   222      * @param minCapacity the desired minimum capacity
   222      * @param minCapacity the desired minimum capacity
   223      */
   223      */
   224     public synchronized void ensureCapacity(int minCapacity) {
   224     public synchronized void ensureCapacity(int minCapacity) {
   225         modCount++;
   225         if (minCapacity > 0) {
   226         ensureCapacityHelper(minCapacity);
   226             modCount++;
       
   227             ensureCapacityHelper(minCapacity);
       
   228         }
   227     }
   229     }
   228 
   230 
   229     /**
   231     /**
   230      * This implements the unsynchronized semantics of ensureCapacity.
   232      * This implements the unsynchronized semantics of ensureCapacity.
   231      * Synchronized methods in this class can internally call this
   233      * Synchronized methods in this class can internally call this