Bug 274020 - Code assist fails to deliver proposals
Summary: Code assist fails to deliver proposals
Status: VERIFIED DUPLICATE of bug 132679
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 RC1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-28 08:33 EDT by Srikanth Sankaran CLA
Modified: 2009-05-14 11:32 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2009-04-28 08:33:36 EDT
I20090426-2000

1. Create a java project with the following content (all in one file)
 
class Context {

  private int value = 10;

  public abstract class Callback {
      public abstract void doit(int value);
  }
}

public class ContextTest {

  private Context context = new Context();

  public void test() {
	  Set foo = new HashSet();
	  // quickfix on errors above offer to import HashSet and Set.
      context.new Callback() {
      public void doit(int value) {
        Set foo = new HashSet();
        // // quickfix on errors above DO NOT offer to import HashSet and Set.
       
      }
    };
  }

}

2. The compiler reports 4 errors:

- Set cannot be resolved to a type
- HashSet cannot be resolved to a type

3. As the comment in the code indicates, quickfix offers to import
the needed types only in the first "Set foo = new HashSet();" and
not in the other case.
Comment 1 Dani Megert CLA 2009-04-28 09:53:36 EDT
We use code assist and convert the type proposal into the quick fix. If you invoke code assist at the problematic locations you will see that you don't get any proposals.
Comment 2 Srikanth Sankaran CLA 2009-04-28 21:21:05 EDT
(In reply to comment #1)
> We use code assist and convert the type proposal into the quick fix. If you
> invoke code assist at the problematic locations you will see that you don't get
> any proposals.

I see. Thanks for clarifying. In that event, it would appear this
bug is really another manifestation of bug# 132679. 

Comment 3 David Audel CLA 2009-05-07 04:49:54 EDT

*** This bug has been marked as a duplicate of bug 132679 ***
Comment 4 Olivier Thomann CLA 2009-05-14 11:32:38 EDT
Verified for 3.5RC1 using I20090511-2000.