Open BookWood7th opened 4 days ago
The issue actually does not concern Location but instead IssueDialog where sorting is done without checking for these NullPointerExceptions. May also be an edge case of Java documentation for Array.sort, which can't take Comparators that don't accept null values
Well, compareTo
should not fail for valid argument objects, so I'd say it is a bug in the comparison.
Probably easy to fix by making the comparison null
-aware, isn't it?
The issue is reasonably easy to fix and I believe I found a somewhat elegant solution to this. The proposed solution adds explicit nullsLast comparators that check for null values of fileUri and position fields in Location before using the respective natural order of these fields in Location#compareTo(Location)
8e28439