public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/19677] New: invalid "may not have been initialized" error
@ 2005-01-28 19:21 wasabi at larvalstage dot net
  2005-01-28 19:23 ` [Bug libgcj/19677] " wasabi at larvalstage dot net
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: wasabi at larvalstage dot net @ 2005-01-28 19:21 UTC (permalink / raw)
  To: java-prs

Following Eclipse code snippet that fails:

protected void join(InternalJob job) {
	final IJobChangeListener listener;

	synchronized (lock) {
		listener = new JobChangeAdapter() {
			public void done(IJobChangeEvent event) {
				barrier.release();
			}
		};
		job.addJobChangeListener(listener);
	}
}

The error reports the line containing listener = as the problem.

-- 
           Summary: invalid "may not have been initialized" error
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wasabi at larvalstage dot net
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


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


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

* [Bug libgcj/19677] invalid "may not have been initialized" error
  2005-01-28 19:21 [Bug libgcj/19677] New: invalid "may not have been initialized" error wasabi at larvalstage dot net
@ 2005-01-28 19:23 ` wasabi at larvalstage dot net
  2005-01-28 19:35 ` [Bug java/19677] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: wasabi at larvalstage dot net @ 2005-01-28 19:23 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From wasabi at larvalstage dot net  2005-01-28 19:23 -------
Oh yes, of course:

runtime.jar:
    [mkdir] Created dir:
/tmp/ram/eclipse-3.0.1/source-tree/plugins/org.eclipse.core.runtime/temp.folder/runtime.jar.bin
    [javac] Compiling 158 source files to
/tmp/ram/eclipse-3.0.1/source-tree/plugins/org.eclipse.core.runtime/temp.folder/runtime.jar.bin
    [javac]
/tmp/ram/eclipse-3.0.1/source-tree/plugins/org.eclipse.core.runtime/src/org/eclipse/core/internal/jobs/JobManager.java:
In class `org.eclipse.core.internal.jobs.JobManager':
    [javac]
/tmp/ram/eclipse-3.0.1/source-tree/plugins/org.eclipse.core.runtime/src/org/eclipse/core/internal/jobs/JobManager.java:
In method
`org.eclipse.core.internal.jobs.JobManager.join(org.eclipse.core.internal.jobs.InternalJob)':
    [javac]
/tmp/ram/eclipse-3.0.1/source-tree/plugins/org.eclipse.core.runtime/src/org/eclipse/core/internal/jobs/JobManager.java:548:
error: Variable `listener' may not have been initialized.
    [javac]                     };
    [javac]    ^
    [javac] 1 error


-- 


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


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

* [Bug java/19677] invalid "may not have been initialized" error
  2005-01-28 19:21 [Bug libgcj/19677] New: invalid "may not have been initialized" error wasabi at larvalstage dot net
  2005-01-28 19:23 ` [Bug libgcj/19677] " wasabi at larvalstage dot net
@ 2005-01-28 19:35 ` pinskia at gcc dot gnu dot org
  2005-01-28 19:43 ` pinskia at gcc dot gnu dot org
  2005-01-30 19:03 ` tromey at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-28 19:35 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-28 19:35 -------
Confirmed, reduced to:
class a1 { public int f(){return 1;} }
class t
{
  Object f;
  void g(a1 a)  {}
  void f()
  {
    final a1 a;
    a = new a1 () { public int f(){return 0;}};
    g(a);
  }
}


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|libgcj                      |java
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic, rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2005-01-28 19:35:32
               date|                            |


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


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

* [Bug java/19677] invalid "may not have been initialized" error
  2005-01-28 19:21 [Bug libgcj/19677] New: invalid "may not have been initialized" error wasabi at larvalstage dot net
  2005-01-28 19:23 ` [Bug libgcj/19677] " wasabi at larvalstage dot net
  2005-01-28 19:35 ` [Bug java/19677] " pinskia at gcc dot gnu dot org
@ 2005-01-28 19:43 ` pinskia at gcc dot gnu dot org
  2005-01-30 19:03 ` tromey at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-28 19:43 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-28 19:43 -------
Related to bug 16839.  The problem might be the same problem after all because final are collected for 
anonymous inner classes.

-- 


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


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

* [Bug java/19677] invalid "may not have been initialized" error
  2005-01-28 19:21 [Bug libgcj/19677] New: invalid "may not have been initialized" error wasabi at larvalstage dot net
                   ` (2 preceding siblings ...)
  2005-01-28 19:43 ` pinskia at gcc dot gnu dot org
@ 2005-01-30 19:03 ` tromey at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-01-30 19:03 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-01-30 19:02 -------
Yes, the underlying problem is the same as with bug 16839.
gcj captures all 'final' local variables in an anonymous class.
This is incorrect -- it should only capture those which are actually
used.


-- 


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


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

end of thread, other threads:[~2005-01-30 19:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-28 19:21 [Bug libgcj/19677] New: invalid "may not have been initialized" error wasabi at larvalstage dot net
2005-01-28 19:23 ` [Bug libgcj/19677] " wasabi at larvalstage dot net
2005-01-28 19:35 ` [Bug java/19677] " pinskia at gcc dot gnu dot org
2005-01-28 19:43 ` pinskia at gcc dot gnu dot org
2005-01-30 19:03 ` 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).