public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/16839] New: Final vars in switch generate compile error in anonymous class.
@ 2004-07-30 22:24 beandz at hotmail dot com
  2004-07-31 16:10 ` [Bug java/16839] " tromey at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: beandz at hotmail dot com @ 2004-07-30 22:24 UTC (permalink / raw)
  To: java-prs

This valid java code generates a compile error.

public class finaltest {
    public void main(String args[]) {
        System.out.println("got to main");
        switch(23) {
        case 1:
            final String s = "x";
            break;
        case 2:
            new Runnable() {
                public void run() {
                    System.out.println("run");
                }
            };
            break;
        }
    }
}
 

C:\> \app\gcj\gcc-3.5\bin\gcj finaltest.java
finaltest.java: In class `finaltest':
finaltest.java: In method `finaltest.main(java.lang.String[])':
finaltest.java:13: error: Variable `s' may not have been initialized.
                          };
     ^
  1 error

C:\> gcj --version
gcj (GCC) 3.5.0 20040629 (experimental)
Copyright (C) 2004 Free Software Foundation, Inc.

-- 
           Summary: Final vars in switch generate compile error in anonymous
                    class.
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: beandz at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
  GCC host triplet: Win2K


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16839


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug java/16839] Final vars in switch generate compile error in anonymous class.
  2004-07-30 22:24 [Bug java/16839] New: Final vars in switch generate compile error in anonymous class beandz at hotmail dot com
@ 2004-07-31 16:10 ` tromey at gcc dot gnu dot org
  2004-12-27 14:45 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2004-07-31 16:10 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2004-07-31 16:10 -------
I believe the bug here is that gcj captures all
final local variables in an anonymous class constructor,
whether or not those variables are used by the class.
This means that "s" appears to be used by the 
"new" invocation, causing the definite assignment code
to emit an error (which would be correct if the anonymous
class actually had a use of the variable).


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-07-31 16:10:13
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16839


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug java/16839] Final vars in switch generate compile error in anonymous class.
  2004-07-30 22:24 [Bug java/16839] New: Final vars in switch generate compile error in anonymous class beandz at hotmail dot com
  2004-07-31 16:10 ` [Bug java/16839] " tromey at gcc dot gnu dot org
@ 2004-12-27 14:45 ` pinskia at gcc dot gnu dot org
  2005-01-01 20:11 ` beandz at hotmail dot com
  2005-01-01 20:17 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-27 14:45 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
   Last reconfirmed|2004-07-31 16:10:13         |2004-12-27 14:45:29
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16839


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug java/16839] Final vars in switch generate compile error in anonymous class.
  2004-07-30 22:24 [Bug java/16839] New: Final vars in switch generate compile error in anonymous class beandz at hotmail dot com
  2004-07-31 16:10 ` [Bug java/16839] " tromey at gcc dot gnu dot org
  2004-12-27 14:45 ` pinskia at gcc dot gnu dot org
@ 2005-01-01 20:11 ` beandz at hotmail dot com
  2005-01-01 20:17 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 6+ messages in thread
From: beandz at hotmail dot com @ 2005-01-01 20:11 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From beandz at hotmail dot com  2005-01-01 20:11 -------
Subject: RE:  Final vars in switch generate compile error in anonymous cl

This email makes absolutely no sense.  What information is this message 
trying to tell me?  Does anyone even know the difference between information 
and data anymore?


>From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
>Reply-To: gcc-bugzilla@gcc.gnu.org
>To: beandz@hotmail.com
>Subject: [Bug java/16839] Final vars in switch generate compile error in 
>anonymous class.
>Date: 27 Dec 2004 14:45:29 -0000
>Received: from sourceware.org ([12.107.209.250]) by mc2-f4.hotmail.com with 
>Microsoft SMTPSVC(6.0.3790.211); Mon, 27 Dec 2004 06:45:29 -0800
>Received: (qmail 2963 invoked by uid 48); 27 Dec 2004 14:45:29 -0000
>X-Message-Info: JGTYoYF78jG64Tc3+JdzXvoH9oufkYYVLa15fltp7OY=
>References: <20040730222448.16839.beandz@hotmail.com>
>X-Bugzilla-Reason: Reporter
>Return-Path: dberlin@gcc.gnu.org
>X-OriginalArrivalTime: 27 Dec 2004 14:45:29.0427 (UTC) 
>FILETIME=[B5ACF230:01C4EC22]
>
>--
>            What    |Removed                     |Added
>----------------------------------------------------------------------------
>            Keywords|                            |rejects-valid
>    Last reconfirmed|2004-07-31 16:10:13         |2004-12-27 14:45:29
>                date|                            |
>
>
>http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16839
>
>------- You are receiving this mail because: -------
>You reported the bug, or are watching the reporter.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16839


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug java/16839] Final vars in switch generate compile error in anonymous class.
  2004-07-30 22:24 [Bug java/16839] New: Final vars in switch generate compile error in anonymous class beandz at hotmail dot com
                   ` (2 preceding siblings ...)
  2005-01-01 20:11 ` beandz at hotmail dot com
@ 2005-01-01 20:17 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-01 20:17 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-01 20:17 -------
(In reply to comment #2)
> Subject: RE:  Final vars in switch generate compile error in anonymous cl
> 
> This email makes absolutely no sense.  What information is this message 
> trying to tell me?  Does anyone even know the difference between information 
> and data anymore?

Nothing, I was adding a keyword so we can keep track of different kinds of bugs.
Also I was reconfirming the bug so we know that it is still a bug in the latested CVS version of gcj.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16839


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug java/16839] Final vars in switch generate compile error in anonymous class.
       [not found] <bug-16839-9046@http.gcc.gnu.org/bugzilla/>
@ 2007-01-09 20:49 ` tromey at gcc dot gnu dot org
  0 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-01-09 20:49 UTC (permalink / raw)
  To: java-prs



------- Comment #4 from tromey at gcc dot gnu dot org  2007-01-09 20:46 -------
All gcj front end bugs have been fixed by the gcj-eclipse branch merge.
I'm mass-closing the affected PRs.
If you believe one of these was closed in error, please reopen it
with a note explaining why.
Thanks.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16839


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-01-09 20:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-30 22:24 [Bug java/16839] New: Final vars in switch generate compile error in anonymous class beandz at hotmail dot com
2004-07-31 16:10 ` [Bug java/16839] " tromey at gcc dot gnu dot org
2004-12-27 14:45 ` pinskia at gcc dot gnu dot org
2005-01-01 20:11 ` beandz at hotmail dot com
2005-01-01 20:17 ` pinskia at gcc dot gnu dot org
     [not found] <bug-16839-9046@http.gcc.gnu.org/bugzilla/>
2007-01-09 20:49 ` tromey at gcc dot gnu dot org

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).