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 40065

Summary: Detect insertion of )'s when remainder of line contains only )'s and ;'s
Product: java Reporter: _ tboudreau <tboudreau>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description _ tboudreau 2004-02-13 09:31:44 UTC
A small enhancement to the automatic )'s in 3.6:

I often find myself modifying a line such as:

System.out.println ("Thingy: " + c.getClass().getName());
                                                 ^

by putting the caret at the ^ and changing it to:

System.out.println ("Thingy: " + (c != null ? c.getClass.getName() 
: "null")));

When I type the closing ) for the ? : clause, it just overwrites the 
existing ), so none is added.  This is non-optimal, because I end 
up retyping the rest of the )'s so I can add one at the end.

Two possibilities for handling this situation:

1.  (simple) - detect if all the remaining characters on the line 
are )'s followed by a ; and if so, allow the insertion.

2. (not as simple) - detect if there are an unbalanced number of 
parentheses on the line (possibly handling split lines?) and allow 
the insertion if it will make them balance
Comment 1 Roman Strobl 2005-01-21 15:49:52 UTC
Changed subcomponent to code completion.