This is the mail archive of the
java-prs@sources.redhat.com
mailing list for the Java project.
gcj/312: Bogus error from java/awt/Window.java
- To: java-gnats at sourceware dot cygnus dot com
- Subject: gcj/312: Bogus error from java/awt/Window.java
- From: bryce at albatross dot co dot nz
- Date: 9 Aug 2000 12:30:24 -0000
- Reply-To: bryce at albatross dot co dot nz
- Resent-Cc: java-prs at sourceware dot cygnus dot com, green at cygnus dot com
- Resent-Reply-To: java-gnats@sourceware.cygnus.com, bryce@albatross.co.nz
>Number: 312
>Category: gcj
>Synopsis: Bogus error from java/awt/Window.java
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Aug 09 05:40:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Bryce McKinlay
>Release: gcc version 2.96 20000809 (experimental)
>Organization:
>Environment:
linux on ia32
>Description:
java/awt/Window.java contains a method like this:
public void addNotify()
{
if (peer == null)
peer = (ComponentPeer) getToolkit ().createWindow (this);
}
However, the cast to (ComponentPeer) *should* be
unneccessary, because ComponetPeer is a superinterface of
WindowPeer (and jikes agrees with me).
If the cast is removed, we get a strange error message
the second time it is compiled when building libgcj (it
compiles fine to bytecode but not to native code):
javac="gcj -C"; cd ../../../libjava; \
$javac -g -classpath /home/bryce/cvs/libgcj/build/i686-pc-linux-gnu/libjava:`/
bin/pwd` -d /home/bryce/cvs/libgcj/build/i686-pc-linux-gnu/libjava \
java/awt/Window.java
java/awt/Window.java: In class `java.awt.Window':
java/awt/Window.java: In method `addNotify()':
java/awt/Window.java:80: Incompatible type for `='. Explicit cast needed to conv
ert `java.awt.peer.WindowPeer' to `java.awt.peer.ComponentPeer'.
peer = getToolkit ().createWindow (this);
^
java/awt/Window.java: In method `class$(java.lang.String)':
java/awt/Window.java:1: Missing return statement.
/* Copyright (C) 1999, 2000 Free Software Foundation
^
2 errors
>How-To-Repeat:
Remove the cast from java.awt.Window.addNotify() and try
to rebuild libgcj.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: