Mark Wielaard wrote:
> Yes, but unfortunately that doesn't change the byte-code of the
> ClassLoader class. static final primitive (and String) field 
> values are actually inlined into other classes. So you can replace
> VMClassLoader all you want with a version the has VM_USE_CACHE set
> to another value, that won't actually change the ClassLoader code
> paths unless ClassLoader is also recompiled against this new value.
> Really, try it out.

Trust me, I know all this ;-)

> It is an annoying byte code optimization.

It's Java's version of #define.

> So for things that can be different at runtime like the VMClasses
> you unfortunately cannot use static final fields of primitive types.

As long as you build everything from source (with the replaced VM*
classes) it works, but I must admit that I have no clue about how
everyone builds the class library (personally, I don't use any of the
build infrastructure that comes with GNU Classpath).

Regards,
Jeroen




_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to