JDK-4030374 - Java Issue Tracker
Feb 5, 1997 ... ... array before the superclass constructor runs. This is a problem ... code into every subclass constructor. Defect Conversion BT2. 2004-06 ...
Feb 5, 1997 ... ... array before the superclass constructor runs. This is a problem ... code into every subclass constructor. Defect Conversion BT2. 2004-06 ...
are returned by its iterator, this method must return the elements in - * the same order. + * the same order. The returned array's {@linkplain Class#getComponentType + * runtime component type} is {@code Object}. * * &String[] y = x.toArray(new String[0]);</pre> * *.
I have now isolated the problem into a single piece of code for demonstration purposes. This is cut down from a larger piece of software which uses the Java Activation Framework (hence the use of InputStreams). I have attached the code, and two trivial HTML documents.
This problem only occurs if a String constructor has been passed a StringBuffer object as a parameter (which causes the StringBuffer's "shared" flag to be set to true) *AND* the StringBuffer's length is later set to zero. The coding error is in the "StringBuffer.setLength()" method.