]
Viacheslav Kabanovich commented on JBIDE-22119:
-----------------------------------------------
[~jcantrill], please take a look at the pull request.
Improve treatment of missing/invalid date in timestamp comparator
-----------------------------------------------------------------
Key: JBIDE-22119
URL:
https://issues.jboss.org/browse/JBIDE-22119
Project: Tools (JBoss Tools)
Issue Type: Enhancement
Components: openshift
Affects Versions: 4.3.1.CR1
Reporter: Viacheslav Kabanovich
Assignee: Viacheslav Kabanovich
Fix For: 4.4.0.Alpha1
CreationTimestampComparator makes a resource with missing/invalid date equal to any other
resource. If in a list of resources one is invalid, it will make result unpredictable. It
is better to move an invalid timestamp to the end of the list by assuming that it is less
than any valid timestamp, it will ensure correct sorting of resources with valid
timestamps.
Also this comparator may be reused in
OpenShiftResourcePropertySection.createCreatedBySorter() - the logic is the same.
DateTimeUtils.parse(String) is better to prevent NPE or ArrayIndexOutOfBoundsException
and throw the declared ParseException for empty value instead.