bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/30061] Comparator interface arguments get reversed


From: csm at gnu dot org
Subject: [Bug classpath/30061] Comparator interface arguments get reversed
Date: 6 Dec 2006 21:28:08 -0000


------- Comment #7 from csm at gnu dot org  2006-12-06 21:28 -------
Also, if I change your compare function to (note what it returns if o2 is
null):

  public int compare(Object o1, Object o2) {                                    
    if (o1 == null ) return 1 ; // null is greater                              
    // in this context                                                          
    if (o2 == null ) return -1 ; // or else IKVM/GNU                            
    // claaspath will fail                                                      
    String s1 = (String) o1 ;                                                   
    String s2 = (String) o2 ;                                                   
    return s1.compareTo(s2);                                                    
  }

I get the same output on jamvm+Classpath as I do on Sun java.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30061





reply via email to

[Prev in Thread] Current Thread [Next in Thread]