I use tool to check coding style And I got many advise :
StringBuffer constructor is initialized with size 16, but has at least 35 characters appended.
Here is some of my code:
final StringBuffer Contents = new StringBuffer();
WHy whould this happen?
How did it count 35 characters?
How can I edit the size of StringBuffer ?
Or What method should I use to solve this problem??
Changing the capacity of a StringBuffer after it has been created is more costly than creating it with the expected needed capacity.
Use this constructor to remove this warning:
/**
* Constructs a string buffer with no characters in it and
* the specified initial capacity.
*
* @param capacity the initial capacity.
* @exception NegativeArraySizeException if the <code>capacity</code>
* argument is less than <code>0</code>.
*/
public StringBuffer(int capacity) {
super(capacity);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With