-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b53
-
generic
-
generic
The toString methods in classes implementing Collection or Map could be improved:
- Many classes are terribly overspecified, requiring that StringBuffer be used in
the implementation, when StringBuilder is more efficient, and no program could tell
which was being used (without serious cheating). Replacing StringBuffer with
StringBuilder is an obvious optimization.
- The CopyOnWriteArrayList class, on the other hand, is underspecified, not making it
clear exactly what the textual form of the output is, even though it complies with the
[a, b, c] format that other Collection classes use.
- Many classes are terribly overspecified, requiring that StringBuffer be used in
the implementation, when StringBuilder is more efficient, and no program could tell
which was being used (without serious cheating). Replacing StringBuffer with
StringBuilder is an obvious optimization.
- The CopyOnWriteArrayList class, on the other hand, is underspecified, not making it
clear exactly what the textual form of the output is, even though it complies with the
[a, b, c] format that other Collection classes use.
- relates to
-
JDK-6282555 (coll) Collection toString method optimizations
-
- Resolved
-