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

Bug 88439

Summary: [move static members] does not qualify access to static field from supertype [refactoring]
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: Brian.Miller, dirk_baeumer
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Markus Keller CLA 2005-03-18 07:07:56 EST
I20050315-1100 (already in 3.0.2)

Move static members does not qualify access to static field from supertype:

class Counter {
    static int fgCount;
}
class Zaehler extends Counter {
    static void up() { // move to Target
        fgCount++;
    }
}

class Target {
    
}

Was:
class Target {
    static void up() { // move to target
        fgCount++;
    }
}

Expected:
class Target {
    static void up() { // move to target
        Counter.fgCount++;
    }
}

One could argue about rewriting to "Zaehler.fgCount++;", but this would generate
code with a warning (depending on the compiler settings).
Comment 1 Dirk Baeumer CLA 2005-03-18 13:18:27 EST
Please investigate. How relevant is the scenario in normal day to day development.
Comment 2 Tobias Widmer CLA 2005-03-21 04:27:33 EST
It only occurs in setups having a super/sub type as described above. I have to 
do a fix pass anyway to address bug 81257, which is a related rewriting problem
Comment 3 Dirk Baeumer CLA 2005-03-21 04:59:54 EST
OK.
Comment 4 Markus Keller CLA 2010-01-25 08:39:33 EST
*** Bug 300573 has been marked as a duplicate of this bug. ***
Comment 5 Eclipse Genie CLA 2019-06-21 09:48:54 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.