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 146301 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]
patch in progress
clipboard.txt (text/plain), 5.53 KB, created by
Robert Elves
on 2009-09-02 13:26:17 EDT
(
hide
)
Description:
patch in progress
Filename:
MIME Type:
Creator:
Robert Elves
Created:
2009-09-02 13:26:17 EDT
Size:
5.53 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.bugzilla.core >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 2 Sep 2009 17:28:20 -0000 >@@ -30,6 +30,8 @@ > > public final static BugzillaVersion BUGZILLA_3_2 = 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.2"); //$NON-NLS-1$ > > private final int major; >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 2 Sep 2009 17:28:20 -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/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.167 >diff -u -r1.167 BugzillaRepositoryConnector.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java 1 Sep 2009 04:52:08 -0000 1.167 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java 2 Sep 2009 17:28:20 -0000 >@@ -488,15 +488,88 @@ > > 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) { >+ >+ RepositoryConfiguration config = BugzillaCorePlugin.getRepositoryConfiguration(taskRepository.getRepositoryUrl()); >+ if (config == null) { >+ ((AbstractTask) task).setStatus(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, >+ "Repository configuration not found for " + taskRepository.getRepositoryUrl())); //$NON-NLS-1$ >+ return !lastKnownMod.equals(attrModification.getValue()); >+ } >+ >+ BugzillaVersion version = config.getInstallVersion(); >+ >+ if (version == null || version.compareTo(BugzillaVersion.BUGZILLA_3_4) < 0) { >+ 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 (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()); >+ } >+ >+ 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 (!sameTimeZone(lastKnownMod, attrModification.getValue())) { >+ // We're talking to BZ 3.4 or greater but time zones differ, potential migration scenario >+ long delta = Math.abs(newModDate.getTime() - oldModDate.getTime()); >+ long hour = 1000 * 60 * 60; >+ if (delta > 0 && delta % hour == 0 && delta < 24 * hour) { >+ return false; >+ } >+ return true; >+ } >+ >+ return oldModDate.compareTo(newModDate) != 0; >+ > } > > } > return true; > } > >+ private boolean sameTimeZone(String oldDate, String newDate) { >+ String parts[] = oldDate.split(" "); >+ String oldTZ = ""; >+ if (parts.length == 3) { >+ oldTZ = parts[2]; >+ } else { >+ return false; >+ } >+ >+ parts = newDate.split(" "); >+ String newTZ = ""; >+ if (parts.length == 3) { >+ newTZ = parts[2]; >+ } else { >+ return false; >+ } >+ >+ return newTZ.equals(oldTZ); >+ >+ } >+ >+ 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>();
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