This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 119871 - [60cat] Code completion does not work before importing
Summary: [60cat] Code completion does not work before importing
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P2 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2007-10-24 09:36 UTC by tboerkel
Modified: 2007-11-05 13:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tboerkel 2007-10-24 09:36:33 UTC
[ BUILD # : 200710212201 ]
[ JDK VERSION : 1.6.0_03 ]

Example:

import java.util.HashMap;

public class Test {
  public void t() {
    HashMap<String, String> myMap = new HashMap<String, String>();
    
    for(Map
  }
}


Now type a "." after "Map". You get NOTHING in NB 6.0. This is a
serious regression, because in NB 5.x, you get 2 suggestions, one of
them being "Entry".

The intention of this case is to write this code:
    
    for(Map.Entry<String, String> x : myMap.entrySet()) {
      
    }

NB 6.0 code completion only works AFTER importing java.util.Map.

This may be by design, but I see it as an annoying bug.
Comment 1 Vitezslav Stejskal 2007-10-24 12:58:12 UTC
Reproducible in a dev build.
Comment 2 benatidc 2007-10-24 13:26:24 UTC
I thought I'd point out that even though NB5.5 would complete for classes that weren't imported, sometimes it would choose the wrong one, if there were 
more than one class with the same name.
Comment 3 _ theanuradha 2007-10-24 13:55:04 UTC
IMO this Is not a bug Type Map and hit Ctrl+Shift+I and It ask in place import like CC
Comment 4 Dusan Balek 2007-10-30 15:00:52 UTC
Fixed.

Checking in JavaCompletionProvider.java;
/cvs/java/editor/src/org/netbeans/modules/editor/java/JavaCompletionProvider.java,v  <--  JavaCompletionProvider.java
new revision: 1.164; previous revision: 1.163
done