Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaSearchEngine.java19
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugzilla/MylarBugzillaPlugin.java10
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaMylarSearchOperation.java1
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaReferencesProvider.java3
4 files changed, 32 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaSearchEngine.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaSearchEngine.java
index 45788e55a..bfeb9dfb4 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaSearchEngine.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaSearchEngine.java
@@ -152,11 +152,23 @@ public class BugzillaSearchEngine {
throw new BugzillaException(msg);
}
+ if (monitor.isCanceled()) {
+ throw new OperationCanceledException("Search cancelled");
+ }
+
in = new BufferedReader(new InputStreamReader(connect.getInputStream()));
+ if (monitor.isCanceled()) {
+ throw new OperationCanceledException("Search cancelled");
+ }
+
Match match = new Match();
String line;
while ((line = in.readLine()) != null) {
+ if (monitor.isCanceled()) {
+ throw new OperationCanceledException("Search cancelled");
+ }
+
// create regular expressions that can be mathced to check if we have
// bad login information
RegularExpression loginRe = new RegularExpression("<title>.*login.*</title>.*");
@@ -199,7 +211,13 @@ public class BugzillaSearchEngine {
String state = null;
String result = null;
for (int i = 0; i < 6; i++) {
+ if (monitor.isCanceled()) {
+ throw new OperationCanceledException("Search cancelled");
+ }
do {
+ if (monitor.isCanceled()) {
+ throw new OperationCanceledException("Search cancelled");
+ }
line = in.readLine().trim();
if (line == null) break;
line = line.trim();
@@ -254,6 +272,7 @@ public class BugzillaSearchEngine {
BugzillaPlugin.log(status);
}
catch (OperationCanceledException e) {
+ e.printStackTrace();
status = new Status(IStatus.CANCEL, IBugzillaConstants.PLUGIN_ID,
IStatus.CANCEL, "", null);
}catch (Exception e) {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugzilla/MylarBugzillaPlugin.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugzilla/MylarBugzillaPlugin.java
index cf6909134..6433a9573 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugzilla/MylarBugzillaPlugin.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugzilla/MylarBugzillaPlugin.java
@@ -1,6 +1,9 @@
package org.eclipse.mylar.bugzilla;
+import java.util.List;
+
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.mylar.core.AbstractRelationshipProvider;
import org.eclipse.mylar.core.MylarPlugin;
import org.eclipse.mylar.tasks.search.BugzillaReferencesProvider;
import org.eclipse.mylar.ui.MylarUiPlugin;
@@ -57,6 +60,13 @@ public class MylarBugzillaPlugin extends AbstractUIPlugin implements IStartup {
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
+
+ List<AbstractRelationshipProvider> providers = structureBridge.getProviders();
+ if(providers != null){
+ for(AbstractRelationshipProvider provider: providers){
+ provider.stopAllRunningJobs();
+ }
+ }
}
/**
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaMylarSearchOperation.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaMylarSearchOperation.java
index 474d2558e..a2da3e9b3 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaMylarSearchOperation.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaMylarSearchOperation.java
@@ -284,7 +284,6 @@ public class BugzillaMylarSearchOperation extends WorkspaceModifyOperation
// check the status so that we don't keep searching if there
// is a problem
if (status.getCode() == IStatus.CANCEL) {
- MylarPlugin.log("search cancelled", this);
return null;
} else if (!status.isOK()) {
MylarPlugin.log("search error", this);
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaReferencesProvider.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaReferencesProvider.java
index 5dbd1d1b3..a083647ba 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaReferencesProvider.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaReferencesProvider.java
@@ -81,6 +81,9 @@ public class BugzillaReferencesProvider extends AbstractRelationshipProvider {
public void searchCompleted(List<?> nodes) {
Iterator<?> itr = nodes.iterator();
+ if(MylarBugzillaPlugin.getDefault() == null)
+ return;
+
BugzillaStructureBridge bridge = MylarBugzillaPlugin.getDefault().getStructureBridge();
while(itr.hasNext()) {

Back to the top