Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2007-06-18 23:55:53 +0000
committerrelves2007-06-18 23:55:53 +0000
commitf476e81eebf2ea28b9e99d4e7177c6badd581b9c (patch)
tree5fe22c8f033c5fd8c324ed6727f680f7c7561427 /org.eclipse.mylyn.bugzilla.core
parent52a0977457bd0f75a85420f3ce28082e986979c5 (diff)
downloadorg.eclipse.mylyn.tasks-f476e81eebf2ea28b9e99d4e7177c6badd581b9c.tar.gz
org.eclipse.mylyn.tasks-f476e81eebf2ea28b9e99d4e7177c6badd581b9c.tar.xz
org.eclipse.mylyn.tasks-f476e81eebf2ea28b9e99d4e7177c6badd581b9c.zip
NEW - bug 160389: [api] change how offline task data is cached to disk and refactor attribute factory
https://bugs.eclipse.org/bugs/show_bug.cgi?id=160389
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/AbstractReportFactory.java28
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java22
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java10
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugzillaQueryContentHandler.java5
5 files changed, 28 insertions, 39 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/AbstractReportFactory.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/AbstractReportFactory.java
index d97daa2af..592f42443 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/AbstractReportFactory.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/AbstractReportFactory.java
@@ -58,24 +58,24 @@ public class AbstractReportFactory {
final BufferedInputStream is = new BufferedInputStream(inStream, 1024);
- // Remove control characters other than \\n and \\r
- InputStream iis = new InputStream() {
- public int read() throws IOException {
- int c;
- while ((c = is.read()) != -1) {
- if (!Character.isISOControl(c) || c == '\n' || c == '\r') {
- return c;
- }
- }
- return -1;
- }
- };
+ // filtered upon tasklist and offline taskdata externalization
+// InputStream iis = new InputStream() {
+// public int read() throws IOException {
+// int c;
+// while ((c = is.read()) != -1) {
+// if (!Character.isISOControl(c) || c == '\n' || c == '\r') {
+// return c;
+// }
+// }
+// return -1;
+// }
+// };
Reader in;
if (characterEncoding != null) {
- in = new InputStreamReader(iis, characterEncoding);
+ in = new InputStreamReader(is, characterEncoding);
} else {
- in = new InputStreamReader(iis);
+ in = new InputStreamReader(is);
}
if (in != null && clean) {
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 bc6b44d55..00a6bad65 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
@@ -807,7 +807,7 @@ public class BugzillaClient {
Iterator<RepositoryTaskAttribute> itr = taskData.getAttributes().iterator();
while (itr.hasNext()) {
RepositoryTaskAttribute a = itr.next();
- if (a != null && a.getID() != null && a.getID().compareTo("") != 0) {
+ if (a != null && a.getId() != null && a.getId().compareTo("") != 0) {
String value = null;
value = a.getValue();
if (value == null)
@@ -815,7 +815,7 @@ public class BugzillaClient {
cleanQAContact(a);
- fields.put(a.getID(), new NameValuePair(a.getID(), value));
+ fields.put(a.getId(), new NameValuePair(a.getId(), value));
}
}
@@ -828,7 +828,7 @@ public class BugzillaClient {
}
private void cleanQAContact(RepositoryTaskAttribute a) {
- if (a.getID().equals(BugzillaReportElement.QA_CONTACT.getKeyString())) {
+ if (a.getId().equals(BugzillaReportElement.QA_CONTACT.getKeyString())) {
if ("true".equals(configParameters.get(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN))) {
if (a.getValue() != null && a.getValue().length() > 0) {
int atIndex = a.getValue().indexOf("@");
@@ -851,19 +851,19 @@ public class BugzillaClient {
RepositoryTaskAttribute a = it.next();
if (a == null) {
continue;
- } else if (a.getID().equals(BugzillaReportElement.CC.getKeyString())
- || a.getID().equals(RepositoryTaskAttribute.REMOVE_CC)
- || a.getID().equals(BugzillaReportElement.REPORTER.getKeyString())
- || a.getID().equals(BugzillaReportElement.ASSIGNED_TO.getKeyString())
- || a.getID().equals(BugzillaReportElement.CREATION_TS.getKeyString())) {
+ } else if (a.getId().equals(BugzillaReportElement.CC.getKeyString())
+ || a.getId().equals(RepositoryTaskAttribute.REMOVE_CC)
+ || a.getId().equals(BugzillaReportElement.REPORTER.getKeyString())
+ || a.getId().equals(BugzillaReportElement.ASSIGNED_TO.getKeyString())
+ || a.getId().equals(BugzillaReportElement.CREATION_TS.getKeyString())) {
continue;
- } else if (a.getID() != null && a.getID().compareTo("") != 0) {
+ } else if (a.getId() != null && a.getId().compareTo("") != 0) {
cleanQAContact(a);
String value = a.getValue();
- if (a.getID().equals(BugzillaReportElement.DELTA_TS.getKeyString())) {
+ if (a.getId().equals(BugzillaReportElement.DELTA_TS.getKeyString())) {
value = stripTimeZone(value);
}
- fields.put(a.getID(), new NameValuePair(a.getID(), value != null ? value : ""));
+ fields.put(a.getId(), new NameValuePair(a.getId(), value != null ? value : ""));
}
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java
index e99928ad1..85caf3c01 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java
@@ -433,7 +433,7 @@ public class BugzillaRepositoryConnector extends AbstractRepositoryConnector {
throws CoreException {
String product = existingReport.getAttributeValue(BugzillaReportElement.PRODUCT.getKeyString());
for (RepositoryTaskAttribute attribute : existingReport.getAttributes()) {
- BugzillaReportElement element = BugzillaReportElement.valueOf(attribute.getID().trim().toUpperCase(
+ BugzillaReportElement element = BugzillaReportElement.valueOf(attribute.getId().trim().toUpperCase(
Locale.ENGLISH));
attribute.clearOptions();
List<String> optionValues = BugzillaCorePlugin.getRepositoryConfiguration(taskRepository, false)
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java
index 1d2c8bcab..4f8fe4879 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java
@@ -24,20 +24,12 @@ public class BugzillaTask extends AbstractTask {
private String severity;
private String product;
-
+
public BugzillaTask(String repositoryUrl, String id, String label) {
super(repositoryUrl, id, label);
setTaskUrl(BugzillaClient.getBugUrlWithoutLogin(repositoryUrl, id));
-// if (newTask) {
-// setSyncState(RepositoryTaskSyncState.INCOMING);
-// }
}
-// public BugzillaTask(BugzillaQueryHit hit, boolean newTask) {
-// this(hit.getRepositoryUrl(), hit.getTaskId(), hit.getSummary(), newTask);
-// setPriority(hit.getPriority());
-// }
-
@Override
public String getTaskKind() {
return IBugzillaConstants.BUGZILLA_TASK_KIND;
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugzillaQueryContentHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugzillaQueryContentHandler.java
index 38d76387d..73671e3d6 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugzillaQueryContentHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugzillaQueryContentHandler.java
@@ -37,9 +37,6 @@ public class SaxBugzillaQueryContentHandler extends DefaultHandler {
/** The priority of the bug */
private String priority = AbstractTask.PriorityLevel.getDefault().toString();
- /** The state of the bug */
- private String state = "";
-
private StringBuffer characters;
private ITaskCollector collector;
@@ -116,7 +113,7 @@ public class SaxBugzillaQueryContentHandler extends DefaultHandler {
//hit.setOwner(parsedText);
break;
case BUG_STATUS:
- state = parsedText;
+ // state = parsedText;
break;
// case RESOLUTION:
// resolution = parsedText;

Back to the top