Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 499306

Summary: Pulling up a method introduces compilation errors due to visibility changes
Product: [Eclipse Project] JDT Reporter: Melina Mongiovi <melmongiovi>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.5   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug

Description Melina Mongiovi CLA 2016-08-06 13:42:47 EDT
Reproducing the bug:

Consider the following program:
package pkg1;
import java.util.List;
public class A implements B.Foo {
  public void b(){
    List<Object> l=null;
  }
}

package pkg1;
import java.util.List;
public class B {
interface Foo {
  }
static class Bar implements Foo {
    /** 
 * baz it! 
 */
    void baz(    final String s){
    }
  }
}


Now, let's pull up method b from class A to interface B.Foo.

Resulting program:

package pkg1;
import java.util.List;
public class A implements B.Foo {
  public void b(){
    List<Object> l=null;
  }
}

package pkg1;
import java.util.List;
public class B {
interface Foo {

	void b();
  }
static class Bar implements Foo {
    /** 
 * baz it! 
 */
    void baz(    final String s){
    }

	void b() {
	}
  }
}


After the refactoring, the resulting program does not compile.
Comment 1 Eclipse Genie CLA 2019-12-09 19:39:08 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.