Re: [classlib][luni] Is fully comply with Comparator.compare(T, T) necessary (Re JIRA harmony 1026)

2006-08-02 Thread Spark Shen
Alexei Zakharov 写道: > Hi Spark, > >> When both are null, -1 will be returned. This mocked comparator is used >> as a boundary test condition, and under this condition, >> if there is null entry contained in tree map, is will not be included in >> the SortedMap returned by headMap(null) method. > >

Re: [classlib][luni] Is fully comply with Comparator.compare(T, T) necessary (Re JIRA harmony 1026)

2006-08-02 Thread Alexei Zakharov
Hi Spark, When both are null, -1 will be returned. This mocked comparator is used as a boundary test condition, and under this condition, if there is null entry contained in tree map, is will not be included in the SortedMap returned by headMap(null) method. IMHO you need to be carefull here s

Re: [classlib][luni] Is fully comply with Comparator.compare(T, T) necessary (Re JIRA harmony 1026)

2006-08-02 Thread Spark Shen
Stepan Mishura 写道: > On 8/2/06, Spark Shen wrote: >> >> Richard Liang 写道: >> > >> > >> > Spark Shen wrote: >> >> I constructed a MockComparator as below: >> >> public static class MockComparator implements Comparator { >> >> public int compare(T o1, T o2) { >> >> if(null == o1) return -1; >> >> if(

Re: [classlib][luni] Is fully comply with Comparator.compare(T, T) necessary (Re JIRA harmony 1026)

2006-08-02 Thread Stepan Mishura
On 8/2/06, Spark Shen wrote: Richard Liang 写道: > > > Spark Shen wrote: >> I constructed a MockComparator as below: >> public static class MockComparator implements Comparator { >> public int compare(T o1, T o2) { >> if(null == o1) return -1; >> if(o1.equals(o2)) { >> return 0; >> } >> return 1;

Re: [classlib][luni] Is fully comply with Comparator.compare(T, T) necessary (Re JIRA harmony 1026)

2006-08-02 Thread Spark Shen
Richard Liang 写道: Spark Shen wrote: I constructed a MockComparator as below: public static class MockComparator implements Comparator { public int compare(T o1, T o2) { if(null == o1) return -1; if(o1.equals(o2)) { return 0; } return 1; } } This comparator regards null as the smallest object

Re: [classlib][luni] Is fully comply with Comparator.compare(T, T) necessary (Re JIRA harmony 1026)

2006-08-02 Thread Richard Liang
Spark Shen wrote: I constructed a MockComparator as below: public static class MockComparator implements Comparator { public int compare(T o1, T o2) { if(null == o1) return -1; if(o1.equals(o2)) { return 0; } return 1; } }

[classlib][luni] Is fully comply with Comparator.compare(T, T) necessary (Re JIRA harmony 1026)

2006-08-01 Thread Spark Shen
I constructed a MockComparator as below: public static class MockComparator implements Comparator { public int compare(T o1, T o2) { if(null == o1) return -1; if(o1.equals(o2)) { return 0; } return 1; } } This comparator reg