StringBuffers and StringBuilders have the potential to grow significantly, which could lead to memory leaks if they are retained within objects with extended lifetimes.
Non-Compliant Code Examples
publicclassFoo{privateStringBufferbuffer1;// potential memory leak as an instance variable;privateStringbuffer2;privateStringBuilderbuffer3;// potential memory leak as an instance variable;}