RFR: (jaxp) 8003261 : static field is public but not final (original) (raw)

Joe Wang huizhe.wang at oracle.com
Wed Dec 19 02:22:02 UTC 2012


Thanks :)

On 12/18/2012 6:16 PM, Lance Andersen wrote:

+1

-- <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 tel:+1.781.442.2037 Oracle Java Engineering 1 Network Drive <x-apple-data-detectors://28/0> Burlington, MA 01803 <x-apple-data-detectors://28/0> Lance.Andersen at oracle.com <mailto:Lance.Andersen at oracle.com> Sent from my iPhone On Dec 18, 2012, at 8:51 PM, Joe Wang <huizhe.wang at oracle.com_ _<mailto:huizhe.wang at oracle.com>> wrote:

Thanks Tom. I changed it as you suggested.

I did initially remove the string and have main print out getVersion() instead, but I reverted it with a 2nd thought same as you, that it's /possible/ someone might be using it :) New webrev is here: http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ <http://cr.openjdk.java.net/%7Ejoehw/jdk8/8003261/webrev/> Joe On 12/18/2012 9:49 AM, Tom Hawtin wrote: Not that it's particularly important, but it's /possible/ clients are relying on the non-compile time constant nature of this field causing it not to be inlined into client class files, rather than the ability to switch the version string. So it may be a good idea to add the final, but make it a non-compile time constant. We can also remove the duplication.

public static final String fVersion = getVersion(); Tom On 18/12/2012 08:47, Joe Wang wrote: Hi,

This is the 2nd of the three [findbug] issues. The field fVersion is simply made final. webrev: http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ <http://cr.openjdk.java.net/%7Ejoehw/jdk8/8003261/webrev/> Test: No new test needed. Thanks, Joe



More information about the core-libs-dev mailing list