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

Marián Labuda (JIRA) issues at jboss.org
Mon Apr 25 07:52:00 EDT 2016


     [ https://issues.jboss.org/browse/JBIDE-22119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marián Labuda closed JBIDE-22119.
---------------------------------


> 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