Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 146776 Details for
Bug 288309
detect changes using date compare when time zone available on repository
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
backported patch
clipboard.txt (text/plain), 6.79 KB, created by
Steffen Pingel
on 2009-09-09 12:53:06 EDT
(
hide
)
Description:
backported patch
Filename:
MIME Type:
Creator:
Steffen Pingel
Created:
2009-09-09 12:53:06 EDT
Size:
6.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.bugzilla.ui >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java,v >retrieving revision 1.94 >diff -u -r1.94 BugzillaRepositorySettingsPage.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java 24 Jul 2009 12:08:07 -0000 1.94 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java 9 Sep 2009 16:54:58 -0000 >@@ -55,7 +55,7 @@ > > private static final String LABEL_SHORT_LOGINS = Messages.BugzillaRepositorySettingsPage_local_users_enabled; > >- private static final String LABEL_VERSION_NUMBER = "2.18 - 3.2"; //$NON-NLS-1$ >+ private static final String LABEL_VERSION_NUMBER = "3.0 - 3.4"; //$NON-NLS-1$ > > private static final String TITLE = Messages.BugzillaRepositorySettingsPage_bugzilla_repository_settings; > >#P org.eclipse.mylyn.bugzilla.core >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java,v >retrieving revision 1.164.2.2 >diff -u -r1.164.2.2 BugzillaRepositoryConnector.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java 1 Sep 2009 04:51:37 -0000 1.164.2.2 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java 9 Sep 2009 16:54:59 -0000 >@@ -68,6 +68,8 @@ > > private static final String DEADLINE_FORMAT = "yyyy-MM-dd"; //$NON-NLS-1$ > >+ private static final long HOUR = 1000 * 60 * 60; >+ > private final BugzillaTaskAttachmentHandler attachmentHandler = new BugzillaTaskAttachmentHandler(this); > > private final BugzillaTaskDataHandler taskDataHandler = new BugzillaTaskDataHandler(this); >@@ -76,7 +78,7 @@ > > protected static BugzillaLanguageSettings enSetting; > >- protected final static Set<BugzillaLanguageSettings> languages = new LinkedHashSet<BugzillaLanguageSettings>(); >+ protected static final Set<BugzillaLanguageSettings> languages = new LinkedHashSet<BugzillaLanguageSettings>(); > > @Override > public String getLabel() { >@@ -488,15 +490,59 @@ > > String lastKnownMod = task.getAttribute(BugzillaAttribute.DELTA_TS.getKey()); > if (lastKnownMod != null) { >+ > TaskAttribute attrModification = taskData.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION); >- if (attrModification != null) { >- return !lastKnownMod.equals(attrModification.getValue()); >- } >+ if (attrModification != null && attrModification.getValue() != null >+ && attrModification.getValue().length() > 0) { > >+ boolean cachedHasTZ = hasTimzone(lastKnownMod); >+ boolean repoHasTZ = hasTimzone(attrModification.getValue()); >+ if (!cachedHasTZ && !repoHasTZ) { // State 1 >+ return !lastKnownMod.equals(attrModification.getValue()); >+ } >+ >+ BugzillaAttributeMapper mapper = (BugzillaAttributeMapper) taskData.getAttributeMapper(); >+ Date oldModDate = mapper.getDate(BugzillaAttribute.DELTA_TS.getKey(), lastKnownMod); >+ Date newModDate = mapper.getDateValue(attrModification); >+ >+ // If either of the dates can't be parsed, fall back to string comparison >+ if (oldModDate == null) { >+ ((AbstractTask) task).setStatus(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, >+ "Unable to parse cached task modification timestamp " + lastKnownMod)); //$NON-NLS-1$ >+ return !lastKnownMod.equals(attrModification.getValue()); >+ } else if (newModDate == null) { >+ ((AbstractTask) task).setStatus(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, >+ "Unable to parse incoming task modification timestamp " + attrModification.getValue())); //$NON-NLS-1$ >+ return !lastKnownMod.equals(attrModification.getValue()); >+ } >+ >+ if ((cachedHasTZ && !repoHasTZ) || (!cachedHasTZ && repoHasTZ)) { // State 2 (unlikely) || Sate 3 >+ long delta = Math.abs(newModDate.getTime() - oldModDate.getTime()); >+ if (delta == 0) { >+ return false; >+ } else if (delta > 0 && delta % HOUR == 0 && delta < 24 * HOUR) { >+ // If same time but in different time zones, ignore/migrate >+ return false; >+ } >+ return true; >+ } else if (cachedHasTZ && repoHasTZ) { //State 4 (of 4) >+ // Date Compare >+ return oldModDate.compareTo(newModDate) != 0; >+ } >+ } > } > return true; > } > >+ private boolean hasTimzone(String dateString) { >+ if (dateString == null || dateString.length() == 0) { >+ return false; >+ } >+ String[] parts = dateString.split(" "); //$NON-NLS-1$ >+ boolean hasTimeZone = (parts != null && parts.length == 3); >+ return hasTimeZone; >+ } >+ > @Override > public Collection<TaskRelation> getTaskRelations(TaskData taskData) { > List<TaskRelation> relations = new ArrayList<TaskRelation>(); >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java,v >retrieving revision 1.24 >diff -u -r1.24 BugzillaAttributeMapper.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java 24 Jul 2009 12:07:14 -0000 1.24 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java 9 Sep 2009 16:54:59 -0000 >@@ -83,7 +83,7 @@ > /** > * Note: Date formatters constructed within method for thread safety > */ >- private Date getDate(String attributeId, String dateString) { >+ protected Date getDate(String attributeId, String dateString) { > Date parsedDate = null; > > /** >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java,v >retrieving revision 1.7 >diff -u -r1.7 BugzillaVersion.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java 24 Jul 2009 12:07:14 -0000 1.7 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java 9 Sep 2009 16:54:59 -0000 >@@ -30,7 +30,9 @@ > > public final static BugzillaVersion BUGZILLA_3_2 = new BugzillaVersion("3.2"); //$NON-NLS-1$ > >- public final static BugzillaVersion MAX_VERSION = new BugzillaVersion("3.2"); //$NON-NLS-1$ >+ 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$ > > private final int major; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 288309
:
146301
|
146302
|
146472
|
146516
| 146776