You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by ne...@ca.ibm.com on 2002/07/12 20:28:07 UTC
revisiting fVersion in light of static mutability
Hi all,
Hopefully, folks will remember to a couple of weeks back when I articulated
the need for Xerces to take heed of "static mutability" issues, since we're
being deployed in platforms where that's a significant issue. At the time,
one of the contentious points was how to handle the
org.apache.xerces.impl.Version#fVersion String, which has had the audacity
to be public, static and non-final for a very long time.
We can't make it private because suddenly that would break many people's
code; can't make it final because then version checks would get done at
compile-time--quite a bad time for a run-time-version check to be made.
The best solution I can think of is to add a getVersion(): String method
to this class, and strongly urge people to begin using this. We can
guarantee that this is statically immutable, and if people write their code
like this
try {
xercesVersion = org.apache.xerces.impl.Version.getVersion();
} catch (NoSuchMethodError n) {
// ancient Xerces2 is first on classpath!
xercesVersion = org.apache.xerces.impl.Version.fVersion;
}
then their code should work irrespective of the ordering of Xerces2's on
the classpath.
What do people think? Is this even a really big problem? I haven't heard
too much of an outcry yet about the fact that, given both on a classpath,
there really isn't an obvious way to determine whether Xerces1 or Xerces2
is first, given the incompatible packagings of their Version classes...
Cheers!
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone: 905-413-3519, T/L 969-3519
E-mail: neilg@ca.ibm.com
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
Re: revisiting fVersion in light of static mutability
Posted by Andy Clark <an...@apache.org>.
neilg@ca.ibm.com wrote:
> The best solution I can think of is to add a getVersion(): String method
Seems fine to me. And we can add a @deprecated flag to
the fVersion field with a comment as to how to do it the
"right" way.
--
Andy Clark * andyc@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org