Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2010-09-02 18:54:28 +0000
committerfbecker2010-09-02 18:54:28 +0000
commitc378122a262b1e3277e809dd500eac71804592fb (patch)
tree284c28c4ba4cc6d3c6c111153361da273ee92bf9 /org.eclipse.mylyn.bugzilla.core
parentc7aaa03b9b35e43b97928ca346080cc3338774fe (diff)
downloadorg.eclipse.mylyn.tasks-c378122a262b1e3277e809dd500eac71804592fb.tar.gz
org.eclipse.mylyn.tasks-c378122a262b1e3277e809dd500eac71804592fb.tar.xz
org.eclipse.mylyn.tasks-c378122a262b1e3277e809dd500eac71804592fb.zip
ASSIGNED - bug 321054: [fwdport] (automatic) updates of configuration can cause loss of attribute options
https://bugs.eclipse.org/bugs/show_bug.cgi?id=321054
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java8
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java13
2 files changed, 7 insertions, 14 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 52cba1874..c47b5291f 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
@@ -57,6 +57,8 @@ import org.apache.commons.httpclient.methods.multipart.Part;
import org.apache.commons.httpclient.methods.multipart.PartBase;
import org.apache.commons.httpclient.methods.multipart.StringPart;
import org.apache.commons.httpclient.params.HttpMethodParams;
+import org.apache.commons.httpclient.util.DateParseException;
+import org.apache.commons.httpclient.util.DateUtil;
import org.eclipse.core.net.proxy.IProxyData;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
@@ -689,7 +691,11 @@ public class BugzillaClient {
}
Header lastModifiedHeader = method.getResponseHeader("Last-Modified"); //$NON-NLS-1$
if (lastModifiedHeader != null) {
- repositoryConfiguration.setLastModifiedHeader(lastModifiedHeader.getValue());
+ try {
+ repositoryConfiguration.setLastModifiedHeader(DateUtil.parseDate(lastModifiedHeader.getValue()));
+ } catch (DateParseException e) {
+ repositoryConfiguration.setLastModifiedHeader((Date) null);
+ }
} else {
repositoryConfiguration.setLastModifiedHeader((Date) null);
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
index bf3eef050..bf9a5a245 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
@@ -13,9 +13,6 @@
package org.eclipse.mylyn.internal.bugzilla.core;
import java.io.Serializable;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@@ -976,14 +973,4 @@ public class RepositoryConfiguration implements Serializable {
public void setLastModifiedHeader(Date lastModifiedHeader) {
this.lastModifiedHeader = lastModifiedHeader;
}
-
- public void setLastModifiedHeader(String lastModifiedHeader) {
- DateFormat df = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z", Locale.US); //$NON-NLS-1$
- try {
- this.lastModifiedHeader = df.parse(lastModifiedHeader);
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
-
}

Back to the top