[jbosstools-issues] [JBoss JIRA] (JBIDE-22119) Improve treatment of missing/invalid date in timestamp comparator

Viacheslav Kabanovich (JIRA) issues at jboss.org
Wed Apr 6 01:06:00 EDT 2016


Viacheslav Kabanovich created JBIDE-22119:
---------------------------------------------

             Summary: 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.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jbosstools-issues mailing list