diff options
author | fbecker | 2010-04-07 16:21:02 +0000 |
---|---|---|
committer | fbecker | 2010-04-07 16:21:02 +0000 |
commit | 0001b3db1197dfba47fdc80afbf4dcd9a32b24af (patch) | |
tree | c2f248c27e98cb4c5f84f0347605e1ed8f8d17ba /org.eclipse.mylyn.bugzilla.core | |
parent | b3fd22db7d35ec7046a8d63d25f37104ebf78aff (diff) | |
download | org.eclipse.mylyn.tasks-0001b3db1197dfba47fdc80afbf4dcd9a32b24af.tar.gz org.eclipse.mylyn.tasks-0001b3db1197dfba47fdc80afbf4dcd9a32b24af.tar.xz org.eclipse.mylyn.tasks-0001b3db1197dfba47fdc80afbf4dcd9a32b24af.zip |
NEW - bug 289015: [upstream] changing timezones results in mid-air collisions
https://bugs.eclipse.org/bugs/show_bug.cgi?id=289015
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
2 files changed, 18 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 c17d569bb..9725e1962 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 @@ -1164,6 +1164,12 @@ public class BugzillaClient { Iterator<TaskAttribute> itr = attributes.iterator(); boolean tokenFound = false; boolean tokenRequired = false; + BugzillaVersion bugzillaVersion = null; + if (repositoryConfiguration != null) { + bugzillaVersion = repositoryConfiguration.getInstallVersion(); + } else { + bugzillaVersion = BugzillaVersion.MIN_VERSION; + } while (itr.hasNext()) { TaskAttribute a = itr.next(); @@ -1183,12 +1189,6 @@ public class BugzillaClient { || id.equals(BugzillaAttribute.VOTES.getKey())) { continue; } else if (id.equals(BugzillaAttribute.NEW_COMMENT.getKey())) { - BugzillaVersion bugzillaVersion = null; - if (repositoryConfiguration != null) { - bugzillaVersion = repositoryConfiguration.getInstallVersion(); - } else { - bugzillaVersion = BugzillaVersion.MIN_VERSION; - } if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_2_18) == 0) { a.setValue(formatTextToLineWrap(a.getValue(), true)); } @@ -1206,7 +1206,11 @@ public class BugzillaClient { } else if (id != null && id.compareTo("") != 0) { //$NON-NLS-1$ String value = a.getValue(); if (id.equals(BugzillaAttribute.DELTA_TS.getKey())) { - value = stripTimeZone(value); + if (bugzillaVersion.compareTo(BugzillaVersion.BUGZILLA_3_4_7) < 0 + || (bugzillaVersion.compareTo(BugzillaVersion.BUGZILLA_3_5) >= 0) + && bugzillaVersion.compareTo(BugzillaVersion.BUGZILLA_3_6) < 0) { + value = stripTimeZone(value); + } } if (id.startsWith("task.common.kind.flag_type") && repositoryConfiguration != null) { //$NON-NLS-1$ List<BugzillaFlag> flags = repositoryConfiguration.getFlags(); @@ -1262,12 +1266,6 @@ public class BugzillaClient { } // add the operation to the bug post - BugzillaVersion bugzillaVersion = null; - if (repositoryConfiguration != null) { - bugzillaVersion = repositoryConfiguration.getInstallVersion(); - } else { - bugzillaVersion = BugzillaVersion.MIN_VERSION; - } if (bugzillaVersion.compareTo(BugzillaVersion.BUGZILLA_3_2) < 0) { TaskAttribute attributeOperation = model.getRoot().getMappedAttribute(TaskAttribute.OPERATION); diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java index 0842358ca..2568f948d 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java @@ -32,7 +32,13 @@ public class BugzillaVersion implements Comparable<BugzillaVersion>, Serializabl public final static BugzillaVersion BUGZILLA_3_4 = new BugzillaVersion("3.4"); //$NON-NLS-1$ - public final static BugzillaVersion MAX_VERSION = new BugzillaVersion("3.4"); //$NON-NLS-1$ + public final static BugzillaVersion BUGZILLA_3_4_7 = new BugzillaVersion("3.4.7"); //$NON-NLS-1$ + + public final static BugzillaVersion BUGZILLA_3_5 = new BugzillaVersion("3.5"); //$NON-NLS-1$ + + public final static BugzillaVersion BUGZILLA_3_6 = new BugzillaVersion("3.6"); //$NON-NLS-1$ + + public final static BugzillaVersion MAX_VERSION = new BugzillaVersion("3.6"); //$NON-NLS-1$ private final int major; |