Skip to content

Compare tool shows diff when fields are identical #68

Closed

Description

@nicoweidner

I executed

$ java -jar tools-java-1.1.0-jar-with-dependencies.jar CompareDocs compareOutput.xlsx ../testResources/SPDXJSONExample-v2.2.spdx.json ../testResources/SPDXJSONExample-v2.3.spdx.json

The resulting spreadsheet shows quite a few diffs even though the corresponding properties are identical. Not sure what the most efficient way of showing that is, so I'll attach two screenshots

Screenshot from 2022-09-09 16-40-19
Screenshot from 2022-09-09 16-41-06

Activity

  1. goneall commented on Sep 9, 2022

    @goneall
    Member

    @nicoweidner - Can you upload the 2 files you used to compare? I'll take a look.

  2. nicoweidner commented on Sep 9, 2022

    @nicoweidner
    Author

    I used these two files which are included in the repo - I should probably have made that more clear, sorry about that (the above command was executed in the target directory after building the tools, should have kept that part of the path):

  3. goneall commented on Sep 13, 2022

    @goneall
    Member

    Turns out there are differences in the files, but there are other issues masking what the issues are.

    For the difference in licenses, there seems to be an encoding issue in SPDXJSONExample-v2.2.spdx.json file which is causing a missmatch of the LicenseRef2 which in turn causes a missmatch of any expression which uses that reference.

    For the other differences, the two SPDX document have the same document namespace. This is confusing the comparer and causing the wrong document information to be displayed. You can work around this by manually changing the document namespace in either of the documents and re-running the compare.

    PR #70 adds a check and the utility will now fail if there are any duplicate document namespaces.

    I noticed some document level fields that were not different but were showing up as different - this has been resolved with PR #70.

  4. nicoweidner commented on Sep 19, 2022

    @nicoweidner
    Author

    Thanks for looking into this! After modifying the namespace, the real (and different) values do show up in the packages list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions