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

Bug 87056

Summary: [pull up] warn when merging constants with different initializers [refactoring]
Product: [Eclipse Project] JDT Reporter: Heywinkel <klaus.heywinkel>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: kenneth
Version: 3.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Heywinkel CLA 2005-03-03 04:56:00 EST
Situation: Class B and class C both extends class A. Class B and C both 
contain the same constant in the form 'private final static int NN = xx', but 
in class B the value of NN is 1, in class C the value is 2.

Error: In class B action Refactor->Pull up is called so that the constant NN 
is pulled up to class A. In the same action Eclipse suggests to pull up the 
constant from class C as well. But the moved constant in class A will have the 
value of 1. So the constant has now a different value for class B then prior 
this action.

Conclusion: There should at least be a warning before the pull-up-action, that 
the two constants have different values.
Comment 1 Eclipse Genie CLA 2020-06-29 09:41:44 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.

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.
Comment 2 Kenneth Styrberg CLA 2020-06-30 15:48:57 EDT
Tested with Eclipse 2020-06, the refactor does not offer to move constant from other classes.

Closing this. Please reopen if there is another similar case that does not work.