test.foo
Class Class2
java.lang.Object
|
+--test.foo.Class1
|
+--test.foo.Class2
- Direct Known Subclasses:
- Class3
- public abstract class Class2
- extends Class1
Untamed: Demonstrates a bug in Sun's j2sdk1.4.1's javac compiler.
This class itself compiles, as it should, whether or not it is declared
abstract. However, if it is declared abstract, then its concrete subclass,
test.bar.Class3
, refuses to compile:
test/bar/Class3.java:14: test.bar.Class3 should be declared abstract; \
it does not define zip() in test.foo.Class1
public class Class3 extends Class2 {
^
1 error
This is wrong, because the abstract zip() from Class1
is defined
here in Class2. But perhaps because it is package (ie default) scope,
and Class3 is in a different package, the compiler misses this when
Class2 is abstract.
- Author:
- Mark S. Miller
Constructor Summary |
Class2()
Enabled: |
Method Summary |
(package private) void |
zip()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Class2
public Class2()
- Enabled:
zip
void zip()
- Specified by:
zip
in class Class1
comments?