Bug 25429 - can't see private static final int CREATE = 1
Summary: can't see private static final int CREATE = 1
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.0.0
: P3 normal
Target Milestone: 4.0.3
Assignee: Andrew Haley
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-15 16:29 UTC by Andrew Haley
Modified: 2005-12-16 17:30 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.2.0
Last reconfirmed: 2005-12-15 16:33:13


Attachments
Patch (490 bytes, patch)
2005-12-15 16:32 UTC, Andrew Haley
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Haley 2005-12-15 16:29:58 UTC
[cagney@eclipse_1 jdom-1.0]$ gcj4 -C -I src/java src/java/org/jdom/ContentList.java
src/java/org/jdom/ContentList.java: In class 'C$I':
src/java/org/jdom/ContentList.java: In method 'C$I.f()':
src/java/org/jdom/ContentList.java:7: error: Constant expression required.
               case CONST:
               ^
src/java/org/jdom/ContentList.java: In class 'C':
src/java/org/jdom/ContentList.java: In method '<clinit>()':
src/java/org/jdom/ContentList.java:3: error: final field ‘CONST’ may not have
been initialized
src/java/org/jdom/ContentList.java:1: confused by earlier errors, bailing out




class C
{
    private static final int CONST  = 0;
    class I {
        public void f () {
            switch(0) {
            case CONST:
            }
        }
    }
}
Comment 1 Andrew Haley 2005-12-15 16:30:31 UTC
This is https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=175569
Comment 2 Andrew Haley 2005-12-15 16:32:02 UTC
Created attachment 10503 [details]
Patch
Comment 3 Andrew Pinski 2005-12-15 16:33:13 UTC
Confirmed.
Comment 4 Tom Tromey 2005-12-16 00:00:47 UTC
Subject: Bug 25429

Author: tromey
Date: Fri Dec 16 00:00:43 2005
New Revision: 108608

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108608
Log:
gcc/java:
	PR java/25429
	* parse.y (resolve_expression_name): Don't generate accessor
	methods for constant fields.
libjava:
	* testsuite/libjava.compile/rh175833.java: New file.
	* testsuite/libjava.compile/pr25429.java: New file.

Added:
    trunk/libjava/testsuite/libjava.compile/pr25429.java
    trunk/libjava/testsuite/libjava.compile/rh175833.java
Modified:
    trunk/gcc/java/ChangeLog
    trunk/gcc/java/parse.y
    trunk/libjava/ChangeLog

Comment 5 Tom Tromey 2005-12-16 00:02:55 UTC
I checked in a fix for this on svn trunk.
I will merge to 4.1 (and perhaps 4.0 -- Andrew?) tomorrow,
unless someone else wants to do it first.
Comment 6 Tom Tromey 2005-12-16 17:21:07 UTC
Subject: Bug 25429

Author: tromey
Date: Fri Dec 16 17:20:59 2005
New Revision: 108660

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108660
Log:
gcc/java:
	PR java/25429
	* parse.y (resolve_expression_name): Don't generate accessor
	methods for constant fields.
libjava:
	* testsuite/libjava.jacks/jacks.xfail
	(8.5.2-accessible-static-member-usage-3): Removed.

	* testsuite/libjava.compile/rh175833.java: New file.
	* testsuite/libjava.compile/pr25429.java: New file.

Added:
    branches/gcc-4_1-branch/libjava/testsuite/libjava.compile/pr25429.java
      - copied unchanged from r108608, trunk/libjava/testsuite/libjava.compile/pr25429.java
    branches/gcc-4_1-branch/libjava/testsuite/libjava.compile/rh175833.java
      - copied unchanged from r108608, trunk/libjava/testsuite/libjava.compile/rh175833.java
Modified:
    branches/gcc-4_1-branch/gcc/java/ChangeLog
    branches/gcc-4_1-branch/gcc/java/parse.y
    branches/gcc-4_1-branch/libjava/ChangeLog
    branches/gcc-4_1-branch/libjava/testsuite/libjava.jacks/jacks.xfail

Comment 7 Tom Tromey 2005-12-16 17:24:47 UTC
Subject: Bug 25429

Author: tromey
Date: Fri Dec 16 17:24:42 2005
New Revision: 108661

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108661
Log:
gcc/java:
	PR java/25429
	* parse.y (resolve_expression_name): Don't generate accessor
	methods for constant fields.
libjava:
	* testsuite/libjava.jacks/jacks.xfail
	(8.5.2-accessible-static-member-usage-3): Removed.

	* testsuite/libjava.compile/rh175833.java: New file.
	* testsuite/libjava.compile/pr25429.java: New file.

Added:
    branches/gcc-4_0-branch/libjava/testsuite/libjava.compile/pr25429.java
      - copied unchanged from r108608, trunk/libjava/testsuite/libjava.compile/pr25429.java
    branches/gcc-4_0-branch/libjava/testsuite/libjava.compile/rh175833.java
      - copied unchanged from r108608, trunk/libjava/testsuite/libjava.compile/rh175833.java
Modified:
    branches/gcc-4_0-branch/gcc/java/ChangeLog
    branches/gcc-4_0-branch/gcc/java/parse.y
    branches/gcc-4_0-branch/libjava/ChangeLog
    branches/gcc-4_0-branch/libjava/testsuite/libjava.jacks/jacks.xfail

Comment 8 Tom Tromey 2005-12-16 17:30:02 UTC
Fix checked in.