Skip to content

Violation Comparison Logic (Possible Bug) #1339

@DeHopen

Description

@DeHopen

@yegor256

In Violation.Default.compareTo:

return this.vldtr.compareToIgnoreCase(other.validator());

  • Problem: This only compares the validator name, not the file, line, or message, which may not provide a meaningful ordering for violations.

  • Consequence: Sorting violations may not be stable or useful.

  • Fix: Consider comparing all relevant fields for a more robust ordering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions