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 - Closing then opening file causes multiple annotations arrow to show on bookmark lines
Summary: Closing then opening file causes multiple annotations arrow to show on bookma...
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-05 15:47 UTC by MackSix
Modified: 2013-08-28 02:05 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (56.53 KB, image/png)
2013-08-05 15:47 UTC, MackSix
Details
detach patch (2.05 KB, patch)
2013-08-08 12:53 UTC, Milutin Kristofic
Details | Diff

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