Bug 5454 - Code Assist adds qualified code inside inner classes
Summary: Code Assist adds qualified code inside inner classes
Status: RESOLVED DUPLICATE of bug 5884
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-02 05:04 EST by Dani Megert CLA
Modified: 2002-01-11 09:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2001-11-02 05:04:43 EST
I'm not sure if this is a new feature or a bug.

I have the following code snippet (from WorkingSetDialog) and call code assist 
on fw and select fWorkingSet:
  fTree.addCheckStateListener(new ICheckStateListener() {
    public void checkStateChanged(CheckStateChangedEvent event) {
      handleCheckStateChange(event);
      fW
    }
  });

This results in:
  fTree.addCheckStateListener(new ICheckStateListener() {
    public void checkStateChanged(CheckStateChangedEvent event) {
      handleCheckStateChange(event);
      WorkingSetDialog.this.fWorkingSet
    }
  });

In previous version of Eclipse "fWorkingSet" was added instead of 
"WorkingSetDialog.this.fWorkingSet"
Comment 1 Dani Megert CLA 2001-11-02 05:32:44 EST
Build Id: 20011101
Comment 2 Philipe Mulet CLA 2001-11-02 07:46:07 EST
This is intentional. The old codeassist did not qualify such scenarii, and it 
could lead to unresolved ambiguities. We decided that when targeting something 
declared in an enclosing type, it would always qualify it, and not only if 
conflicting with something closer.

Do you really dislike this behavior ? We could make it only qualify if 
necessary, but from a style stand point, I think the resulting code is more
readable. Along the same line, it could also qualify implict field accesses 
(even if no ambiguities with other variables) but we thought this one could
be left to some user decision.

Maybe we should introduce an option to make this behavior configurable.
Comment 3 Erich Gamma CLA 2001-11-02 08:37:04 EST
I would opt for an option. We will have to provide a preference page for code 
assist anyways.
Comment 4 Dani Megert CLA 2001-11-02 08:52:01 EST
I prefer to have an option. Normally I don't write ".This." if it is not needed.
Comment 5 Philipe Mulet CLA 2001-11-29 09:24:54 EST

*** This bug has been marked as a duplicate of 5884 ***