This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: lex.c oddity
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: java at gcc dot gnu dot org
- Date: Wed, 19 Nov 2003 16:54:07 -0500 (EST)
- Subject: Re: lex.c oddity
On 18 Nov 2003, Tom Tromey wrote:
> >>>>> "Jeff" == Jeff Sturm <jsturm@one-point.com> writes:
>
> Jeff> While debugging the parser, I stumbled across this code in java_init_lex:
> Jeff> int java_lang_imported = 0;
> Jeff> ...
> Jeff> if (!java_lang_imported)
> Jeff> {
> Jeff> ...
> Jeff> java_lang_imported = 1;
> Jeff> Clearly the conditional is always taken. Was this meant to be declared
> Jeff> static? (I tried; it doesn't work.)
>
> Sure looks that way, doesn't it?
> Hmm, that line predates the import into the public gcc tree.
> At this point, probably no-one knows what was intended here.
>
> What happens when you change this to static?
Nothing good. It doesn't seem to find java.lang at all:
../../../libjava/java/awt/AWTPermission.java:103: error: Type `String' not
found in the declaration of the argument `name' of method `<init>'.
public AWTPermission(String name)
> Perhaps we're supposed to read java.lang for each file. That makes
> sense in a way... but then, I've never really read through the import
> handling code.
Yeah. It may have been meant as an optimization but I'm inclined to just
remove it.
Jeff