Julius Davies created LANG-816:
----------------------------------
Summary: introduce ConstantUtils class to prevent Javac from
inlining constants
Key: LANG-816
URL: https://issues.apache.org/jira/browse/LANG-816
Project: Commons Lang
Issue Type: Wish
Reporter: Julius Davies
Priority: Trivial
ConstantUtils currently contains a set of methods to ensure constants are not
inlined by javac.
For example, typically a developer might declare a constant like
public final static int MAGIC_NUMBER = 5;
Should a different jar file refer to this, and the MAGIC_NUMBER is changed a
later date (e.g., MAGIC_NUMBER = 6), the different jar file will need to
recompile itself. This is because javac typically inlines the primitive or
String constant directly into the bytecode, and removes the reference to the
MAGIC_NUMBER field.
To help the other jar (so that it does not need to recompile when constants are
changed) the original developer can declare their constant using one of the
CONST() utility methods, instead:
public final static int MAGIC_NUMBER = CONST(5);
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira