This is the mail archive of the java-prs@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcj/312: Bogus error from java/awt/Window.java



>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:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]