Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330006 - [comparator] False positive in feature compare
Summary: [comparator] False positive in feature compare
Status: VERIFIED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 RC2   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 344915 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-11-11 10:10 EST by Kim Moir CLA
Modified: 2011-05-24 02:12 EDT (History)
6 users (show)

See Also:
dj.houghton: review+


Attachments
patch (8.83 KB, patch)
2011-05-11 17:39 EDT, Andrew Niefer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kim Moir CLA 2010-11-11 10:10:43 EST
canonical: org.eclipse.update.feature,org.eclipse.equinox.core.sdk,3.6.1.R36x_v20101007-7sF99FsLFSyAVFKfV4c7B9BF
		Difference found for canonical: org.eclipse.update.feature,org.eclipse.equinox.core.sdk,3.6.1.R36x_v20101007-7sF99FsLFSyAVFKfV4c7B9BF between file:/builds/transfer/files/updates/3.6.x/M20101103-0800 and file:/builds/M201011100800/org.eclipse.releng.eclipsebuilder/../src/reposource/
			The feature has a different number of entries/
	packed: org.eclipse.update.feature,org.eclipse.equinox.core.sdk,3.6.1.R36x_v20101007-7sF99FsLFSyAVFKfV4c7B9BF
		Difference found for packed: org.eclipse.update.feature,org.eclipse.equinox.core.sdk,3.6.1.R36x_v20101007-7sF99FsLFSyAVFKfV4c7B9BF between file:/builds/transfer/files/updates/3.6.x/M20101103-0800 and file:/builds/M201011100800/org.eclipse.releng.eclipsebuilder/../src/reposource/
			The feature has a different number of entries/
Comment 1 Thomas Watson CLA 2010-11-11 10:23:12 EST
I assume this is because we added a new fragment for the launcher?
Comment 2 Andrew Niefer CLA 2010-11-11 15:48:36 EST
There actually appears to be a bug in the jar comparator and this is a false positive.

The bug comes from the multiple entries in the feature.xml for the same bundle with different platform filters. (macosx is included 3 times for ppc, x86, and x86_64).

These entries get added to a set and the equals for a FeatureEntry does not account for the platform filter so we "lose" 2 of the entries.

Kim, can we just leave the version alone or should we still retag?
Comment 3 Kim Moir CLA 2010-11-11 16:08:30 EST
I could just exclude this feature from the comparator when we mirror the repo.
Comment 4 Andrew Niefer CLA 2011-05-10 11:01:47 EDT
*** Bug 344915 has been marked as a duplicate of this bug. ***
Comment 5 Dani Megert CLA 2011-05-11 03:38:08 EDT
(In reply to comment #2)
> There actually appears to be a bug in the jar comparator and this is a false
> positive.

Who owns the comparator? It would be good to look at this.
Comment 6 Pascal Rapicault CLA 2011-05-11 07:42:10 EDT
Andrew owns the comparators though iirc Olivier did provide the jar comparator.
Comment 7 Andrew Niefer CLA 2011-05-11 17:39:03 EDT
Created attachment 195439 [details]
patch

I'm not comfortable changing the equals/hashCode for FeatureEntry at this point in the release because it is widely used throughout PDE/Build and p2.publisher.

Instead I created a wrapping object that will consult the os/ws/arch for comparison purposes.  A similar change was required in PDE/Build's FeatureGenerator for testing.
Comment 8 Andrew Niefer CLA 2011-05-12 11:08:30 EDT
Patch needs some review.
Comment 9 Andrew Niefer CLA 2011-05-12 13:20:22 EDT
Thank you DJ.
Comment 10 Dani Megert CLA 2011-05-16 03:22:37 EDT
The comparator test no longer failed in I20110514-0800.
Comment 11 Dani Megert CLA 2011-05-18 03:03:15 EDT
Unfortunately it failed again in I20110517-0800:
http://download.eclipse.org/eclipse/downloads/drops/I20110517-0800/buildlogs/comparatorlog.txt
Comment 12 Andrew Niefer CLA 2011-05-18 10:36:42 EDT
The releng build appears to be running on org.eclipse.equinox.p2.repository.tools_2.0.100.v20110419-0147.jar 
the fix is in v20110510

I believe Kim will need to update the org.eclipse.releng.basebuilder to RC1 for the test to start passing without retagging because the test is just parsing log files created by the releng builder and not actually doing the comparison itself.
Comment 13 Dani Megert CLA 2011-05-18 10:39:19 EDT
(In reply to comment #10)
> The comparator test no longer failed in I20110514-0800.
So this was just luck :-(
Comment 14 Kim Moir CLA 2011-05-18 10:45:29 EDT
Yes, I'm doing that today.  I was away from work for the past two days.
Comment 15 Dani Megert CLA 2011-05-24 02:11:26 EDT
Looks like this works now. Thanks!
Comment 16 Dani Megert CLA 2011-05-24 02:12:04 EDT
Verified in I20110523-0800.