This is the mail archive of the
java-prs@sourceware.cygnus.com
mailing list for the Java project.
gcj/273: gcj does not complain about abstract classes
- To: java-gnats at sourceware dot cygnus dot com
- Subject: gcj/273: gcj does not complain about abstract classes
- From: osk at hem dot passagen dot se
- Date: 1 Jul 2000 19:34:13 -0000
- Reply-To: osk at hem dot passagen dot se
- Resent-Cc: java-prs at sourceware dot cygnus dot com, green at cygnus dot com
- Resent-Reply-To: java-gnats@sourceware.cygnus.com, osk@hem.passagen.se
>Number: 273
>Category: gcj
>Synopsis: gcj does not complain about abstract classes
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Jul 01 12:40:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Oskar Liljeblad
>Release: unknown-1.0
>Organization:
>Environment:
Debian GNU/Linux
GNU libc 2.1.3
gcc 2.96 snapshot 20000612
libgcj snapshot 2000-06-18
>Description:
gcj compiles non-abstract java classes which contain
abstract methods without complaining.
-------------------------
$ cat >Test.java
abstract class Abstract {
public abstract int abstractMethod();
}
class Concrete extends Abstract { }
^D
$ gcj -C Test.java
$ javac Test.java
Test.java:9: class Test must be declared abstract. It does not define int getSize() from class Component.
public class Test extends Component {
^
Test.java:19: class Test is an abstract class. It can't be instantiated.
new Test();
^
2 errors
$ rm *.class
$ gcj -c Test.java
Test.java:2: warning: abstract method in non-abstract class
-------------------------
Note that 'gcj -c' warns about it.
Oskar Liljeblad (osk@hem.passagen.se)
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: