https://bugzilla.novell.com/show_bug.cgi?id=418455 Summary: adaptx-0.9.13 : 6 * poor choice of StringBuffer constructor value Product: openSUSE 11.1 Version: Factory Platform: All OS/Version: openSUSE 11.0 Status: NEW Severity: Normal Priority: P5 - None Component: Java AssignedTo: bnc-team-java@forge.provo.novell.com ReportedBy: dcb314@hotmail.com QAContact: qa@suse.de Found By: --- I just tried to analyse the Suse Linux package adaptx-0.9.13 with the most excellent Java static analysis tool pmd. I configured the pmd tool to use its strings ruleset. Looking solely at the results for the StringBuffer constructor, the results were /usr/src/packages/BUILD/adaptx-0.9.13-src/src/main/org/exolab/adaptx/xml/DOMURILocation.java:147 StringBuffer constructor is initialized with size 32, but has at least 48 characters appended. /usr/src/packages/BUILD/adaptx-0.9.13-src/src/main/org/exolab/adaptx/xml/SAXURILocation.java:182 StringBuffer constructor is initialized with size 34, but has at least 44 characters appended. /usr/src/packages/BUILD/adaptx-0.9.13-src/src/main/org/exolab/adaptx/xpath/engine/ParseException.java:72 StringBuffer constructor is initialized with size 16, but has at least 67 characters appended. /usr/src/packages/BUILD/adaptx-0.9.13-src/src/main/org/exolab/adaptx/xslt/RuleProcessor.java:1450 StringBuffer constructor is initialized with size 16, but has at least 108 characters appended. /usr/src/packages/BUILD/adaptx-0.9.13-src/src/main/org/exolab/adaptx/xslt/XSLObject.java:544 StringBuffer constructor is initialized with size 31, but has at least 38 characters appended. /usr/src/packages/BUILD/adaptx-0.9.13-src/src/main/org/exolab/adaptx/xslt/XSLTProcessor.java:620 StringBuffer constructor is initialized with size 16, but has at least 35 characters appended. In each case, Java resize activity can be reduced by supplying a more accurate initial size to the StringBuffer constructor. For example, the first one might be better as StringBuffer sb = new StringBuffer( 64); sb.append("DOMURILocation ("); where 64 is chosen as the next power of two above the minimum size of 48. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.