Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2010-02-16 16:28:01 +0000
committerrelves2010-02-16 16:28:01 +0000
commitcab2b3c2dc23355a031bccd04811202ac5210d19 (patch)
treea56397ce296f7bdbf7c64bbbb837b7946db8ffd3 /org.eclipse.mylyn.bugzilla.core
parentf6d413795d0614074ffec64674145943f378c4c6 (diff)
downloadorg.eclipse.mylyn.tasks-cab2b3c2dc23355a031bccd04811202ac5210d19.tar.gz
org.eclipse.mylyn.tasks-cab2b3c2dc23355a031bccd04811202ac5210d19.tar.xz
org.eclipse.mylyn.tasks-cab2b3c2dc23355a031bccd04811202ac5210d19.zip
290465: fix Bugzilla test suite
https://bugs.eclipse.org/bugs/show_bug.cgi?id=290465
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java105
1 files changed, 53 insertions, 52 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index 92e29d17c..02288995b 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -880,7 +880,6 @@ public class BugzillaClient {
public void postUpdateAttachment(TaskAttribute taskAttribute, String action, IProgressMonitor monitor)
throws IOException, CoreException {
List<NameValuePair> formData = new ArrayList<NameValuePair>(5);
- boolean existingBugPosted = false;
formData.add(new NameValuePair("action", action)); //$NON-NLS-1$
formData.add(new NameValuePair("contenttypemethod", "manual")); //$NON-NLS-1$ //$NON-NLS-2$
@@ -952,57 +951,59 @@ public class BugzillaClient {
input = getResponseStream(method, monitor);
- BufferedReader in = new BufferedReader(new InputStreamReader(input, method.getRequestCharSet()));
- if (in.markSupported()) {
- in.mark(1);
- }
- HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, null);
-
- boolean isTitle = false;
- String title = ""; //$NON-NLS-1$
-
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
-
- if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == Tag.TITLE
- && !((HtmlTag) (token.getValue())).isEndTag()) {
- isTitle = true;
- continue;
- }
-
- if (isTitle) {
- // get all of the data in the title tag
- if (token.getType() != Token.TAG) {
- title += ((StringBuffer) token.getValue()).toString().toLowerCase(Locale.ENGLISH) + " "; //$NON-NLS-1$
- continue;
- } else if (token.getType() == Token.TAG && ((HtmlTag) token.getValue()).getTagType() == Tag.TITLE
- && ((HtmlTag) token.getValue()).isEndTag()) {
-
- for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand(
- BugzillaLanguageSettings.COMMAND_CHANGES_SUBMITTED).iterator(); iterator.hasNext()
- && !existingBugPosted;) {
- String value = iterator.next().toLowerCase(Locale.ENGLISH);
- existingBugPosted = existingBugPosted || title.indexOf(value) != -1;
- }
- break;
- }
- }
- }
-
- if (existingBugPosted != true) {
- try {
- if (in.markSupported()) {
- in.reset();
- }
- } catch (IOException e) {
- // ignore
- }
- parseHtmlError(in);
- }
-
- } catch (ParseException e) {
- loggedIn = false;
- throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN,
- RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); //$NON-NLS-1$ //$NON-NLS-2$
+ parseHtmlError(input);
+
+// BufferedReader in = new BufferedReader(new InputStreamReader(input, method.getRequestCharSet()));
+// if (in.markSupported()) {
+// in.mark(1);
+// }
+// HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, null);
+//
+// boolean isTitle = false;
+// String title = ""; //$NON-NLS-1$
+//
+// for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
+//
+// if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == Tag.TITLE
+// && !((HtmlTag) (token.getValue())).isEndTag()) {
+// isTitle = true;
+// continue;
+// }
+//
+// if (isTitle) {
+// // get all of the data in the title tag
+// if (token.getType() != Token.TAG) {
+// title += ((StringBuffer) token.getValue()).toString().toLowerCase(Locale.ENGLISH) + " "; //$NON-NLS-1$
+// continue;
+// } else if (token.getType() == Token.TAG && ((HtmlTag) token.getValue()).getTagType() == Tag.TITLE
+// && ((HtmlTag) token.getValue()).isEndTag()) {
+//
+// for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand(
+// BugzillaLanguageSettings.COMMAND_CHANGES_SUBMITTED).iterator(); iterator.hasNext()
+// && !existingBugPosted;) {
+// String value = iterator.next().toLowerCase(Locale.ENGLISH);
+// existingBugPosted = existingBugPosted || title.indexOf(value) != -1;
+// }
+// break;
+// }
+// }
+// }
+//
+// if (existingBugPosted != true) {
+// try {
+// if (in.markSupported()) {
+// in.reset();
+// }
+// } catch (IOException e) {
+// // ignore
+// }
+// parseHtmlError(in);
+// }
+//
+// } catch (ParseException e) {
+// loggedIn = false;
+// throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN,
+// RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); //$NON-NLS-1$ //$NON-NLS-2$
} finally {
if (input != null) {
input.close();

Back to the top