New japize option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/23/06, Arnaud Vandyck <avdyk@xxxxxxx> wrote:
> Is there a way to ignore the default factory classes?
>
> I don't think this is an error:
> http://www.kaffe.org/~stuart/japi/htmlout/h-jdk15-classpath.html#err_bad_javax_xml_datatype
>
> The default DataTypeFactory in Sun's implementation and in GNU Classpath
> implementation will maybe never be the same.

This is an API bug on Sun's part and can't be avoided by japitools;
not only that, I believe it actually needs to be fixed.

Suppose somebody compiles code like this against the JDK:

DataTypeFactory dft = (DataTypeFactory)
Class.forName(DatatypeFactory.DATATYPEFACTORY_IMPLEMENTATION_CLASS);

Because DATATYPEFACTORY_IMPLEMENTATION_CLASS is a constant, the actual
string value will be substituted at compiletime. If this code then
gets run against Classpath, it doesn't matter that Classpath's value
of DATATYPEFACTORY_IMPLEMENTATION_CLASS is different. It's going to
try to load Sun's version. The same problem happens in reverse if code
is compiled against Classpath and run against the JDK.

I don't know *how* this problem should be solved. Clearly my opinion
is that Sun screwed up bigtime by putting this into a constant field.
But I'm not going to make Japitools hide it. It is a real problem and
should be fixed somehow.

> This problem can show eatch time there is a factory pattern with a
> default value hardcoded as a constant... but I did not find another
> example ;-) Maybe I'm wrong.

There was another problem in rmi.server, I believe, a while back. A
field called something like packagePrefix. If you're interested it was
one of the very few patches I've submitted personally so looking for
my name in the changelog should take you to it. The same argument was
made about the "correct" answer being different, but it was decided to
match Sun's value for the same reason I gave above.

Stuart.
--
http://sab39.dev.netreach.com/


[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux