[hg] main-silver: Issue #224981 - AssertionError at org.netbeans...

  • From: Tomas Stupka < >
  • To:
  • Subject: [hg] main-silver: Issue #224981 - AssertionError at org.netbeans...
  • Date: Fri, 01 Feb 2013 04:28:46 -0800

changeset 6f15a91c5966 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/6f15a91c5966
description:
        Issue #224981 - AssertionError at 
org.netbeans.modules.bugtracking.ui.issue.cache.IssueCacheUtils.getCache

diffstat:

 
bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/cache/IssueCacheUtils.java
 |  29 +++++++--
 1 files changed, 22 insertions(+), 7 deletions(-)

diffs (87 lines):

diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/cache/IssueCacheUtils.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/cache/IssueCacheUtils.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/cache/IssueCacheUtils.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/cache/IssueCacheUtils.java
@@ -63,7 +63,8 @@
      * @return true if issue was seen otherwise false
      */
     public static boolean wasSeen(IssueImpl issue) {
-        return getCache(issue).wasSeen(issue.getID());
+        IssueCache cache = getCache(issue);
+        return cache != null ? cache.wasSeen(issue.getID()) : true;
     }
 
     /**
@@ -73,8 +74,10 @@
     public static void switchSeen(IssueImpl issue) {
         try {
             IssueCache cache = getCache(issue);
+            if(cache != null) {
             String id = issue.getID();
             cache.setSeen(id, !cache.wasSeen(id));
+            }
         } catch (IOException ex) {
             BugtrackingManager.LOG.log(Level.SEVERE, null, ex);
         }
@@ -87,14 +90,18 @@
      */
     public static void setSeen(IssueImpl issue, boolean seen) {
         try {
-            getCache(issue).setSeen(issue.getID(), seen);
+            IssueCache cache = getCache(issue);
+            if(cache != null) {
+                cache.setSeen(issue.getID(), seen);
+            }
         } catch (IOException ex) {
             BugtrackingManager.LOG.log(Level.SEVERE, null, ex);
         }
     }
     
     public static int getStatus(IssueImpl issue) {
-        return getCache(issue).getStatus(issue.getID());
+        IssueCache cache = getCache(issue);
+        return cache != null ? cache.getStatus(issue.getID()) : 
IssueCache.ISSUE_STATUS_UNKNOWN; 
     }    
 
     /**
@@ -105,13 +112,15 @@
      * @return
      */
     public static String getRecentChanges(IssueImpl issue) {
-        String changes = getCache(issue).getRecentChanges(issue.getID());
+        IssueCache cache = getCache(issue);
+        String changes = cache != null ? 
cache.getRecentChanges(issue.getID()) : null;
         if(changes == null) {
             changes = "";
         } else {
             changes = changes.trim();
     }
-        if(changes.equals("") && getCache(issue).getStatus(issue.getID()) == 
IssueCache.ISSUE_STATUS_MODIFIED) {
+        int status = cache != null ? cache.getStatus(issue.getID()) : -1;
+        if(changes.equals("") && status == IssueCache.ISSUE_STATUS_MODIFIED) 
{
             changes = NbBundle.getMessage(IssueCacheUtils.class, 
"LBL_IssueModified");
         }
         return changes;
@@ -123,7 +132,10 @@
      * @param l
      */
     public static void addCacheListener (IssueImpl issue, 
PropertyChangeListener l) {
-        getCache(issue).addPropertyChangeListener(issue.getIssue(), l);
+        IssueCache cache = getCache(issue);
+        if(cache != null) {
+            cache.addPropertyChangeListener(issue.getIssue(), l);
+        }
     }
 
     /**
@@ -132,7 +144,10 @@
      * @param l
      */
     public static void removeCacheListener (IssueImpl issue, 
PropertyChangeListener l) {
-        getCache(issue).removePropertyChangeListener(issue.getIssue(), l);
+        IssueCache cache = getCache(issue);
+        if(cache != null) {
+            cache.removePropertyChangeListener(issue.getIssue(), l);
+        }
     }
 
     private static IssueCache getCache(IssueImpl issue) {

[hg] main-silver: Issue #224981 - AssertionError at org.netbeans...

Tomas Stupka 02/01/2013

Project Features

About this Project

ConnectedDeveloper was started in November 2009, is owned by tpavek, and has 64 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