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 65296 - Code completion shows templates where they cannot be used
Summary: Code completion shows templates where they cannot be used
Status: RESOLVED DUPLICATE of bug 63212
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-29 06:47 UTC by _ tboudreau
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screen shot (52.30 KB, image/png)
2005-09-29 06:48 UTC, _ tboudreau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2005-09-29 06:47:49 UTC
See attached screen shot the options available as completions of

this.s

are

static
String
switch (
synchronized 
System.err.println("");
System.out.println("");
stateChanged()

only the last one is a usable completion of "this.s" - everything else will be uncompilable.  There is  
enough information to detect this situation and avoid template completions - either check for the . as 
the previous token, or get the text back to the nearest preceding whitespace character, and only 
include templates that are exact matches.

This does deserve to be P2 - it removes most of the value of code completion if you have to hit the 
down arrow 6 times to skip invalid completions.
Comment 1 _ tboudreau 2005-09-29 06:48:22 UTC
Created attachment 25275 [details]
screen shot
Comment 2 Roman Strobl 2005-09-29 09:16:26 UTC
Thanks Tim, this one is already reported.

*** This issue has been marked as a duplicate of 63212 ***