This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
java/1134: Incompatible inherited throws clause are not catched by gcj
- To: java-gnats at sourceware dot cygnus dot com
- Subject: java/1134: Incompatible inherited throws clause are not catched by gcj
- From: joerg dot brunsmann at fernuni-hagen dot de
- Date: 6 Jan 2000 11:01:59 -0000
- Reply-To: joerg dot brunsmann at fernuni-hagen dot de
>Number: 1134
>Category: java
>Synopsis: Incompatible inherited throws clause are not catched by gcj
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:06:27 PST 2000
>Closed-Date: Mon Mar 06 01:32:54 PST 2000
>Last-Modified: Mon Mar 6 01:40:00 PST 2000
>Originator: joerg.brunsmann@fernuni-hagen.de
>Release: unknown-1.0
>Organization:
>Environment:
>Description:
Incompatible inherited throws clause are not catched by gcj
>How-To-Repeat:
public class E1 extends Exception {}
public class E2 extends Exception {}
public class E3 extends E2 {}
abstract class X {
abstract void f() throws E1, E3;
}
class Y extends X {
void f() throws E1, E2 {
}
}
compile these with
$ javac *.java
Y.java:4: The method void f() declared in class Y cannot override the method of the same signature declared in class X. Their throws clauses are incompatible.
void f() throws E1, E2 {
^
1 error
gcj doesn't spit out an error
>Fix:
>Release-Note:
>Audit-Trail:
Formerly PR gcj/126
From: Bryce McKinlay <bryce@albatross.co.nz>
To: java-gnats@sourceware.cygnus.com, apbianco@cygnus.com,
joerg.brunsmann@fernuni-hagen.de
Cc:
Subject: Re: gcj/126
Date: Mon, 06 Mar 2000 21:54:01 +1300
Hi Joerg,
I believe this PR has been fixed. Building your test case with the
latest compiler (20000303), I get:
Y.java:3: Invalid checked exception class `E2' in `throws' clause. The
exception must be a subclass of an exception thrown by `f()' from class
`X'.
void f() throws E1, E2 {
^
1 error
Do you agree?
regards
[ bryce ]
http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=126&database=java
From: Joerg Brunsmann <joerg.brunsmann@FernUni-Hagen.de>
To: Bryce McKinlay <bryce@albatross.co.nz>
Cc: java-gnats@sourceware.cygnus.com, apbianco@cygnus.com
Subject: Re: gcj/126
Date: Mon, 06 Mar 2000 10:20:59 +0100
Hi Bryce,
> I believe this PR has been fixed. Building your test case with the
> latest compiler (20000303), I get:
> =
> Y.java:3: Invalid checked exception class `E2' in `throws' clause. The
> exception must be a subclass of an exception thrown by `f()' from class
> `X'.
> void f() throws E1, E2 {
> ^
> 1 error
> =
> Do you agree?
I just checked it with gcc version 2.96 20000221 and it spits out
an error message, so I agree that this PR has been fixed. Thanks.
J=F6rg
State-Changed-From-To: open->closed
State-Changed-By: bryce
State-Changed-When: Mon Mar 6 01:32:54 2000
State-Changed-Why:
Bug appears to be fixed in recent cvs compilers. Joerg has
verified this.
From: bryce@albatross.co.nz
To: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com,
joerg.brunsmann@fernuni-hagen.de
Cc:
Subject: Re: gcj/126
Date: 6 Mar 2000 09:32:54 -0000
Synopsis: Incompatible inherited throws clause are not catched by gcj
State-Changed-From-To: open->closed
State-Changed-By: bryce
State-Changed-When: Mon Mar 6 01:32:54 2000
State-Changed-Why:
Bug appears to be fixed in recent cvs compilers. Joerg has
verified this.
http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=126&database=java
>Unformatted: