Bug 31862 - [push down] error condition not detected [refactoring]
Summary: [push down] error condition not detected [refactoring]
Status: RESOLVED DUPLICATE of bug 211861
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-14 06:25 EST by Adam Kiezun CLA
Modified: 2007-12-04 06:13 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2003-02-14 06:25:08 EST
20030211
class A{
 public void f(){}
}
class B extends A{}
class C{
  void foo(A a){
     a.f();
  }
}

pushing A.f to B will result in compile error

since we don't want downcasts (and, in general when there's more than 1 
subclass of A, there's nothing to donwcast to), we should detect this case and 
issue an error
Comment 1 Dirk Baeumer CLA 2003-02-14 06:49:49 EST
Not critical for 2.1, since we get a compile error.
Comment 2 Dirk Baeumer CLA 2004-09-15 13:18:01 EDT
Detecting this case requires scanning all references to the method to be 
pushed down and check if the expression on which they are called is at least 
of type B.

Instead of issue a warning I would prefer a button that computes all methods 
that must stay abstract.
Comment 3 Martin Aeschlimann CLA 2007-12-04 06:13:01 EST

*** This bug has been marked as a duplicate of bug 211861 ***