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 233965

Summary: Closing then opening file causes multiple annotations arrow to show on bookmark lines
Product: editor Reporter: MackSix
Component: NavigationAssignee: Milutin Kristofic <mkristofic>
Status: VERIFIED FIXED    
Severity: normal CC: MackSix
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: screenshot
detach patch

Description MackSix 2013-08-05 15:47:22 UTC
Created attachment 138311 [details]
screenshot

Closing and then opening a Java source file with bookmarks shows the multiple annotations arrow when there is no other annotations. It appears to count the bookmarks two times. 

This behavior continues as new bookmarks are added. 

Workaround: Restartig NetBeans clears the arrows.

See screenshot.

Product Version: NetBeans IDE Dev (Build 201308022300)
Updates: Updates available
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b16
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Milutin Kristofic 2013-08-08 12:53:17 UTC
Created attachment 138446 [details]
detach patch

The technical problem is that BookmarkList is saved in document property. When editor component is closed, document is null. When editor component is reopened, new document is created without BookmarList in document editor. Therefore Bookmarklist is created, it creates new Bookmarks, which creates new annotations. However annotations are already saved in Annotations.list and are attach again when reopen. 

My solution is when editor is closing, Bookmarklist detach all bookmarks (detach all annotations).
Comment 2 Milutin Kristofic 2013-08-22 10:35:01 UTC
http://hg.netbeans.org/jet-main/rev/94ed172b316a
Comment 3 MackSix 2013-08-28 02:05:40 UTC
Verified fixed:

Product Version: NetBeans IDE Dev (Build 201308270854)
Updates: Updates available
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)