8174105: Better naming attribution
authorvtewari
Fri, 10 Mar 2017 08:29:10 +0530
changeset 45982 c0a0ed6e0fbf
parent 45981 2ef418883ade
child 45983 4bcee8b28e89
8174105: Better naming attribution Reviewed-by: chegar, dfuchs, rriggs
jdk/src/java.naming/share/classes/javax/naming/directory/BasicAttribute.java
--- a/jdk/src/java.naming/share/classes/javax/naming/directory/BasicAttribute.java	Thu Mar 02 20:12:13 2017 +0000
+++ b/jdk/src/java.naming/share/classes/javax/naming/directory/BasicAttribute.java	Fri Mar 10 08:29:10 2017 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, 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
@@ -515,7 +515,7 @@
             throws java.io.IOException, ClassNotFoundException {
         s.defaultReadObject();  // read in the attrID
         int n = s.readInt();    // number of values
-        values = new Vector<>(n);
+        values = new Vector<>(Math.min(1024, n));
         while (--n >= 0) {
             values.addElement(s.readObject());
         }