public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/1274: Fields can be static in an inner class when they are final
@ 2000-12-20 12:24 mark
0 siblings, 0 replies; only message in thread
From: mark @ 2000-12-20 12:24 UTC (permalink / raw)
To: java-gnats
>Number: 1274
>Category: java
>Synopsis: Fields can be static in an inner class when they are final
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:18:35 PST 2000
>Closed-Date: Mon Jun 26 21:24:52 PDT 2000
>Last-Modified: Mon Jun 26 21:30:00 PDT 2000
>Originator: mark@klomp.org
>Release: gcc version 2.96 20000602 (experimental)
>Organization:
>Environment:
>Description:
A field in an inner class can be static if it is final.
The following should compile, but doesn't:
public class A {
public static void main(String args[]) {
System.out.println(B.Hello.WORLD);
}
}
class B {
class Hello {
public static final String WORLD = "Hello World!";
}
}
Compiling with gjc --main=A A.java gives:
A.java:9: Field `WORLD' can't be static in innerclass `B$Hello'. Only members of interfaces and top-level classes can be static.
public static final String WORLD = "Hello World!";
^
1 error
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Formerly PR gcj/255
State-Changed-From-To: open->feedback
State-Changed-By: bryce
State-Changed-When: Thu Jun 8 22:55:21 2000
State-Changed-Why:
I submitted a patch:
http://gcc.gnu.org/ml/gcc-patches/2000-06/msg00266.html
This test case still won't compile though, due to PR 256.
From: bryce@albatross.co.nz
To: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com, mark@klomp.org
Cc:
Subject: Re: gcj/255
Date: 9 Jun 2000 05:55:21 -0000
Synopsis: Fields can be static in an inner class when they are final
State-Changed-From-To: open->feedback
State-Changed-By: bryce
State-Changed-When: Thu Jun 8 22:55:21 2000
State-Changed-Why:
I submitted a patch:
http://gcc.gnu.org/ml/gcc-patches/2000-06/msg00266.html
This test case still won't compile though, due to PR 256.
http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=255&database=java
From: Mark Wielaard <mark@klomp.org>
To: bryce@albatross.co.nz
Cc: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com
Subject: Re: gcj/255
Date: Sat, 10 Jun 2000 01:20:40 +0200
Hi,
That patch (and hint http://gcc.gnu.org/ml/gcc-patches/2000-06/msg00276.html )
fixed the problem this bug report was about.
As test case you could take only the second class in the original report:
public class B {
public class Hello {
public static final String WORLD = "Hello World!";
}
}
Which now compiles cleanly.
Thanks,
Mark
State-Changed-From-To: feedback->closed
State-Changed-By: apbianco
State-Changed-When: Mon Jun 26 21:24:52 2000
State-Changed-Why:
I checked in Bryce's patch:
http://gcc.gnu.org/ml/gcc-patches/2000-06/msg00266.html
From: apbianco@cygnus.com
To: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com, mark@klomp.org
Cc:
Subject: Re: gcj/255
Date: 27 Jun 2000 04:24:52 -0000
Synopsis: Fields can be static in an inner class when they are final
State-Changed-From-To: feedback->closed
State-Changed-By: apbianco
State-Changed-When: Mon Jun 26 21:24:52 2000
State-Changed-Why:
I checked in Bryce's patch:
http://gcc.gnu.org/ml/gcc-patches/2000-06/msg00266.html
http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=255&database=java
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-12-20 12:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:24 java/1274: Fields can be static in an inner class when they are final mark
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).