Bug 465160 - JarComparator should know when XML is "the same", even if order of elements/attributes change
Summary: JarComparator should know when XML is "the same", even if order of elements/a...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-22 01:25 EDT by David Williams CLA
Modified: 2021-04-28 16:51 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2015-04-22 01:25:04 EDT
And, of course, that means when the order changes, and there is no schema to say that the order is significant. 

I am opening this bug in response to bug 465127. There, we changed from Java 7 to Java 8 to "run the build", and in generating some of the .api_description files, a few of them changed order of some child elements, so the comparator called them "different". 

I'm not sure if this is because the comparator "doesn't handle" XML (which seems unlikely) or of the comparator only detects XML based on file extension, instead of getting "contentType".
Comment 1 David Williams CLA 2015-04-22 01:34:19 EDT
Tobias,

I'm assuming Tycho use comparator straight from p2? Do you know? 

If you in Tycho "have your own", I suspect this bug should be moved to Tycho. 

Otherwise, belongs here, since Jar Comparator is in o.e.e.p2.repository.tools.
Comment 2 Tobias Oberlies CLA 2015-04-30 12:26:38 EDT
(In reply to comment #1)
> I'm assuming Tycho use comparator straight from p2? Do you know?
As far as I can see, Tycho has its own implementation. Currently, there is no special handling of XML files, so they currently have to be binary identical.

> If you in Tycho "have your own", I suspect this bug should be moved to Tycho.
Done.
Comment 3 Igor Fedorenko CLA 2015-04-30 12:37:59 EDT
Semantic xml comparison is very hard and can only be implemented for specific schemas. For example, if order of elements is insignificant in case of .api_description files, pom.xml files comparison must respect element order. 

The only way to support this is to provide some sort of pluggable mechanism to allow custom comparison logic, which seems like a lot of work. 

Can we ask jdt team to produce the same .api_description regardless of java version? Sorting elements should be next to trivial for them.
Comment 4 Mickael Istria CLA 2021-04-08 18:04:21 EDT
Eclipse Tycho is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/tycho/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest Tycho 2.4.0-SNAPSHOT
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present when latest release:
* Create a new issue at https://github.com/eclipse/tycho/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for Tycho will be archived and made read-only.