This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcj and XGraphicsConfiguration bugs


Patching now....

I'm changing "class FontMetricsCache" should be "static class
FontMetricsCache", in case you want to make the same change on your side,
pending my patch.  My faulty code shouldn't have compiled in gcj either.  I
compiled a small test case (attached) with gcj and with Sun javac.  The
error is caught in java but not in gcj.

I wonder if this is a known bug in gcj?

----- Original Message -----
From: "Anthony Green" <green@redhat.com>
To: <java@gcc.gnu.org>; <scottg@mantatest.com>
Sent: Saturday, July 19, 2003 9:30 PM
Subject: gcj and XGraphicsConfiguration bugs


> ecj emits the following error when compiling XGraphicsConfiguration....
>
> ----------
> 1. ERROR in ../../../gcc/libjava/gnu/awt/xlib/XGraphicsConfiguration.java
(at line 46)
> static FontMetricsCache fontMetricsCache = new FontMetricsCache ();
>                                            ^^^^^^^^^^^^^^^^^^^^^^^
> No enclosing instance of type XGraphicsConfiguration is accessible. Must
qualify the allocation with an enclosing instance of type
XGraphicsConfiguration (e.g. x.new A() where x is an instance of
XGraphicsConfiguration).
> ----------
> make: *** [gnu/awt/xlib/XGraphicsConfiguration.class] Error 255
>
>
> This looks like a reasonable error.  FontMetricsCache is an inner
> class and I suppose you shouldn't be able to allocate one like
> this.
>
> The work-around I used for building libgcj with ecj was
> to replace "new FontMetricsCache ()" with "null".  Obviously we need a
> proper fix (to both libgcj and gcj).
>
> I don't know this code well enough to suggest a solution.
>
> AG
>
> --
> Anthony Green <green@redhat.com>
> Red Hat, Inc.
>

Attachment: StaticInner.java
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]