6436314: Vector could be created with appropriate size in DefaultComboBoxModel
Reviewed-by: alexsch, alexp
--- a/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java Fri May 31 18:46:41 2013 +0400
+++ b/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java Fri May 31 19:34:02 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++ )