Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2011-07-25 16:22:04 -0400
committerfbecker2011-07-25 16:22:04 -0400
commit9e71937c527fc44eb9c2eb7d00d7357dcbd11898 (patch)
tree82b4876c60a470f04e4cae3b8ba4fc0b6e158fcd
parentec0f134722b3f25bfd4da33a3d0f2b1ab3c9493a (diff)
downloadorg.eclipse.mylyn.tasks-9e71937c527fc44eb9c2eb7d00d7357dcbd11898.tar.gz
org.eclipse.mylyn.tasks-9e71937c527fc44eb9c2eb7d00d7357dcbd11898.tar.xz
org.eclipse.mylyn.tasks-9e71937c527fc44eb9c2eb7d00d7357dcbd11898.zip
REOPENED - bug 349633: BugzillaRepositoryConnector.getTaskData() fails
when repository URL has trailing slash and no path https://bugs.eclipse.org/bugs/show_bug.cgi?id=349633
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java10
-rw-r--r--org.eclipse.mylyn.tests.util/.gitignore1
2 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java
index 02cf2e841..fb8330d9d 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java
@@ -27,6 +27,16 @@ public class BugzillaClientFactory {
public static BugzillaClient createClient(TaskRepository taskRepository, BugzillaRepositoryConnector connector)
throws MalformedURLException {
+ // to fix bug#349633
+ // (BugzillaRepositoryConnector.getTaskData() fails when repository URL has trailing slash and no path)
+ String repositoryURL = taskRepository.getRepositoryUrl();
+ if (repositoryURL.endsWith("/")) { //$NON-NLS-1$
+ StringBuilder sb = new StringBuilder(repositoryURL.trim());
+ while (sb.length() > 0 && sb.charAt(sb.length() - 1) == '/') {
+ sb.setLength(sb.length() - 1);
+ }
+ taskRepository.setRepositoryUrl(sb.toString());
+ }
AbstractWebLocation location = taskRepositoryLocationFactory.createWebLocation(taskRepository);
BugzillaClient client = new BugzillaClient(location, taskRepository, connector);
diff --git a/org.eclipse.mylyn.tests.util/.gitignore b/org.eclipse.mylyn.tests.util/.gitignore
new file mode 100644
index 000000000..6365315a0
--- /dev/null
+++ b/org.eclipse.mylyn.tests.util/.gitignore
@@ -0,0 +1 @@
+/credentials.properties

Back to the top