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

Bug 43060

Summary: automatically add this or class-names on field access
Product: [Eclipse Project] JDT Reporter: Sven Köhler <sven.koehler>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 Keywords: helpwanted
Version: 3.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Sven Köhler CLA 2003-09-12 18:30:33 EDT
Hi,

often there is code like this:

class Test1
{
  public static final int MYCONST=1;
}
class Test2 extends Test1
{
  private int a, b, c;

  public void run()
  {
    a = Test2.MYCONST;
    b = this.MYCONST;
    c = MYCONST;
  }
}

the code should be
[...]
  this.a = Test1.MYCONST;
  this.b = Test1.MYCONST;
  this.c = Test1.MYCONST;
[...]

I'd like to be abled to do that which a few clicks for many source files - like
Organize Imports.
I don't know what the feature should be called in the menu, but a window should
appear where i can select the following options:
- add "this" to access of non-static members
-- also for inner classes
- add classname to access of static memebers
-- fix wrong class names
-- fix usage of object instead of class

That would help me a lot.

Thx
  Sven
Comment 1 Philipe Mulet CLA 2003-09-15 06:33:54 EDT
You have optional warnings for most of these already.
Comment 2 Sven Köhler CLA 2003-09-15 06:49:54 EDT
but i cannot quickfix many warnings at once. I don't want to click each warning
and fix things (although that is what i'm doding right know)
Comment 3 Sven Köhler CLA 2003-09-15 06:50:54 EDT
in addition not using any Classname to access static members is not warned, as
well as not using "this". (such warnings do not make much sense)
Comment 4 Dirk Baeumer CLA 2003-09-17 05:52:53 EDT
This will very likely not happen for 3.0 without external help.
Comment 5 Denis Roy CLA 2009-08-30 02:14:54 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.