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 134429 - Autocompletion in class-inside-method should include non-final matches in method scope
Summary: Autocompletion in class-inside-method should include non-final matches in met...
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P3 blocker with 1 vote (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2008-05-02 19:56 UTC by _ tboudreau
Modified: 2013-09-02 14:19 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2008-05-02 19:56:16 UTC
If in inner class in method, completions should include non-final objects in scope and automatically final them if necessary.  Example:

 public void testLongDescription() {
        Wizard w = WizardPage.createWizard(new Class[] { AP.class });
        EventQueue.invokeAndWait(new Runnable() {
            public void run() {
        String s = w.getLongDescription("one");
        assertEquals ("LONG DESCRIPTION", ((AP) jc).getLongDescription());
        assertEquals ("LONG DESCRIPTION", s);

I am adding the EventQueue.invokeAndWait() call and creating the runnable.  I complete WizardDisplayer.showWizard(), which takes an argument of Wizard.  
The variable w is in scope, but it is not final.  So code completion supplies a bogus variable "wizard".

It would be better if it would offer "w" and if I accept it, it would add "final" before the line beginning "Wizard w".