Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2011-07-25 20:22:04 +0000
committerfbecker2011-07-25 20:22:04 +0000
commit9e71937c527fc44eb9c2eb7d00d7357dcbd11898 (patch)
tree82b4876c60a470f04e4cae3b8ba4fc0b6e158fcd /org.eclipse.mylyn.bugzilla.core
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
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java10
1 files changed, 10 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);

Back to the top