[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2122) optimization patch based on pmd rules

Xavier Le Vourch (JIRA) noreply at atlassian.com
Fri Sep 29 22:14:24 EDT 2006


optimization patch based on pmd rules
-------------------------------------

         Key: HHH-2122
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2122
     Project: Hibernate3
        Type: Patch

 Environment: latest svn source
    Reporter: Xavier Le Vourch
    Priority: Minor
 Attachments: Optimizations.patch

I've run pmd with a custom ruleset and made a few optimization changes:


Double.valueOf(x).doubleValue() -> Double.parseDouble(x)

append("x") -> append('x')

x != null && x instanceof X -> x instanceof X

list.toArray uses correctly sized array as argument

new String(str) -> str

if (expr == false) -> if (!expr)

append(s1 + s2) -> append(s1).append(s2)

loop over array to add to list -> list.addAll(Arrays.asList(<array>))

extra ; removed

name.toLowerCase().equals("rowid") -> name.equalsIgnoreCase("rowid")

use of System.arraycopy instead of loop



I could break the patch in several parts if that makes it easier to analyze.

Xavier


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list