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 146140 Details for
Bug 288175
numerous false incomings in task list after upgrade
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]
based on Steffen's algorithm
clipboard.txt (text/plain), 5.29 KB, created by
Robert Elves
on 2009-08-31 22:20:28 EDT
(
hide
)
Description:
based on Steffen's algorithm
Filename:
MIME Type:
Creator:
Robert Elves
Created:
2009-08-31 22:20:28 EDT
Size:
5.29 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.bugzilla.core >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 1 Sep 2009 02:21:52 -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.166 >diff -u -r1.166 BugzillaRepositoryConnector.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java 20 Aug 2009 20:35:44 -0000 1.166 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java 1 Sep 2009 02:21:52 -0000 >@@ -34,6 +34,7 @@ > import org.eclipse.core.runtime.SubProgressMonitor; > import org.eclipse.mylyn.commons.core.StatusHandler; > import org.eclipse.mylyn.commons.net.Policy; >+import org.eclipse.mylyn.internal.tasks.core.AbstractTask; > import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery; > import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; > import org.eclipse.mylyn.tasks.core.IRepositoryQuery; >@@ -223,7 +224,7 @@ > queryCounter++; > String newurlQueryString = URLEncoder.encode(task.getTaskId() + ",", repository.getCharacterEncoding()); //$NON-NLS-1$ > urlQueryString += newurlQueryString; >- if (queryCounter >= 1000) { >+ if (urlQueryString.length() >= 7000) { > queryForChanged(repository, changedTasks, urlQueryString, session, new SubProgressMonitor(monitor, > queryCounter)); > >@@ -275,7 +276,7 @@ > changedTasks.add(changedTask); > } > } >- if (collector.getQueryTimestamp() != null) { >+ if (syncSession.getData() != null && collector.getQueryTimestamp() != null) { > syncSession.setData(collector.getQueryTimestamp()); > } > >@@ -472,6 +473,15 @@ > return taskDataHandler; > } > >+ 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 boolean hasTaskChanged(TaskRepository taskRepository, ITask task, TaskData taskData) { > if (taskData.isPartial() && task.getCreationDate() != null) { >@@ -487,9 +497,52 @@ > > String lastKnownMod = task.getAttribute(BugzillaAttribute.DELTA_TS.getKey()); > if (lastKnownMod != null) { >+ >+ boolean oldFormatHasTimeZone = hasTimzone(lastKnownMod); >+ > 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 newFormatHasTimeZone = hasTimzone(attrModification.getValue()); >+ >+ if (!oldFormatHasTimeZone && !newFormatHasTimeZone) { >+ 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 false; >+ } >+ >+ 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 false; >+ } >+ >+ if (!oldFormatHasTimeZone && newFormatHasTimeZone) { >+ long delta = Math.abs(newModDate.getTime() - oldModDate.getTime()); >+ long hour = 1000 * 60 * 60; >+ if (delta > 0 && delta % hour == 0 && delta < 24 * hour) { >+ // assuming time zone changed, let new timestamp get set and ignore incoming >+ return false; >+ } >+ return true; >+ } else if (oldFormatHasTimeZone && !newFormatHasTimeZone) { >+ ((AbstractTask) task).setStatus(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, >+ "Task modification timestamp missing timezone information: " + attrModification.getValue())); //$NON-NLS-1$ >+ return false; >+ } >+ >+ // If here, both have TIME ZONES, do date comparison >+ return oldModDate.compareTo(newModDate) != 0; >+ > } > > }
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 288175
:
146124
|
146125
| 146140 |
146141
|
146144
|
146145