diff options
author | sminto | 2005-07-20 21:27:20 +0000 |
---|---|---|
committer | sminto | 2005-07-20 21:27:20 +0000 |
commit | 1664a449d0f15f2c08d09dc897525028816c5067 (patch) | |
tree | 48694e5d51a6f3a83b8cb77660ae6374e34b8702 /org.eclipse.mylyn.bugzilla.core/src | |
parent | 1885b19080f19b18d43b132b7581225ccdae3b7c (diff) | |
download | org.eclipse.mylyn.tasks-1664a449d0f15f2c08d09dc897525028816c5067.tar.gz org.eclipse.mylyn.tasks-1664a449d0f15f2c08d09dc897525028816c5067.tar.xz org.eclipse.mylyn.tasks-1664a449d0f15f2c08d09dc897525028816c5067.zip |
Fix for Bug #104084: active search jobs should be terminated before shutdown
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core/src')
-rw-r--r-- | org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaSearchEngine.java | 19 |
1 files changed, 19 insertions, 0 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) { |