Bug 43060 - automatically add this or class-names on field access
Summary: automatically add this or class-names on field access
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2003-09-12 18:30 EDT by Sven Köhler CLA
Modified: 2009-08-30 02:14 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.