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 199357

Summary: Hints, errors and code underlining lost after Move Refactor
Product: editor Reporter: theshadow27 <theshadow27>
Component: Parsing & IndexingAssignee: Tomas Zezula <tzezula>
Status: VERIFIED FIXED    
Severity: normal CC: MackSix
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 234361    
Bug Blocks:    

Description theshadow27 2011-06-11 17:31:11 UTC
User Action: A Java file is open in the editor, and it is moved to a different package using the context menu item "Refactor->Move" (from its node in Project Navigator)

Expected Result: Editor works normally.

Actual Result: Some editor hints, all errors (those that replace line numbers) as well as Erroneous Code (red) and Unused Imports (yellow) underlining are no longer displayed

Workaround: Close the current editor tab, reopen it by clicking the node in Projects navigator

Since: at least 7.0, verified on dev build 201106100600

Test case from fresh install/clean userdir, although it seems to be easy to duplicate without these precautions. 

-----SETUP--- 
(1) New project -> Java -> Java Class Library
(2) Project Name = "MoveTest201106100600" Project Location = (default)
(3) Source packages (node context menu) -> New -> Java Package... 
(3a) Package Name = "org.test"
(4) org.test (node context menu) -> New -> Java Class...
(4a) Class Name = "MoveRefactorTest"
(5) In the editor, type:
(5a) Under the package declaration: "import java.util.ArrayList;"
(5b) In the class body: "public boolean isAnObject(){" [return] (which should create the closing })
(6) Save the file. 

At this point the method declaration should be underlined in red, with a red "!" for a "missing return statement", and the import line should be underlined in yellow with a yellow triangle in the gutter for "unused import" 

-----TEST----
(7) MoveRefactorTest.java (node context menu) -> Refactor -> Move...
(7a) To Package ="org.test1"

At this point, most editor hints (except Collections initial capacity?), errors (those that replace line numbers) as well as Erroneous Code (red) and Unused Imports (yellow) underlining are no longer displayed.
Comment 1 Jan Lahoda 2011-06-13 02:28:15 UTC
Seems that the Schedulers are not properly prepared for moving DataObjects.
Comment 2 Jan Lahoda 2013-02-08 11:48:05 UTC
*** Bug 225569 has been marked as a duplicate of this bug. ***
Comment 3 Jan Lahoda 2013-07-08 12:28:22 UTC
Svata is looking into this, AFAIK.
Comment 4 Tomas Zezula 2013-08-19 11:30:11 UTC
Fixed jet-main a8b904df6ade
Comment 5 MackSix 2013-08-31 09:36:50 UTC
Verified fixed:

Product Version: NetBeans IDE Dev (Build 201308310001)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b40
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)