Synopsis: | Do not instantiate a StringBuffer with a char |
Language: | Java |
Severity Level: | 2 |
Category: | StringandStringBuffer |
Description: |
StringBuffer sb = new StringBuffer('c'); The
char will be converted into int to intialize
StringBuffer size.class Foo { StringBuffer sb1 = new StringBuffer('c'); //Bad StringBuffer sb2 = new StringBuffer("c"); //Better } |