Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2011-07-30 19:14:05 +0000
committerfbecker2011-07-30 19:14:05 +0000
commitbf1697f24682ca2a3eb498f849862b313df12b99 (patch)
tree89d8694b49a11836b13beb8b6bf8156a4fa2f914 /org.eclipse.mylyn.bugzilla.core
parent4e53919957b4067f5e356b9baa40a3f71df635ba (diff)
downloadorg.eclipse.mylyn.tasks-bf1697f24682ca2a3eb498f849862b313df12b99.tar.gz
org.eclipse.mylyn.tasks-bf1697f24682ca2a3eb498f849862b313df12b99.tar.xz
org.eclipse.mylyn.tasks-bf1697f24682ca2a3eb498f849862b313df12b99.zip
ASSIGNED - bug 348125: remove
org.eclipse.mylyn.internal.bugzilla.core.history package https://bugs.eclipse.org/bugs/show_bug.cgi?id=348125
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java40
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AssignmentEvent.java38
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentEvent.java160
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlag.java48
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagState.java19
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagStatus.java19
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/BugzillaTaskHistoryParser.java233
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/Messages.java31
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionEvent.java42
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionType.java98
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusEvent.java37
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusType.java101
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskHistory.java118
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskRevision.java118
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/messages.properties12
16 files changed, 0 insertions, 1115 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/META-INF/MANIFEST.MF b/org.eclipse.mylyn.bugzilla.core/META-INF/MANIFEST.MF
index c323e07fd..c22454bf9 100644
--- a/org.eclipse.mylyn.bugzilla.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.bugzilla.core/META-INF/MANIFEST.MF
@@ -15,7 +15,6 @@ Bundle-ActivationPolicy: lazy
Bundle-Vendor: %Bundle-Vendor
Bundle-ClassPath: .
Export-Package: org.eclipse.mylyn.internal.bugzilla.core;x-friends:="org.eclipse.mylyn.bugzilla.ide,org.eclipse.mylyn.bugzilla.ui",
- org.eclipse.mylyn.internal.bugzilla.core.history;x-friends:="org.eclipse.mylyn.bugzilla.ide,org.eclipse.mylyn.bugzilla.ui",
org.eclipse.mylyn.internal.bugzilla.core.service;x-internal:=true
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Localization: plugin
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 6ae759235..938d384c4 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
@@ -39,7 +39,6 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import javax.security.auth.login.LoginException;
import javax.swing.text.html.HTML.Tag;
import org.apache.commons.httpclient.Cookie;
@@ -80,8 +79,6 @@ import org.eclipse.mylyn.commons.net.HtmlTag;
import org.eclipse.mylyn.commons.net.Policy;
import org.eclipse.mylyn.commons.net.WebLocation;
import org.eclipse.mylyn.commons.net.WebUtil;
-import org.eclipse.mylyn.internal.bugzilla.core.history.BugzillaTaskHistoryParser;
-import org.eclipse.mylyn.internal.bugzilla.core.history.TaskHistory;
import org.eclipse.mylyn.internal.bugzilla.core.service.BugzillaXmlRpcClient;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.RepositoryResponse;
@@ -1972,43 +1969,6 @@ public class BugzillaClient {
}
}
- public TaskHistory getHistory(String taskId, IProgressMonitor monitor) throws IOException, CoreException {
- hostConfiguration = WebUtil.createHostConfiguration(httpClient, location, monitor);
- authenticate(monitor);
- GzipGetMethod method = null;
- try {
- String url = repositoryUrl + IBugzillaConstants.SHOW_ACTIVITY + taskId;
- method = getConnectGzip(url, monitor, null);
- if (method != null) {
- InputStream in = getResponseStream(method, monitor);
- try {
- BugzillaTaskHistoryParser parser = new BugzillaTaskHistoryParser(in, getCharacterEncoding());
- try {
- return parser.retrieveHistory(bugzillaLanguageSettings);
- } catch (LoginException e) {
- loggedIn = false;
- throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN,
- RepositoryStatus.ERROR_REPOSITORY_LOGIN, repositoryUrl.toString(),
- IBugzillaConstants.INVALID_CREDENTIALS));
- } catch (ParseException e) {
- loggedIn = false;
- throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN,
- RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " //$NON-NLS-1$
- + repositoryUrl.toString() + ".")); //$NON-NLS-1$
- }
- } finally {
- in.close();
- }
- }
-
- } finally {
- if (method != null) {
- WebUtil.releaseConnection(method, monitor);
- }
- }
- return null;
- }
-
public void getTaskData(Set<String> taskIds, final TaskDataCollector collector, final TaskAttributeMapper mapper,
final IProgressMonitor monitor) throws IOException, CoreException {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AssignmentEvent.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AssignmentEvent.java
deleted file mode 100644
index cd4ea3d32..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AssignmentEvent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * John Anvik - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-/**
- * @author John Anvik
- */
-public class AssignmentEvent extends TaskRevision {
-
- private static final long serialVersionUID = 3258693199936631348L;
-
- private final String assigned;
-
- public AssignmentEvent(String change) {
- this.what = TaskRevision.ASSIGNMENT;
- this.assigned = change;
- this.added = change;
- }
-
- public String getAssigned() {
- return this.assigned;
- }
-
- @Override
- public String toString() {
- return this.getName() + " | " + this.getDate() + " | " + this.getWhat() + " | " + this.getRemoved() + " | " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- + this.getAssigned();
- }
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentEvent.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentEvent.java
deleted file mode 100644
index d0ebf2d24..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentEvent.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 John Anvik and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * John Anvik - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * @author John Anvik
- */
-public class AttachmentEvent extends TaskRevision {
-
- private static final long serialVersionUID = 3258693199936631348L;
-
- private static final Pattern id = Pattern.compile("\\d+"); //$NON-NLS-1$
-
- private final int attachmentId;
-
- private final List<AttachmentFlag> flags;
-
- public AttachmentEvent(int id, List<AttachmentFlag> flags) {
- this.what = TaskRevision.ATTACHMENT;
- this.attachmentId = id;
- this.flags = flags;
- }
-
- public String getFlagsString() {
- String flagString = ""; //$NON-NLS-1$
- for (AttachmentFlag flag : this.flags) {
- flagString += flag + " "; //$NON-NLS-1$
- }
- return flagString;
- }
-
- public static int parseId(String attachment) {
- Matcher matcher = AttachmentEvent.id.matcher(attachment);
- if (matcher.find()) {
- return Integer.parseInt(matcher.group());
- }
-
- // Error situation
- System.err.println("WARNING: Cannot find attachment id in " + attachment); //$NON-NLS-1$
- return -1;
- }
-
- public static List<AttachmentFlag> parseFlags(String attachmentFlags) {
- List<AttachmentFlag> flags = new ArrayList<AttachmentFlag>();
- AttachmentFlagStatus flagStatus = AttachmentFlagStatus.UNKNOWN;
- AttachmentFlagState flagState = AttachmentFlagState.UNKNOWN;
-
- String[] flagToken = attachmentFlags.split(", "); //$NON-NLS-1$
- for (String token : flagToken) {
- if (token.indexOf("(") != -1) { //$NON-NLS-1$
- int end = token.indexOf("("); //$NON-NLS-1$
- String substr = token.substring(0, end);
- token = substr;
- }
-
- /* Handle the case of the obsolete status 'needs-work' */
- if (token.startsWith("needs-work")) { //$NON-NLS-1$
- /*
- * Since we don't know if 'needs-work' applies to 'review' or
- * 'superreview', deny both
- */
- flags.add(new AttachmentFlag(AttachmentFlagStatus.REVIEW, AttachmentFlagState.DENIED));
- flags.add(new AttachmentFlag(AttachmentFlagStatus.SUPERREVIEW, AttachmentFlagState.DENIED));
- } else {
- boolean startsWithReview = token.toLowerCase().startsWith(
- AttachmentFlagStatus.REVIEW.name().toLowerCase());
- boolean firstOrSecondReview = token.toLowerCase().contains(
- AttachmentFlagStatus.REVIEW.name().toLowerCase())
- && (token.toLowerCase().startsWith("first-") || token.toLowerCase().startsWith("second-")); //$NON-NLS-1$ //$NON-NLS-2$
- /*
- * if(firstOrSecondReview){ System.err.println("First/second
- * activated"); }
- */
- if (startsWithReview || firstOrSecondReview) {
- flagStatus = AttachmentFlagStatus.REVIEW;
- } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.SUPERREVIEW.name().toLowerCase())) {
- flagStatus = AttachmentFlagStatus.SUPERREVIEW;
- } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.APPROVAL.name().toLowerCase())) {
- flagStatus = AttachmentFlagStatus.APPROVAL;
- } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.UI.name().toLowerCase())) {
- flagStatus = AttachmentFlagStatus.UI;
- } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.BRANCH.name().toLowerCase())) {
- flagStatus = AttachmentFlagStatus.BRANCH;
- } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.COMMITTED.name().toLowerCase())) {
- flagStatus = AttachmentFlagStatus.COMMITTED;
- } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.ACCEPTED.name().toLowerCase())) {
- flagStatus = AttachmentFlagStatus.ACCEPTED;
- } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.COMMENTED.name().toLowerCase())) {
- flagStatus = AttachmentFlagStatus.COMMENTED;
- } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.NONE.name().toLowerCase())) {
- flagStatus = AttachmentFlagStatus.NONE;
- } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.REJECTED.name().toLowerCase())) {
- flagStatus = AttachmentFlagStatus.REJECTED;
- } else if (token.equals("1") //$NON-NLS-1$
- || token.toLowerCase().startsWith(AttachmentFlagStatus.OBSOLETE.name().toLowerCase())) {
- flagStatus = AttachmentFlagStatus.OBSOLETE;
- }
-
- // Assure that flag was set to something meaningful
- if (flagStatus.equals(AttachmentFlagStatus.UNKNOWN) && token.equals("") == false) { //$NON-NLS-1$
- System.err.println("WARNING: Attachment flag status unknown: " + token); //$NON-NLS-1$
- }
-
- if (token.length() > 0) {
- if (token.charAt(token.length() - 1) == '?') {
- flagState = AttachmentFlagState.REQUESTED;
- } else if (token.charAt(token.length() - 1) == '+') {
- flagState = AttachmentFlagState.GRANTED;
- } else if (token.charAt(token.length() - 1) == '-') {
- flagState = AttachmentFlagState.DENIED;
- } else if (flagStatus.equals(AttachmentFlagStatus.OBSOLETE)
- || flagStatus.equals(AttachmentFlagStatus.COMMITTED)
- || flagStatus.equals(AttachmentFlagStatus.ACCEPTED)
- || flagStatus.equals(AttachmentFlagStatus.COMMENTED)
- || flagStatus.equals(AttachmentFlagStatus.NONE)
- || flagStatus.equals(AttachmentFlagStatus.REJECTED)
- || flagStatus.equals(AttachmentFlagStatus.REVIEW)) {
- flagState = AttachmentFlagState.OFF;
- }
- }
- // Assure that flag state was set to something meaningful
- if (flagState.equals(AttachmentFlagState.UNKNOWN) && token.equals("") == false) { //$NON-NLS-1$
- System.err.println("WARNING: Attachment flag state unknown: " + token); //$NON-NLS-1$
- }
-
- flags.add(new AttachmentFlag(flagStatus, flagState));
- }
- }
- return flags;
- }
-
- @Override
- public String toString() {
- return this.getName() + " | " + this.getDate() + " | " + this.getWhat() + " | " + this.attachmentId + " | " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- + this.getFlagsString();
- }
-
- public List<AttachmentFlag> getFlags() {
- return this.flags;
- }
-
- public int getAttachmentId() {
- return this.attachmentId;
- }
-
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlag.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlag.java
deleted file mode 100644
index 1e967ff8b..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlag.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 John Anvik and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * John Anvik - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-import java.io.Serializable;
-
-/**
- * @author John Anvik
- */
-public class AttachmentFlag implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- private final AttachmentFlagStatus status;
-
- private final AttachmentFlagState state;
-
- public AttachmentFlag(AttachmentFlagStatus status, AttachmentFlagState state) {
- this.status = status;
- this.state = state;
- }
-
- public AttachmentFlagState getState() {
- return this.state;
- }
-
- public AttachmentFlagStatus getStatus() {
- return this.status;
- }
-
- @Override
- public String toString() {
- return this.status.name() + "[" + (this.state.equals(AttachmentFlagState.UNKNOWN) ? "" : this.state.name()) //$NON-NLS-1$ //$NON-NLS-2$
- + "]"; //$NON-NLS-1$
- }
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagState.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagState.java
deleted file mode 100644
index b18ccabc3..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagState.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 John Anvik and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * John Anvik - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-/**
- * @author John Anvik
- */
-public enum AttachmentFlagState {
- OFF, GRANTED, DENIED, REQUESTED, UNKNOWN;
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagStatus.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagStatus.java
deleted file mode 100644
index 026f3c36d..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagStatus.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 John Anvik and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * John Anvik - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-/**
- * @author John Anvik
- */
-public enum AttachmentFlagStatus {
- REVIEW /* Firefox */, SUPERREVIEW /* Firefox */, APPROVAL /* Firefox */, UI /* Firefox */, BRANCH /* Firefox */, OBSOLETE, UNKNOWN, COMMITTED /* Gnome */, ACCEPTED /* Gnome accepted-committ_now*/, COMMENTED /* Gnome */, NONE /* Gnome */, REJECTED/* Gnome */;
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/BugzillaTaskHistoryParser.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/BugzillaTaskHistoryParser.java
deleted file mode 100644
index 192dd3bc7..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/BugzillaTaskHistoryParser.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 John Anvik and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * John Anvik - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.text.ParseException;
-import java.util.Iterator;
-import java.util.Locale;
-
-import javax.security.auth.login.LoginException;
-import javax.swing.text.html.HTML.Tag;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.eclipse.mylyn.commons.net.HtmlStreamTokenizer;
-import org.eclipse.mylyn.commons.net.HtmlTag;
-import org.eclipse.mylyn.commons.net.HtmlStreamTokenizer.Token;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaLanguageSettings;
-
-/**
- * Parses Bugzilla bug activity page to fill in a BugActivity object
- *
- * @author John Anvik
- */
-
-public class BugzillaTaskHistoryParser {
-
- private final InputStream inStream;
-
- private final String characterEncoding;
-
- public BugzillaTaskHistoryParser(InputStream inStream, String characterEncoding) {
- this.inStream = inStream;
- this.characterEncoding = characterEncoding;
- }
-
- /**
- * Parse the activity page for events
- *
- * @return A BugActivity object containing the activity history
- */
- public TaskHistory retrieveHistory(BugzillaLanguageSettings bugzillaLanguageSettings) throws IOException,
- ParseException, LoginException {
- TaskHistory activity = new TaskHistory();
- HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(new BufferedReader(new InputStreamReader(inStream,
- characterEncoding)), null);
-
- boolean isTitle = false;
- boolean possibleBadLogin = false;
- String title = ""; //$NON-NLS-1$
-
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- // make sure that bugzilla doesn't want us to login
- 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 from inside of the title tag
- if (token.getType() != Token.TAG) {
- title += ((StringBuffer) token.getValue()).toString().toLowerCase() + " "; //$NON-NLS-1$
- continue;
- } else if (token.getType() == Token.TAG && ((HtmlTag) token.getValue()).getTagType() == Tag.TITLE
- && ((HtmlTag) token.getValue()).isEndTag()) {
- // check if we may have a problem with login by looking
- // at
- // the title of the page
- boolean found = false;
- for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand(
- BugzillaLanguageSettings.COMMAND_BAD_LOGIN).iterator(); iterator.hasNext() && !found;) {
- String value = iterator.next().toLowerCase(Locale.ENGLISH);
- found = found || title.indexOf(value) != -1;
- }
- if (found) {
- possibleBadLogin = true;
- }
- isTitle = false;
- title = ""; //$NON-NLS-1$
- }
- continue;
- }
-
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- // Skip till find <br> - "there can be only one"
- if (tag.getTagType() == Tag.BR && !tag.isEndTag()) {
- // skip tags until start of real data
- while (true) {
- token = tokenizer.nextToken();
- if (token.getType() == Token.TAG) {
- tag = (HtmlTag) token.getValue();
- if ((tag.isEndTag() && tag.getTagType() == Tag.TR) || tag.getTagType() == Tag.P) {
- break;
- }
- }
- }
- parseActivity(tokenizer, activity);
- }
- }
- }
-
- // if we don't have any keywords and suspect that there was a login
- // problem, assume we had a login problem
- if (activity.size() == 0 && possibleBadLogin) {
- throw new LoginException("Bugzilla login information incorrect"); //$NON-NLS-1$
- }
- return activity;
- }
-
- /**
- * Parse the events that have happened to the bug
- *
- * @param tokenizer
- * the token stream
- * @param activity
- * the activity object to store the events in
- * @return
- */
- private void parseActivity(HtmlStreamTokenizer tokenizer, TaskHistory activity) throws IOException, ParseException {
- HtmlTag tag;
-
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- tag = (HtmlTag) token.getValue();
-
- // End of events
- if (tag.getTagType() == Tag.TABLE && tag.isEndTag()) {
- break;
- }
-
- // Get event entry
- this.parseEvent(tokenizer, activity);
- }
- }
- }
-
- /**
- * Parse an activity entry
- *
- * @param tokenizer
- * the stream of tokens
- * @param activity
- * the activity object to store events in
- */
- private void parseEvent(HtmlStreamTokenizer tokenizer, TaskHistory activity) {
-
- HtmlTag tag;
- int numChanges = 0;
-
- try {
- // Discover how many changes for this entry
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == Tag.TD && tag.hasAttribute("rowspan")) { //$NON-NLS-1$
- numChanges = tag.getIntAttribute("rowspan"); //$NON-NLS-1$
- break;
- }
- }
- }
- } catch (NumberFormatException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- } catch (ParseException e) {
- e.printStackTrace();
- }
-
- String name = getData(tokenizer);
- String date = getData(tokenizer);
-
- String what, removed, added;
- TaskRevision event;
- for (int change = 0; change < numChanges; change++) {
- what = getData(tokenizer);
- removed = getData(tokenizer);
- added = getData(tokenizer);
-
- event = TaskRevision.createEvent(what, added);
- event.setName(name);
- event.setDate(date);
- event.setRemoved(removed);
-
- activity.addEvent(event);
- }
- }
-
- private String getData(HtmlStreamTokenizer tokenizer) {
-
- Token token;
- HtmlTag tag;
- StringBuffer sb = new StringBuffer();
-
- try {
- for (token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == Tag.TD && tag.isEndTag()) {
- String data = StringEscapeUtils.unescapeHtml(sb.toString());
- if (data.startsWith("\n") && (data.contains("Attachment") == false)) { //$NON-NLS-1$ //$NON-NLS-2$
- data = ""; // empty field //$NON-NLS-1$
- }
- return data;
- }
- }
- if (token.getType() == Token.TEXT) {
- sb.append(token.toString());
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- } catch (ParseException e) {
- e.printStackTrace();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/Messages.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/Messages.java
deleted file mode 100644
index ba94cbc5d..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/Messages.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.bugzilla.core.history.messages"; //$NON-NLS-1$
-
- static {
- // load message values from bundle file
- reloadMessages();
- }
-
- public static void reloadMessages() {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- public static String ResolutionType_Unknown_resolution_type_X;
-
- public static String StatusType_Unknown_status_type_X;
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionEvent.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionEvent.java
deleted file mode 100644
index 86a5a5752..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionEvent.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 John Anvik and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * John Anvik - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-/**
- * @author John Anvik
- */
-public class ResolutionEvent extends TaskRevision {
-
- private static final long serialVersionUID = 6609447743555687524L;
-
- private final ResolutionType type;
-
- public ResolutionEvent(ResolutionType type) {
- this.what = TaskRevision.RESOLUTION;
- this.type = type;
- }
-
- public ResolutionType getType() {
- return this.type;
- }
-
- public String getResolvedBy() {
- return this.getName();
- }
-
- @Override
- public String toString() {
- return this.getName() + " | " + this.getDate() + " | " + this.getWhat() + " | " + this.getRemoved() + " | " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- + (this.getType().equals(ResolutionType.UNKNOWN) ? "" : this.getType()); //$NON-NLS-1$
- }
-
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionType.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionType.java
deleted file mode 100644
index 55e187587..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionType.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 John Anvik and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * John Anvik - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-import java.text.MessageFormat;
-
-/**
- * @author John Anvik
- */
-public enum ResolutionType {
-
- FIXED, DUPLICATE, WONTFIX, INVALID, WORKSFORME, REOPENED, LATER, REMIND, MOVED, UNKNOWN, NOTABUG, NOTGNOME, INCOMPLETE, OBSOLETE, EXPIRED, NOTXIMIAN, NEXTRELEASE, ERRATA, RAWHIDE, UPSTREAM, CANTFIX, CURRENTRELEASE, INSUFFICIENT_DATA, DEFERRED;
-
- public static ResolutionType convert(String change) {
- if (change.equals("FIXED")) { //$NON-NLS-1$
- return ResolutionType.FIXED;
- }
- if (change.contains("DUPLICATE")) { //$NON-NLS-1$
- return ResolutionType.DUPLICATE;
- }
- if (change.equals("INVALID")) { //$NON-NLS-1$
- return ResolutionType.INVALID;
- }
- if (change.equals("LATER")) { //$NON-NLS-1$
- return ResolutionType.LATER;
- }
- if (change.equals("WORKSFORME")) { //$NON-NLS-1$
- return ResolutionType.WORKSFORME;
- }
- if (change.equals("REOPENED")) { //$NON-NLS-1$
- return ResolutionType.REOPENED;
- }
- if (change.equals("WONTFIX")) { //$NON-NLS-1$
- return ResolutionType.WONTFIX;
- }
- if (change.equals("REMIND")) { //$NON-NLS-1$
- return ResolutionType.REMIND;
- }
- if (change.equals("MOVED")) { //$NON-NLS-1$
- return ResolutionType.MOVED;
- }
- if (change.equals("EXPIRED")) { //$NON-NLS-1$
- return ResolutionType.EXPIRED;
- }
- if (change.equals("NOTABUG")) { // Gnome //$NON-NLS-1$
- return ResolutionType.NOTABUG;
- }
- if (change.equals("NOTGNOME")) { // Gnome //$NON-NLS-1$
- return ResolutionType.NOTGNOME;
- }
- if (change.equals("INCOMPLETE")) { // Gnome //$NON-NLS-1$
- return ResolutionType.INCOMPLETE;
- }
- if (change.equals("OBSOLETE")) { // Gnome //$NON-NLS-1$
- return ResolutionType.OBSOLETE;
- }
- if (change.equals("NOTXIMIAN")) { // Gnome //$NON-NLS-1$
- return ResolutionType.NOTXIMIAN;
- }
- if (change.equals("NEXTRELEASE")) { // Redhat //$NON-NLS-1$
- return ResolutionType.NEXTRELEASE;
- }
- if (change.equals("ERRATA")) {// Redhat //$NON-NLS-1$
- return ResolutionType.ERRATA;
- }
- if (change.equals("RAWHIDE")) {// Redhat //$NON-NLS-1$
- return ResolutionType.RAWHIDE;
- }
- if (change.equals("UPSTREAM")) {// Redhat //$NON-NLS-1$
- return ResolutionType.UPSTREAM;
- }
- if (change.equals("CANTFIX")) {// Redhat //$NON-NLS-1$
- return ResolutionType.CANTFIX;
- }
- if (change.equals("CURRENTRELEASE")) {// Redhat //$NON-NLS-1$
- return ResolutionType.CURRENTRELEASE;
- }
- if (change.equals("INSUFFICIENT_DATA")) {// Redhat //$NON-NLS-1$
- return ResolutionType.INSUFFICIENT_DATA;
- }
- if (change.equals("DEFERRED")) {// Redhat //$NON-NLS-1$
- return ResolutionType.DEFERRED;
- }
- if (change.equals("") == false) { //$NON-NLS-1$
- System.err.println(MessageFormat.format(Messages.ResolutionType_Unknown_resolution_type_X, change));
- }
- return ResolutionType.UNKNOWN;
- }
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusEvent.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusEvent.java
deleted file mode 100644
index 8f77ac0ae..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusEvent.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 John Anvik and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * John Anvik - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-/**
- * @author John Anvik
- */
-public class StatusEvent extends TaskRevision {
-
- private static final long serialVersionUID = 245446279981920435L;
-
- private final StatusType type;
-
- public StatusEvent(StatusType type) {
- this.what = TaskRevision.STATUS;
- this.type = type;
- }
-
- public StatusType getType() {
- return this.type;
- }
-
- @Override
- public String toString() {
- return this.getName() + " | " + this.getDate() + " | " + this.getWhat() + " | " + this.getRemoved() + " | " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- + this.getType();
- }
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusType.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusType.java
deleted file mode 100644
index 2ec1d8d6a..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusType.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 John Anvik and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * John Anvik - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-import java.text.MessageFormat;
-
-/**
- * @author John Anvik
- */
-public enum StatusType {
- VERIFIED, RESOLVED, CLOSED, REOPENED, ASSIGNED, NEW, UNCONFIRMED, NEEDINFO, /* ANT? */
- WAITING, /* GCC */
- SUSPENDED, /* GCC */
- MODIFIED, /* Redhat */
- POST, /* Redhat */
- INVESTIGATE, /* Redhat */
- PASSES_QA, /* Redhat */
- PROD_READY, /* Redhat */
- RELEASE_PENDING, /* Redhat */
- ON_QA, /* Redhat */
- QA_READY, /* Redhat */
- FAILS_QA, /* Redhat */
- SPEC, /* Redhat */
- UNKNOWN;
-
- public static StatusType convert(String change) {
- if (change.equals("RESOLVED")) { //$NON-NLS-1$
- return RESOLVED;
- }
- if (change.equals("ASSIGNED")) { //$NON-NLS-1$
- return ASSIGNED;
- }
- if (change.equals("NEW")) { //$NON-NLS-1$
- return NEW;
- }
- if (change.equals("REOPENED")) { //$NON-NLS-1$
- return REOPENED;
- }
- if (change.equals("CLOSED")) { //$NON-NLS-1$
- return CLOSED;
- }
- if (change.equals("VERIFIED")) { //$NON-NLS-1$
- return VERIFIED;
- }
- if (change.equals("UNCONFIRMED")) { //$NON-NLS-1$
- return UNCONFIRMED;
- }
- if (change.startsWith("NEEDINFO")) { //$NON-NLS-1$
- return NEEDINFO;
- }
- if (change.equals("WAITING")) { //$NON-NLS-1$
- return WAITING;
- }
- if (change.equals("SUSPENDED")) { //$NON-NLS-1$
- return SUSPENDED;
- }
- if (change.equals("MODIFIED")) { //$NON-NLS-1$
- return MODIFIED;
- }
- if (change.equals("POST")) { //$NON-NLS-1$
- return POST;
- }
- if (change.equals("INVESTIGATE")) { //$NON-NLS-1$
- return INVESTIGATE;
- }
- if (change.equals("PASSES_QA")) { //$NON-NLS-1$
- return PASSES_QA;
- }
- if (change.equals("PROD_READY")) { //$NON-NLS-1$
- return PROD_READY;
- }
- if (change.equals("RELEASE_PENDING")) { //$NON-NLS-1$
- return RELEASE_PENDING;
- }
- if (change.equals("ON_QA")) { //$NON-NLS-1$
- return ON_QA;
- }
- if (change.equals("QA_READY")) { //$NON-NLS-1$
- return QA_READY;
- }
- if (change.equals("FAILS_QA")) { //$NON-NLS-1$
- return FAILS_QA;
- }
- if (change.equals("SPEC")) { //$NON-NLS-1$
- return SPEC;
- }
- if (change.equals("") == false) { //$NON-NLS-1$
- System.err.println(MessageFormat.format(Messages.StatusType_Unknown_status_type_X, change));
- }
- return UNKNOWN;
- }
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskHistory.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskHistory.java
deleted file mode 100644
index 70cb72b51..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskHistory.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 John Anvik and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * John Anvik - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * @author John Anvik
- */
-public class TaskHistory implements Iterable<TaskRevision>, Serializable {
-
- private static final long serialVersionUID = 1724420130243724426L;
-
- private final List<StatusEvent> statusEvents;
-
- private final List<ResolutionEvent> resolutionEvents;
-
- private final List<AssignmentEvent> assignmentEvents;
-
- private final List<TaskRevision> otherEvents;
-
- private final List<AttachmentEvent> attachmentEvents;
-
- public TaskHistory() {
- this.statusEvents = new ArrayList<StatusEvent>();
- this.resolutionEvents = new ArrayList<ResolutionEvent>();
- this.assignmentEvents = new ArrayList<AssignmentEvent>();
- this.attachmentEvents = new ArrayList<AttachmentEvent>();
- this.otherEvents = new ArrayList<TaskRevision>();
- }
-
- public void addEvent(TaskRevision event) {
- if (event instanceof StatusEvent) {
- this.statusEvents.add((StatusEvent) event);
- return;
- }
-
- if (event instanceof ResolutionEvent) {
- this.resolutionEvents.add((ResolutionEvent) event);
- return;
- }
-
- if (event instanceof AssignmentEvent) {
- this.assignmentEvents.add((AssignmentEvent) event);
- return;
- }
-
- if (event instanceof AttachmentEvent) {
- this.attachmentEvents.add((AttachmentEvent) event);
- return;
- }
- this.otherEvents.add(event);
- }
-
- private List<TaskRevision> getEvents() {
- List<TaskRevision> events = new ArrayList<TaskRevision>();
- events.addAll(this.statusEvents);
- events.addAll(this.resolutionEvents);
- events.addAll(this.assignmentEvents);
- events.addAll(this.attachmentEvents);
- events.addAll(this.otherEvents);
- Collections.sort(events);
- return events;
- }
-
- public Iterator<TaskRevision> iterator() {
- return getEvents().iterator();
- }
-
- public int size() {
- return this.otherEvents.size() + this.statusEvents.size() + this.resolutionEvents.size()
- + this.assignmentEvents.size();
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- for (Object event : this) {
- sb.append(event);
- sb.append("\n"); //$NON-NLS-1$
- }
- return sb.toString();
- }
-
- public List<StatusEvent> getStatusEvents() {
- return statusEvents;
- }
-
- public List<ResolutionEvent> getResolutionEvents() {
- return resolutionEvents;
- }
-
- public List<TaskRevision> getOtherEvents() {
- return otherEvents;
- }
-
- public List<AttachmentEvent> getAttachmentEvents() {
- return attachmentEvents;
- }
-
- public List<AssignmentEvent> getAssignmentEvents() {
- return assignmentEvents;
- }
-
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskRevision.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskRevision.java
deleted file mode 100644
index bde4c5f0b..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskRevision.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 John Anvik and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * John Anvik - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.core.history;
-
-import java.io.Serializable;
-
-/**
- * @author John Anvik
- */
-public class TaskRevision implements Comparable<TaskRevision>, Serializable {
-
- private static final long serialVersionUID = 7739060501945994522L;
-
- protected final static String STATUS = "Status"; //$NON-NLS-1$
-
- protected final static String RESOLUTION = "Resolution"; //$NON-NLS-1$
-
- protected final static String ASSIGNMENT = "AssignedTo"; //$NON-NLS-1$
-
- protected final static String ATTACHMENT = "Attachment"; //$NON-NLS-1$
-
- protected String name;
-
- protected String date;
-
- protected String what;
-
- protected String removed;
-
- protected String added;
-
- protected TaskRevision() {
- this.added = ""; //$NON-NLS-1$
- }
-
- public static TaskRevision createEvent(String type, String change) {
- TaskRevision event = new TaskRevision();
-
- event.setWhat(type);
-
- if (STATUS.equals(type)) {
- event = new StatusEvent(StatusType.convert(change));
- }
-
- if (RESOLUTION.equals(type)) {
- event = new ResolutionEvent(ResolutionType.convert(change));
- }
-
- if (ASSIGNMENT.equals(type)) {
- event = new AssignmentEvent(change);
- }
-
- if (type.contains(ATTACHMENT) && type.contains("Flag")) { //$NON-NLS-1$
- event = new AttachmentEvent(AttachmentEvent.parseId(type), AttachmentEvent.parseFlags(change));
- }
-
- event.setAdded(change);
- return event;
- }
-
- private void setAdded(String added) {
- this.added = added;
- }
-
- public void setRemoved(String removed) {
- this.removed = removed;
- }
-
- private void setWhat(String what) {
- this.what = what;
- }
-
- public void setDate(String date) {
- this.date = date;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getAdded() {
- return this.added;
- }
-
- public String getRemoved() {
- return this.removed;
- }
-
- public String getWhat() {
- return this.what;
- }
-
- public String getDate() {
- return this.date;
- }
-
- public String getName() {
- return this.name;
- }
-
- @Override
- public String toString() {
- return this.name + " | " + this.date + " | " + this.what + " | " + this.removed + " | " + this.added; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-
- public int compareTo(TaskRevision o) {
- return this.date.compareTo(o.getDate());
- }
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/messages.properties b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/messages.properties
deleted file mode 100644
index 252356810..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/messages.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2009 Tasktop Technologies and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Tasktop Technologies - initial API and implementation
-###############################################################################
-ResolutionType_Unknown_resolution_type_X=Unknown resolution type: {0}
-StatusType_Unknown_status_type_X=Unknown status type: {0}

Back to the top