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 177657 - Semicolon inserted at wrong position
Summary: Semicolon inserted at wrong position
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 189399 190442 196614 196752 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-11-26 04:03 UTC by Jiri Prox
Modified: 2011-03-22 09:57 UTC (History)
5 users (show)

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 Jiri Prox 2009-11-26 04:03:29 UTC
Product Version: NetBeans IDE 6.8 RC1 (Build 200911252200)
Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
System: Linux version 2.6.24-23-generic running on i386; UTF-8; en_US (nb)

Semicolon is inserted at wrong position when using CC to complete following code:

Input i = new Input("/searchtext/test.txt");
SearchEngine engine = new AutomatonSearchEngine();
engine.prepare(new String[]{"abc","abd"});
((AutomatonSearchEngine)engine).  // <------- here invoke CC
Result search = engine.search(i);

After selecting method returning void in the marked position the code is completed, but the semicolon is inserted at wrong place

Input i = new Input("/searchtext/test.txt");
SearchEngine engine = new AutomatonSearchEngine();
engine.prepare(new String[]{"abc","abd"});
((AutomatonSearchEngine)engine).traverseAllNodes()
Result; search = engine.search(i);
Comment 1 Max Sauer 2009-12-07 05:31:03 UTC
Honzo, please have a look, thanks.
Comment 2 Jan Lahoda 2009-12-22 05:04:32 UTC
A sample that uses only standard classes:
        Runnable r = null;
        ((CharSequence) r).
        String str = "";

The trees are pretty broken in this case ('String' is a name in member select '((CharSequence) r).String', and assignment 'str = "";'). Probably simplest would be to change the CC to handle these broken trees more gracefully (alternatively, the error recovery could be improved, but that could be quite difficult).
Comment 3 Jan Lahoda 2010-08-16 12:33:10 UTC
*** Bug 189399 has been marked as a duplicate of this bug. ***
Comment 4 Dusan Balek 2010-09-29 15:08:48 UTC
*** Bug 190442 has been marked as a duplicate of this bug. ***
Comment 5 Dusan Balek 2011-03-14 09:23:20 UTC
*** Bug 196614 has been marked as a duplicate of this bug. ***
Comment 6 Dusan Balek 2011-03-21 10:55:23 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/0a374763a147
Comment 7 Dusan Balek 2011-03-21 11:04:22 UTC
*** Bug 196752 has been marked as a duplicate of this bug. ***
Comment 8 Quality Engineering 2011-03-22 09:57:58 UTC
Integrated into 'main-golden', will be available in build *201103220400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/0a374763a147
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #177657: Semicolon inserted at wrong position - fixed.