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 92739 - Editor remembers previous completions a little too well
Summary: Editor remembers previous completions a little too well
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-17 21:33 UTC by _ tboudreau
Modified: 2007-09-26 09:14 UTC (History)
0 users

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 _ tboudreau 2007-01-17 21:33:35 UTC
Enter the following code.  Use "Buffered" and press ctrl-space to get
"BufferedReader", "Input" ctrl-space to get InputStreamReader.  You will see a
list of choices in code completion for both.

Now delete the code and do the same thing again.  This time code completion
automatically completes Buffered as BufferedReader and shows no list of options;
 same thing for InputStreamReader.  It should still show the list of classes.

    public static void main(String[] args) throws IOException {
        System.out.println("How many rabbits");
        BufferedReader b = new BufferedReader (new InputStreamReader (System.in));
        String s = b.readLine();

        int ct = Integer.parseInt(s);
        int val = fib (ct);
        System.out.println("After " + ct + " generations there are " + val + "
rabbits");
    }
    
    private static final int fib (int n) {
        return n == 0 ? 0 : n == 1 ? 1 : fib (n - 2) + fib (n - 1);
    }
Comment 1 Jiri Prox 2007-01-18 08:04:10 UTC
It is as designed. When you called CC for the first time, the prefix Buffered
cannot be found in normal CC so the all-symbols was automaticaly used. Here you
selected BufferedReader and it was automaticaly imported. When you invoked CC
for the second time, the normal CC find one possible completion (since the
import) and automaticaly inserted it (auto substitution can be switched off in
the options). If you want the all-symbols CC in the second case you should use
ctrl-alt-space.