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 247147

Summary: Code template is not called when tab pressed in method parameters filling
Product: editor Reporter: honza.hubeny
Component: Completion & TemplatesAssignee: Dusan Balek <dbalek>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P1    
Version: 8.0.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description honza.hubeny 2014-09-16 06:32:48 UTC
Let's have defined following code template:

sc  ->   String.class${cursor}

Further, let's have following class:

public class DataSet {

..........

public <E extends Object> E getColumnValue(String columnName, Class<E> clazz) {

        return (E) activeRow.get(columnName);
    }
..........
}

Now when we use this class in editor and type

String columnName = "TEST";
DataSet ds = new DataSet();
ds.getColumnValue  
     <<NOW press Ctrl+Space and we get>>
ds.getColumnValue(columnName,null)   <<literal columnName is now in the red square, we press tab key>>

ds.getColumnValue(columnName,null) <<now literal null is in red square>>
<< we now type sc and the tab key>>

And here come the bug:
till netbeans 7.x the behaviour was following:

the sc code template was used and you get
ds.getColumnValue(columnName, String.class)

now in netbeans 8.x after typing sc and tab key the red square jumps back to previous literal columnName and you are unable to use any code template until you press several times Esc key and jump out from "red square method parameter round robin".

Following behaviuor was observed on Ubuntu 12.04, Ubuntu 14.04 MacOS X10.
Comment 1 Jiri Prox 2014-09-16 14:24:43 UTC

*** This bug has been marked as a duplicate of bug 242789 ***