Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 288309 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java (-1 / +1 lines)
Lines 55-61 Link Here
55
55
56
	private static final String LABEL_SHORT_LOGINS = Messages.BugzillaRepositorySettingsPage_local_users_enabled;
56
	private static final String LABEL_SHORT_LOGINS = Messages.BugzillaRepositorySettingsPage_local_users_enabled;
57
57
58
	private static final String LABEL_VERSION_NUMBER = "2.18 - 3.2"; //$NON-NLS-1$
58
	private static final String LABEL_VERSION_NUMBER = "3.0 - 3.4"; //$NON-NLS-1$
59
59
60
	private static final String TITLE = Messages.BugzillaRepositorySettingsPage_bugzilla_repository_settings;
60
	private static final String TITLE = Messages.BugzillaRepositorySettingsPage_bugzilla_repository_settings;
61
61
(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java (-4 / +50 lines)
Lines 68-73 Link Here
68
68
69
	private static final String DEADLINE_FORMAT = "yyyy-MM-dd"; //$NON-NLS-1$
69
	private static final String DEADLINE_FORMAT = "yyyy-MM-dd"; //$NON-NLS-1$
70
70
71
	private static final long HOUR = 1000 * 60 * 60;
72
71
	private final BugzillaTaskAttachmentHandler attachmentHandler = new BugzillaTaskAttachmentHandler(this);
73
	private final BugzillaTaskAttachmentHandler attachmentHandler = new BugzillaTaskAttachmentHandler(this);
72
74
73
	private final BugzillaTaskDataHandler taskDataHandler = new BugzillaTaskDataHandler(this);
75
	private final BugzillaTaskDataHandler taskDataHandler = new BugzillaTaskDataHandler(this);
Lines 76-82 Link Here
76
78
77
	protected static BugzillaLanguageSettings enSetting;
79
	protected static BugzillaLanguageSettings enSetting;
78
80
79
	protected final static Set<BugzillaLanguageSettings> languages = new LinkedHashSet<BugzillaLanguageSettings>();
81
	protected static final Set<BugzillaLanguageSettings> languages = new LinkedHashSet<BugzillaLanguageSettings>();
80
82
81
	@Override
83
	@Override
82
	public String getLabel() {
84
	public String getLabel() {
Lines 488-502 Link Here
488
490
489
		String lastKnownMod = task.getAttribute(BugzillaAttribute.DELTA_TS.getKey());
491
		String lastKnownMod = task.getAttribute(BugzillaAttribute.DELTA_TS.getKey());
490
		if (lastKnownMod != null) {
492
		if (lastKnownMod != null) {
493
491
			TaskAttribute attrModification = taskData.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION);
494
			TaskAttribute attrModification = taskData.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION);
492
			if (attrModification != null) {
495
			if (attrModification != null && attrModification.getValue() != null
493
				return !lastKnownMod.equals(attrModification.getValue());
496
					&& attrModification.getValue().length() > 0) {
494
			}
495
497
498
				boolean cachedHasTZ = hasTimzone(lastKnownMod);
499
				boolean repoHasTZ = hasTimzone(attrModification.getValue());
500
				if (!cachedHasTZ && !repoHasTZ) { // State 1
501
					return !lastKnownMod.equals(attrModification.getValue());
502
				}
503
504
				BugzillaAttributeMapper mapper = (BugzillaAttributeMapper) taskData.getAttributeMapper();
505
				Date oldModDate = mapper.getDate(BugzillaAttribute.DELTA_TS.getKey(), lastKnownMod);
506
				Date newModDate = mapper.getDateValue(attrModification);
507
508
				// If either of the dates can't be parsed, fall back to string comparison
509
				if (oldModDate == null) {
510
					((AbstractTask) task).setStatus(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN,
511
							"Unable to parse cached task modification timestamp " + lastKnownMod)); //$NON-NLS-1$
512
					return !lastKnownMod.equals(attrModification.getValue());
513
				} else if (newModDate == null) {
514
					((AbstractTask) task).setStatus(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN,
515
							"Unable to parse incoming task modification timestamp " + attrModification.getValue())); //$NON-NLS-1$
516
					return !lastKnownMod.equals(attrModification.getValue());
517
				}
518
519
				if ((cachedHasTZ && !repoHasTZ) || (!cachedHasTZ && repoHasTZ)) { // State 2 (unlikely) || Sate 3
520
					long delta = Math.abs(newModDate.getTime() - oldModDate.getTime());
521
					if (delta == 0) {
522
						return false;
523
					} else if (delta > 0 && delta % HOUR == 0 && delta < 24 * HOUR) {
524
						// If same time but in different time zones, ignore/migrate
525
						return false;
526
					}
527
					return true;
528
				} else if (cachedHasTZ && repoHasTZ) { //State 4 (of 4)
529
					// Date Compare
530
					return oldModDate.compareTo(newModDate) != 0;
531
				}
532
			}
496
		}
533
		}
497
		return true;
534
		return true;
498
	}
535
	}
499
536
537
	private boolean hasTimzone(String dateString) {
538
		if (dateString == null || dateString.length() == 0) {
539
			return false;
540
		}
541
		String[] parts = dateString.split(" "); //$NON-NLS-1$
542
		boolean hasTimeZone = (parts != null && parts.length == 3);
543
		return hasTimeZone;
544
	}
545
500
	@Override
546
	@Override
501
	public Collection<TaskRelation> getTaskRelations(TaskData taskData) {
547
	public Collection<TaskRelation> getTaskRelations(TaskData taskData) {
502
		List<TaskRelation> relations = new ArrayList<TaskRelation>();
548
		List<TaskRelation> relations = new ArrayList<TaskRelation>();
(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java (-1 / +1 lines)
Lines 83-89 Link Here
83
	/**
83
	/**
84
	 * Note: Date formatters constructed within method for thread safety
84
	 * Note: Date formatters constructed within method for thread safety
85
	 */
85
	 */
86
	private Date getDate(String attributeId, String dateString) {
86
	protected Date getDate(String attributeId, String dateString) {
87
		Date parsedDate = null;
87
		Date parsedDate = null;
88
88
89
		/**
89
		/**
(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java (-1 / +3 lines)
Lines 30-36 Link Here
30
30
31
	public final static BugzillaVersion BUGZILLA_3_2 = new BugzillaVersion("3.2"); //$NON-NLS-1$
31
	public final static BugzillaVersion BUGZILLA_3_2 = new BugzillaVersion("3.2"); //$NON-NLS-1$
32
32
33
	public final static BugzillaVersion MAX_VERSION = new BugzillaVersion("3.2"); //$NON-NLS-1$
33
	public final static BugzillaVersion BUGZILLA_3_4 = new BugzillaVersion("3.4"); //$NON-NLS-1$
34
35
	public final static BugzillaVersion MAX_VERSION = new BugzillaVersion("3.4"); //$NON-NLS-1$
34
36
35
	private final int major;
37
	private final int major;
36
38

Return to bug 288309