jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Reschke <julian.resc...@gmx.de>
Subject Re: [jira] Created: (JCR-1150) JCR2SPI: several performance improvements pointed out by Findbugs
Date Fri, 28 Sep 2007 13:24:31 GMT
Thomas Mueller wrote:
> Hi,
> 
> I like FindBugs, and it would be great to have a good configuration in
> subversion.
> The same for PMD and Checkstyle. People can then use it or not, but
> don't have to duplicate the setup.
> 
>> Integer(int) constructor; use Integer.valueOf(int) instead
> 
> This is Java 1.5. But what you could do is:

Oops. Thanks for pointing this out. Will fix.

> public class ObjectUtils {
>     public static Integer getInteger(int x) {
>         return new Integer(x); // NOPMD
>     }
> }
> 
> Then change the code so this method is called instead of creating
> Integer objects directly. Then if we switch to JDK 1.5, of if we want
> to build our own cache, we have to change it only there.
> 
>> makes inefficient use of keySet iterator instead of entrySet iterator
> 
> This should be changed if possible.

Best regards, Julian

Mime
View raw message