Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2016-09-09 16:19:06 -0400
committerGerrit Code Review @ Eclipse.org2016-09-13 15:51:20 -0400
commiteed5f83008322806dbc3b605a6b9bb3afaf2d978 (patch)
tree54265eb511ac172596c3e460b771e8d6441018f6 /connector-bugzilla-rest
parent2f9f5e4c06f3684409b01c086dee43ebee9ab723 (diff)
downloadorg.eclipse.mylyn.tasks-eed5f83008322806dbc3b605a6b9bb3afaf2d978.tar.gz
org.eclipse.mylyn.tasks-eed5f83008322806dbc3b605a6b9bb3afaf2d978.tar.xz
org.eclipse.mylyn.tasks-eed5f83008322806dbc3b605a6b9bb3afaf2d978.zip
501176: Bugzilla REST: OpenWithBrowserAction did not work
Change-Id: I99c43661b84b30e2e037583abe82d45440a78624 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=501176
Diffstat (limited to 'connector-bugzilla-rest')
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConnector.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConnector.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConnector.java
index 4c1375b5e..34319faff 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConnector.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConnector.java
@@ -13,6 +13,8 @@ package org.eclipse.mylyn.internal.bugzilla.rest.core;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -24,6 +26,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.core.operations.IOperationMonitor;
@@ -38,6 +41,7 @@ import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.FieldValues;
import org.eclipse.mylyn.internal.commons.core.operations.NullOperationMonitor;
import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.RepositoryInfo;
@@ -479,4 +483,20 @@ public class BugzillaRestConnector extends AbstractRepositoryConnector {
return attachmentHandler;
}
+ @Override
+ @Nullable
+ public URL getAuthenticatedUrl(@NonNull TaskRepository repository, @NonNull IRepositoryElement element) {
+ if (element instanceof ITask) {
+ try {
+ String url = element.getUrl();
+ String urlString = url.replace("/rest.cgi/bug/", "/show_bug.cgi?id="); //$NON-NLS-1$ //$NON-NLS-2$
+ return new URL(urlString);
+ } catch (MalformedURLException e) {
+ StatusHandler.log(
+ new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, "could not create url from string", e)); //$NON-NLS-1$
+ }
+ }
+ return super.getAuthenticatedUrl(repository, element);
+ }
+
}

Back to the top