[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Declaring RuntimeExceptions?
From: |
Sascha Brawer |
Subject: |
Re: Declaring RuntimeExceptions? |
Date: |
Fri, 12 Sep 2003 02:37:22 +0200 |
So, should a java compiler accept the following?
// java.awt.HeadlessException
// extends java.lang.UnsupportedOperationException
// extends java.lang.RuntimeException
class Foo
{
void meth() throws java.awt.HeadlessException { }
}
class Bar
extends Foo
{
void meth() { }
}
javac 1.4.1 compiles this code, but gcj 3.2 complains about the throws
clause (of *Foo*.meth, which is a bit misleading).
Note that Foo may be a JDK class, and Bar some user class. If the above
code does not conform to the language specification, i.e. gcj is right,
our Foos must declare exactly the same exceptions as the JDK, or existing
user code may not compile with Classpath.
-- Sascha
Sascha Brawer, address@hidden, http://www.dandelis.ch/people/brawer/
- Declaring RuntimeExceptions?, Sascha Brawer, 2003/09/11
- Re: Declaring RuntimeExceptions?, Brian Jones, 2003/09/11
- Re: Declaring RuntimeExceptions?, Ingo Prötel, 2003/09/11
- Re: Declaring RuntimeExceptions?, Otavio Pereira, 2003/09/11
- RE: Declaring RuntimeExceptions?, David Holmes, 2003/09/11
- Re: Declaring RuntimeExceptions?, Eric Blake, 2003/09/11
- Re: Declaring RuntimeExceptions?,
Sascha Brawer <=
- Re: Declaring RuntimeExceptions?, Stephen Crawley, 2003/09/11
- RE: Declaring RuntimeExceptions?, David Holmes, 2003/09/11
- Re: Declaring RuntimeExceptions?, Tom Tromey, 2003/09/17
Re: Declaring RuntimeExceptions?, Tom Tromey, 2003/09/11