Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analyzer: Stop using a SortedSet in ProjectAnalyzerResult #6244

Merged
merged 5 commits into from
Dec 19, 2022

Commits on Dec 19, 2022

  1. ScanOssResultParserTest: Simplify assertion of single entries

    Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
    sschuberth committed Dec 19, 2022
    Configuration menu
    Copy the full SHA
    4367d99 View commit details
    Browse the repository at this point in the history
  2. LicenseFinding: Take the score into account in the COMPARATOR

    As now all properties are taken into account, this aligns
    `compareTo() == 0` with `equals() == true`.
    
    Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
    sschuberth committed Dec 19, 2022
    Configuration menu
    Copy the full SHA
    195088e View commit details
    Browse the repository at this point in the history
  3. OrtResult: Change the return type of getOrgPackages() to a Set

    There is no need to have these sorted in memory.
    
    Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
    sschuberth committed Dec 19, 2022
    Configuration menu
    Copy the full SHA
    d294e34 View commit details
    Browse the repository at this point in the history
  4. Maven: Remove an unneeded conversion to a SortedSet

    It is fine if the issues are not created in the order of sorted package
    ids.
    
    Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
    sschuberth committed Dec 19, 2022
    Configuration menu
    Copy the full SHA
    71e5c73 View commit details
    Browse the repository at this point in the history
  5. analyzer: Stop using a SortedSet in ProjectAnalyzerResult

    The `ProjectAnalyzerResult` is only serialized as part of analyzer
    functional tests when comparing to expected results. So in memory, there
    is no need for the `packages` to be a `SortedSet`. Change the code to
    only sort `packages` on serialization via a Jackson converter to have a
    defined order when comparing to expected results.
    
    This lays the fundation for getting rid of `Comparable` implementations
    in various classes. These implementations were only added for sorted
    output during serialization, but they break the `Set` contract as
    `compareTo() == 0` is not aligned with `equals() == true`, also see [1].
    
    [1]: https://docs.oracle.com/javase/8/docs/api/java/util/SortedSet.html
    
    Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
    sschuberth committed Dec 19, 2022
    Configuration menu
    Copy the full SHA
    179fbc3 View commit details
    Browse the repository at this point in the history