Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-22119

Improve treatment of missing/invalid date in timestamp comparator

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 4.4.0.Alpha1
    • 4.3.1.CR1
    • openshift
    • None

      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.

            scabanovich Viacheslav Kabanovich (Inactive)
            scabanovich Viacheslav Kabanovich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: