[hg] main-silver: #224760 - Bookmark symbol cannot be removed.

  • From: Miloslav Metelka < >
  • To: ,
  • Subject: [hg] main-silver: #224760 - Bookmark symbol cannot be removed.
  • Date: Wed, 16 Jan 2013 12:07:38 -0800

changeset 089697ee102a in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/089697ee102a
description:
        #224760 - Bookmark symbol cannot be removed.

diffstat:

 editor.bookmarks/src/org/netbeans/lib/editor/bookmarks/api/Bookmark.java     
          |  5 -----
 
editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/BookmarkManagerEvent.java
   |  7 +++++--
 
editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/FileBookmarksChange.java
    |  7 +++++--
 
editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/ProjectBookmarksChange.java
 |  6 ++++--
 4 files changed, 14 insertions(+), 11 deletions(-)

diffs (67 lines):

diff --git 
a/editor.bookmarks/src/org/netbeans/lib/editor/bookmarks/api/Bookmark.java 
b/editor.bookmarks/src/org/netbeans/lib/editor/bookmarks/api/Bookmark.java
--- a/editor.bookmarks/src/org/netbeans/lib/editor/bookmarks/api/Bookmark.java
+++ b/editor.bookmarks/src/org/netbeans/lib/editor/bookmarks/api/Bookmark.java
@@ -44,13 +44,8 @@
 
 package org.netbeans.lib.editor.bookmarks.api;
 
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
 import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
 import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Map;
 import java.util.WeakHashMap;
 import javax.swing.text.Document;
diff --git 
a/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/BookmarkManagerEvent.java
 
b/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/BookmarkManagerEvent.java
--- 
a/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/BookmarkManagerEvent.java
+++ 
b/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/BookmarkManagerEvent.java
@@ -87,8 +87,11 @@
             for (ProjectBookmarksChange prjChange : 
projectBookmarksChanges.values()) {
                 for (FileBookmarksChange fileChange : 
prjChange.getFileBookmarksChanges()) {
                     for (BookmarkChange change : 
fileChange.getBookmarkChanges()) {
-                        assert (bookmarkChanges.put(change.getBookmark(), 
change) == null)
-                                : "Bookmark contained in multiple changes: " 
+ change.getBookmark(); // NOI18N
+                        Object o = bookmarkChanges.put(change.getBookmark(), 
change);
+                        if (o != null) {
+                            throw new IllegalStateException(
+                                    "Bookmark contained in multiple changes: 
" + change.getBookmark()); // NOI18N
+                        }
                     }
                 }
             }
diff --git 
a/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/FileBookmarksChange.java
 
b/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/FileBookmarksChange.java
--- 
a/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/FileBookmarksChange.java
+++ 
b/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/FileBookmarksChange.java
@@ -74,8 +74,11 @@
     }
     
     void addChange(BookmarkChange change) {
-        assert (bookmarkChanges.put(change.getBookmark(), change) == null)
-                : "BookmarkChange already present: " + change; // NOI18N
+        Object o = bookmarkChanges.put(change.getBookmark(), change);
+        if (o != null) {
+            throw new IllegalStateException(
+                    "BookmarkChange already present: " + change); // NOI18N
+        }
     }
 
 }
diff --git 
a/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/ProjectBookmarksChange.java
 
b/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/ProjectBookmarksChange.java
--- 
a/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/ProjectBookmarksChange.java
+++ 
b/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/ProjectBookmarksChange.java
@@ -106,8 +106,10 @@
     }
     
     void addChange(FileBookmarksChange change) {
-        assert 
(fileBookmarksChanges.put(change.getFileBookmarks().getRelativeURI(), change) 
== null)
-                : "Change already present: " + change; // NOI18N
+        Object o = 
fileBookmarksChanges.put(change.getFileBookmarks().getRelativeURI(), change);
+        if (o != null) {
+            throw new IllegalStateException("Change already present: " + 
change); // NOI18N
+        }
     }
 
 }

[hg] main-silver: #224760 - Bookmark symbol cannot be removed.

Miloslav Metelka 01/16/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close