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 - Detect insertion of )'s when remainder of line contains only )'s and ;'s
Summary: Detect insertion of )'s when remainder of line contains only )'s and ;'s
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-13 09:31 UTC by _ tboudreau
Modified: 2010-01-23 02:58 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.