Bug 35980 - illegal code completion suggested (abstract methods)
Summary: illegal code completion suggested (abstract methods)
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-02 10:52 EST by quartz quartz CLA
Modified: 2003-08-28 04:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description quartz quartz CLA 2003-04-02 10:52:22 EST
Given these classes, the 3rd (concrete class) should implements m2().
It tries to by calling super.
and we get m2() as an offer.

abstract class A {
 abstract short m1();
 short m2(){
  return (short)42;
 }
}

abstract class B extends A {
 abstract short m2(); //re-abstract
 short m1() {
  return (short)420;
 }
}

class C extends B {
 short m2() {
  return super.m2(); //illegal
 }
}
Comment 1 Philipe Mulet CLA 2003-04-02 10:59:31 EST
Indeed, super call shouldn't resolve to an abstract method.
Comment 2 David Audel CLA 2003-08-22 05:12:04 EDT
Fixed and regression test added
  CompletionTest#testCompletionAbstractMethod1
  CompletionTest#testCompletionAbstractMethod2
  CompletionTest#testCompletionAbstractMethod3
  CompletionTest#testCompletionAbstractMethod4
Comment 3 David Audel CLA 2003-08-28 04:42:58 EDT
Verified