This is the mail archive of the
mailing list for the Java project.
Eww: Modifier.INTERPRETED overload
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: java-patches at gcc dot gnu dot org
- Date: Wed, 30 May 2007 16:55:13 +0100
- Subject: Eww: Modifier.INTERPRETED overload
If you look in java/lang/reflect/Modifier.java you'll see:
* Flag indicating a synthetic member.
static final int SYNTHETIC = 0x1000;
* GCJ-LOCAL: This access flag is set on interpreted classes.
static final int INTERPRETED = 0x1000;
This should, perhaps, ring an alarm bell. Way back when this code was
written, classes weren't marked synthetic, but they are now!
So, any compiled class that is marked as SYNTHETIC is treated as
INTERPRETED by libgcj. Bad Things Happen.
We really need to find another way of marking classes as interpreted,
but clearing the INTERPRETED flag when loading the class prevents a
2007-05-30 Andrew Haley <firstname.lastname@example.org>
* java/lang/natClassLoader.cc (_Jv_NewClassFromInitializer): Clear
INTERPRETED access modifier.
--- natClassLoader.cc (revision 124185)
+++ natClassLoader.cc (working copy)
@@ -281,7 +281,16 @@
memcpy (dst, src, len);
new_class->engine = &_Jv_soleIndirectCompiledEngine;
+ /* FIXME: Way back before the dawn of time, we overloaded the
+ SYNTHETIC class access modifier to mean INTERPRETED. This was a
+ Bad Thing, but it didn't matter then because classes were never
+ marked synthetic. However, it is possible to redeem the
+ situation: _Jv_NewClassFromInitializer is only called from
+ compiled classes, so we clear the INTERPRETED flag. This is a
+ kludge! */
+ new_class->accflags &= ~java::lang::reflect::Modifier::INTERPRETED;