RFR: (jaxp) 8003261 : static field is public but not final
huizhe.wang at oracle.com
Wed Dec 19 02:21:36 UTC 2012
On 12/18/2012 3:43 PM, David Holmes wrote:
> On 19/12/2012 3: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
> I think that is an excellent point Tom. We should avoid turning the
> static field into a compile-time constant.
> And get rid of the unnecessary fImmutableVersion which everyone keeps
With the following change, at least there's no duplicate literal version
strings anymore. Or did you mean we should get rid of
fImmutableVersionand have getVresion return a liberal string?
>> public static final String fVersion = getVersion();
>> On 18/12/2012 08:47, Joe Wang wrote:
>>> This is the 2nd of the three [findbug] issues. The field fVersion is
>>> simply made final.
>>> No new test needed.
More information about the core-libs-dev