changeset 6123:b6d5b700480e

6436314: Vector could be created with appropriate size in DefaultComboBoxModel Reviewed-by: alexsch
author vkarnauk
date Wed, 05 Jun 2013 13:43:34 +0400
parents 4ddf38310049
children e918e166dbe3
files src/share/classes/javax/swing/DefaultComboBoxModel.java
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/swing/DefaultComboBoxModel.java	Tue Jun 04 21:46:24 2013 +0400
+++ b/src/share/classes/javax/swing/DefaultComboBoxModel.java	Wed Jun 05 13:43:34 2013 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,8 +55,7 @@
      * @param items  an array of Object objects
      */
     public DefaultComboBoxModel(final E items[]) {
-        objects = new Vector<E>();
-        objects.ensureCapacity( items.length );
+        objects = new Vector<E>(items.length);
 
         int i,c;
         for ( i=0,c=items.length;i<c;i++ )