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 234884 - [Inspect&Refactor] Caret is moved to wrong position after clicking on node in preview tree
Summary: [Inspect&Refactor] Caret is moved to wrong position after clicking on node in...
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-23 13:36 UTC by Jiri Prox
Modified: 2015-02-17 11:00 UTC (History)
0 users

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 2013-08-23 13:36:33 UTC
Caret is moved to wrong position after clicking on node in preview tree. It is moved to position where will be placed code after the change.

Steps to reproduce:
1) have a code (note the empty lines):
public class PredefinedSet {

    LinkedList<String> l = new LinkedList<String>();
    
    public void method() throws FileNotFoundException, IOException {
        String a = "";
        
       
        
        
        
        
        BufferedReader br = new BufferedReader(new FileReader(""));
        try {
            br.readLine();
        } finally {
            br.close();
        }
    }                              
}
2) call Inspect&Transform and select Convert to JDK1.7 configuration
3) click on preview
4) double click on the second node in the tree (convert to try-catch with resources)

-> cursor is moved to the empty line just after  String a = "";
not at the line starting with BufferedReader


Product Version: NetBeans IDE Dev (Build 201308212300)
Updates: Updates available
Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b39
System: Linux version 3.2.0-29-generic-pae running on i386; UTF-8; en_US (nb)
User directory: /home/tester/.netbeans/dev
Cache directory: /home/tester/.cache/netbeans/dev
Comment 1 Ralph Ruijs 2015-02-17 11:00:35 UTC
Just tried on:

Product Version: NetBeans IDE Dev (Build 20150217-907550a16ee1)
Java: 1.7.0_76; Java HotSpot(TM) 64-Bit Server VM 24.76-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_76-b13
System: Linux version 3.18.6-1-ARCH running on amd64; UTF-8; en_US (nb)