Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4836078

Mantis javac thinks equals(Object) can be abstract

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.4.2
    • tools
    • None
    • x86
    • linux_redhat_7.2

      javac from 1.4.2 b18 cannot compile sources for Sun ONE Studio 5.0 "Nevada" = NetBeans 3.5, even after working around bug #4832887:

      all-jarpackager:
      Building module jarpackager...

      init:

      compile:
      Compiling 72 source files to /space/src/nevada/nb_all/jarpackager/src
      /space/src/nevada/nb_all/jarpackager/src/org/netbeans/modules/jarpackager/JarCompiler.java:104: abstract method equals(java.lang.Object) cannot be accessed directly
                  return super.equals(obj) && (jc == other.jc);
                              ^
      Note: Some input files use or override a deprecated API.
      Note: Recompile with -deprecation for details.
      1 error

      The bug can be narrowed down to a small test case:

      testabstractequals$ cat TestAbstractEquals.java
      public class TestAbstractEquals {
          public interface I {
              boolean equals(Object o);
          }
          public abstract class A implements I {}
          public class B extends A {
              public boolean equals(Object o) {
                  return super.equals(o);
              }
          }
      }
      testabstractequals$ /space/jdk1.4.2-beta-b18/bin/javac TestAbstractEquals.java
      TestAbstractEquals.java:8: abstract method equals(java.lang.Object) cannot be accessed directly
                  return super.equals(o);
                              ^
      1 error
      testabstractequals$ /space/jdk1.4.1_01/bin/javac TestAbstractEquals.java
      testabstractequals$

      Of course super from B.equals refers to Object.equals which is not abstract.

      This is a regression from 1.4.1_01.
      ###@###.### 2003-03-21
      ###@###.### 2003-03-21

            gafter Neal Gafter (Inactive)
            jglick Jesse Glick (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: