[EMAIL PROTECTED] wrote:
> Version: Made fVersion final.
Here is one case (there may be others) where we CANNOT
make this field "final". This field was final to begin
with but then there was a problem reported by users --
IBMers, in fact.
Here's the deal: the users in question have code that
relies on the version information found in the Version
class. So they have code something like this:
if (Version.fVersion.equals("2.0.1")) { ... }
However, if the fVersion field is made final, the Java
compiler adds the constant directly to the compiled
class. Therefore, the comparison is always made against
the constant value at the time of compilation and not
the value in the Version class class loaded at runtime.
See the problem?
The workaround, at that time, was for us to make this
field non-final by default. For backwards compatibility,
it should probably stay this way. In hindsight, though,
it probably would've been better to turn this into a
method that people called.
> XMLChar: make CHARS byte array private.
This was one where I wanted it to be publicly accessible
so that people didn't have to call methods for checking
the status of a character. But Java doesn't have a way
of making array contents read-only and the current state
of JVM technology is such that this is problem not an
issue.
--
Andy Clark * [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]