Character, Byte, Short valueOf instead of new instance (original) (raw)

Pavel Rappo pavel.rappo at oracle.com
Tue Jul 1 12:39:02 UTC 2014


Otavio,

As with [1], I created an issue to track the progress and also made 2 webrevs. One for the original patch and one for the changes similar to those we discussed in [1].

https://bugs.openjdk.java.net/browse/JDK-8048874

http://cr.openjdk.java.net/~prappo/8048874/webrev.00 http://cr.openjdk.java.net/~prappo/8048874/webrev.01


[1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-June/027197.html

Thanks, -Pavel

On 26 Jun 2014, at 16:07, Chris Hegarty <chris.hegarty at oracle.com> wrote:

Otavio,

I scanner the patches and they mainly look fine to me. Just a minor issue, as per the Long thread. diff -r d02b062bc827 src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java --- a/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java Fri Jun 13 11:21:30 2014 -0700 +++ b/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java Sat Jun 14 13:33:29 2014 -0300 @@ -379,7 +379,7 @@ // used for substring comparisons (where proto has "*" wildcards private boolean substringMatch(String proto, String value) { // simple case 1: "*" means attribute presence is being tested - if(proto.equals(new Character(WILDCARDTOKEN).toString())) { + if(proto.equals(Character.valueOf(WILDCARDTOKEN).toString())) { // << Character.toString(WILDCARDTOKEN)_ _if(debug) {System.out.println("simple presence assertion");}_ _return true;_ _}_ _-Chris._ _On 14 Jun 2014, at 17:38, Otávio Gonçalves de Santana <otaviojava at java.net> wrote:

Reason: The Character, Byte, Short classes have cache and using it, will save memory and will faster than using create new instance.

webrev: https://dl.dropboxusercontent.com/u/16109193/openjdk/byteshortcharactervalueof.zip similar: https://bugs.openjdk.java.net/browse/JDK-8044461 -- Atenciosamente. Otávio Gonçalves de Santana blog: http://otaviosantana.blogspot.com.br/ twitter: http://twitter.com/otaviojava site: http://www.otaviojava.com.br (11) 98255-3513 <suntools.diff><sunsecurity.diff><sunmisc.diff><sunmanagement.diff><jdkinternal.diff><javaxmanagement.diff><javabeans.diff><javaawt.diff><comsunsecurity.diff><comsunjndi.diff><comsunjmx.diff><comsun.diff>



More information about the core-libs-dev mailing list