[hg] main-silver: use VersioningQuery instead of FO.getAttribute...

  • From: Tomas Stupka < >
  • To: ,
  • Subject: [hg] main-silver: use VersioningQuery instead of FO.getAttribute...
  • Date: Tue, 02 Jul 2013 14:28:31 -0700

changeset 8f7932a5f78f in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/8f7932a5f78f
description:
        use VersioningQuery instead of FO.getAttribute("RemoteLocation)

diffstat:

 bugtracking/src/org/netbeans/modules/bugtracking/team/TeamRepositories.java 
|  14 +++++++--
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (48 lines):

diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/team/TeamRepositories.java 
b/bugtracking/src/org/netbeans/modules/bugtracking/team/TeamRepositories.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/team/TeamRepositories.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/team/TeamRepositories.java
@@ -46,6 +46,7 @@
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeSupport;
 import java.io.IOException;
+import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -54,6 +55,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.logging.Level;
+import org.netbeans.api.queries.VersioningQuery;
 import org.netbeans.modules.bugtracking.APIAccessor;
 import org.netbeans.modules.bugtracking.BugtrackingManager;
 import org.netbeans.modules.bugtracking.RepositoryImpl;
@@ -71,6 +73,7 @@
 import org.netbeans.modules.bugtracking.util.NBBugzillaUtils;
 import org.openide.filesystems.FileObject;
 import org.openide.filesystems.FileUtil;
+import org.openide.util.Exceptions;
 import org.openide.util.Lookup;
 
 /**
@@ -341,13 +344,16 @@
         }
 
         private static TeamProject getTeamProject(FileObject rootDir) {
-            Object attValue = rootDir.getAttribute(
-                                       
"ProvidedExtensions.RemoteLocation");//NOI18N
-            if (!(attValue instanceof String)) {
+            String url = null;
+            try {
+                url = 
VersioningQuery.getRemoteLocation(rootDir.toURL().toURI());
+            } catch (URISyntaxException ex) {
+                BugtrackingManager.LOG.log(Level.WARNING, rootDir.getPath(), 
ex);
+            }
+            if (url == null) {
                 return null;
             }
 
-            String url = (String) attValue;
             TeamProject teamProject = null;
             try {
                 if(NBBugzillaUtils.isNbRepository(url)) {

[hg] main-silver: use VersioningQuery instead of FO.getAttribute...

Tomas Stupka 07/02/2013

Project Features

About this Project

DB was started in November 2009, is owned by Antonin Nebuzelsky, and has 113 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