[hg] main-silver: removed kenai dependency on issue cache

  • From: Tomas Stupka < >
  • To:
  • Subject: [hg] main-silver: removed kenai dependency on issue cache
  • Date: Thu, 04 Apr 2013 00:31:49 -0700

changeset b46952b7ab8a in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/b46952b7ab8a
description:
        removed kenai dependency on issue cache

diffstat:

 
bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/QueryHandleImpl.java
              |   5 +-
 
bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/QueryResultHandleImpl.java
        |  23 ++-------
 
bugtracking.kenai/test/unit/src/org/netbeans/modules/bugzilla/kenai/KenaiQueryRefreshTest.java
 |   2 +-
 3 files changed, 9 insertions(+), 21 deletions(-)

diffs (103 lines):

diff --git 
a/bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/QueryHandleImpl.java
 
b/bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/QueryHandleImpl.java
--- 
a/bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/QueryHandleImpl.java
+++ 
b/bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/QueryHandleImpl.java
@@ -55,7 +55,6 @@
 import org.netbeans.modules.bugtracking.api.Query;
 import org.netbeans.modules.bugtracking.kenai.spi.KenaiUtil;
 import org.netbeans.modules.bugtracking.spi.IssueStatusProvider;
-import org.netbeans.modules.bugtracking.ui.issue.cache.IssueCache;
 import org.netbeans.modules.team.ui.spi.QueryHandle;
 import org.netbeans.modules.team.ui.spi.QueryResultHandle;
 import org.openide.util.WeakListeners;
@@ -123,11 +122,11 @@
 
     List<QueryResultHandle> getQueryResults() {
         List<QueryResultHandle> ret = new ArrayList<QueryResultHandle>();
-        QueryResultHandle qh = QueryResultHandleImpl.forStatus(query, 
IssueCache.ISSUE_STATUS_ALL);
+        QueryResultHandle qh = QueryResultHandleImpl.forAllStatus(query);
         if(qh != null) {
             ret.add(qh);
         }
-        qh = QueryResultHandleImpl.forStatus(query, 
IssueCache.ISSUE_STATUS_NOT_SEEN);
+        qh = QueryResultHandleImpl.forNotSeenStatus(query);
         if(qh != null) {
             ret.add(qh);
         }
diff --git 
a/bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/QueryResultHandleImpl.java
 
b/bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/QueryResultHandleImpl.java
--- 
a/bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/QueryResultHandleImpl.java
+++ 
b/bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/QueryResultHandleImpl.java
@@ -50,7 +50,6 @@
 import org.netbeans.modules.bugtracking.api.Issue;
 import org.netbeans.modules.bugtracking.api.Query;
 import org.netbeans.modules.bugtracking.kenai.spi.KenaiUtil;
-import org.netbeans.modules.bugtracking.ui.issue.cache.IssueCache;
 import org.netbeans.modules.team.ui.spi.QueryResultHandle;
 import org.openide.util.NbBundle;
 
@@ -100,13 +99,8 @@
         KenaiUtil.openQuery(query, queryMode, true);
     }
 
-    static QueryResultHandleImpl forStatus(Query query, int status) {
-        Collection<Issue> issues;
-        switch(status) {
-
-            case IssueCache.ISSUE_STATUS_ALL:
-
-                issues = query.getIssues();
+    static QueryResultHandleImpl forAllStatus(Query query) {
+        Collection<Issue> issues = query.getIssues();
                 int issueCount = issues != null ? issues.size() : 0;
                 return new QueryResultHandleImpl(
                         query,
@@ -114,15 +108,14 @@
                         getTotalTooltip(issueCount),
                         Query.QueryMode.SHOW_ALL,
                         ResultType.NAMED_RESULT);
+    }
 
-            case IssueCache.ISSUE_STATUS_NOT_SEEN:
-
-                int unseenIssues = 0;
+    static QueryResultHandleImpl forNotSeenStatus(Query query) {
                 Collection<Issue> c = query.getIssues();
                 if(c == null || c.isEmpty()) {
                     return null;
                 }
-                issues = new LinkedList<Issue>();
+        Collection<Issue> issues = new LinkedList<Issue>();
                 for (Issue issue : c) {
                     if(issue.getStatus() == Issue.Status.MODIFIED ||
                        issue.getStatus() == Issue.Status.NEW) 
@@ -130,7 +123,7 @@
                         issues.add(issue);
                     }
                 }
-                unseenIssues = issues.size();
+        int unseenIssues = issues.size();
 
                 String label = unseenFormat.format(new Object[] 
{unseenIssues}, new StringBuffer(), null).toString();
                 String tooltip = getUnseenTooltip(unseenIssues);
@@ -141,10 +134,6 @@
                         tooltip,
                         Query.QueryMode.SHOW_NEW_OR_CHANGED,
                         ResultType.NAMED_RESULT);
-
-            default:
-                throw new IllegalStateException("wrong status value [" + 
status + "]"); // NOI18N
-        }
     }
 
     static QueryResultHandle getAllChangedResult(Query query) {
diff --git 
a/bugtracking.kenai/test/unit/src/org/netbeans/modules/bugzilla/kenai/KenaiQueryRefreshTest.java
 
b/bugtracking.kenai/test/unit/src/org/netbeans/modules/bugzilla/kenai/KenaiQueryRefreshTest.java
--- 
a/bugtracking.kenai/test/unit/src/org/netbeans/modules/bugzilla/kenai/KenaiQueryRefreshTest.java
+++ 
b/bugtracking.kenai/test/unit/src/org/netbeans/modules/bugzilla/kenai/KenaiQueryRefreshTest.java
@@ -53,7 +53,7 @@
 import org.netbeans.junit.NbTestCase;
 import org.netbeans.modules.bugtracking.kenai.spi.KenaiProject;
 import org.netbeans.modules.bugtracking.kenai.spi.KenaiUtil;
-import org.netbeans.modules.bugtracking.ui.issue.cache.IssueCache;
+import org.netbeans.modules.bugtracking.cache.IssueCache;
 import org.netbeans.modules.bugzilla.BugzillaConfig;
 import org.netbeans.modules.bugzilla.LogHandler;
 import org.netbeans.modules.bugzilla.TestConstants;

[hg] main-silver: removed kenai dependency on issue cache

Tomas Stupka 04/04/2013

Project Features

About this Project

ConnectedDeveloper was started in November 2009, is owned by tpavek, and has 66 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close