#3 Replace Boolean and Integer constructor usages w/ valueO

closed
nobody
None
5
2012-04-14
2011-06-25
No

Hi,

I thought I might offer up a small patch that replaces usages of the Boolean and Integer constructors with their corresponding valueOf methods. Per the documentation for those methods, this should "likely to yield significantly better space and time performance by caching frequently requested values."

Here are the javadocs for those methods:
http://download.oracle.com/javase/1,5.0/docs/api/java/lang/Boolean.html#valueOf(boolean)
http://download.oracle.com/javase/1,5.0/docs/api/java/lang/Integer.html#valueOf(int)

Discussion

  • Mark DeSpain

    Mark DeSpain - 2011-06-25
     
  • yccheok

    yccheok - 2012-04-14

    I have picked up the changes manually. As currently we are using mercurial, and this long time ago old patch is based on CVS. Note that, I only pick up Boolean.valueOf, and not other data types. As I do not see optimization advantage for data type other than Boolean.

    http://jstock.hg.sourceforge.net/hgweb/jstock/jstock/rev/b5273e212682

     
  • yccheok

    yccheok - 2012-04-14
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks