Bug 313045 - [pull up] Pulling up two fields leads to behavioral change due to a change of the value of one of the fields
Summary: [pull up] Pulling up two fields leads to behavioral change due to a change of...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-16 15:38 EDT by Gustavo Soares CLA
Modified: 2020-05-06 12:18 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Soares CLA 2010-05-16 15:38:30 EDT
Build Identifier: 20090920-1017

Apply the pull up field refactoring to a field f moves all fields f of the subclasses to the super class. If one of the fields is initialized with different value, the behavior of the program may change

Reproducible: Always

Steps to Reproduce:
1. Create the classes:

public class A {
}
public class B extends A {
  public int k = 10; 
}
public class C extends A {
  public int k = 20;
  public long test() {
    return k;
  }    
}

2. The method test returns 20 
3. Apply the pull up field refactoring to B.f

public class A {
  public int k = 10;
}
public class B extends A {   
}
public class C extends A {  
  public long test() {
    return k;
  }    
}

4. The method test returns 10 instead of 20. The refactoring changes the program behavior
Comment 1 Dani Megert CLA 2010-05-19 10:41:31 EDT
Similar to bug 313043 but the other way around.
Comment 2 Dani Megert CLA 2010-05-19 11:01:41 EDT
Not a regression.
Comment 3 Eclipse Genie CLA 2020-05-06 12:18:31 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.