[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5610) Replace new Integer() by Integer.valueOf()

Ondrej Medek (JIRA) noreply at atlassian.com
Thu Sep 30 15:00:57 EDT 2010


Replace new Integer() by Integer.valueOf()
------------------------------------------

                 Key: HHH-5610
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5610
             Project: Hibernate Core
          Issue Type: Improvement
    Affects Versions: 3.5.1
            Reporter: Ondrej Medek
            Priority: Minor


Hi,
I have seen in org.hibernate.impl.CriteriaImpl and other parts of Hibernate constructions like:

this.maxResults = new Integer(maxResults);

AFAIK it better to use

this.maxResults = Integer.valueOf(maxResults);

e.g. see 
* [http://download.oracle.com/javase/6/docs/api/java/lang/Integer.html#valueOf%28int%29]
* [http://tech.puredanger.com/2007/02/01/valueof/]

Or leave this to the compiler and write:

this.maxResults = maxResults;

Pleas, grep all your code to find such cunstructs or use FindBugs [http://findbugs.sourceforge.net/] to find it for you.

-- 
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