Cutt
2010-02-10 12:08:00 UTC
I keep getting the following error when trying to compile.
Note: my.java uses unchecked or unsafe operations;
Note: Recompile with -X1int: unchecked for details;
my class is using the following comparator method:
public static Comparator SortComparator = new Comparator ()
{
public int compare(Object customer, Object anotherCustomer)
{
String State1 = ((Customer) customer).getState().toUpperCase();
String Address1 = ((Customer) customer).getAddress().toUpperCase();
String State2 = ((Customer) anotherCustomer).getState().toUpperCase();
String Address2 = ((Customer) anotherCustomer).getAddress().toUpperCase();
if (!(State1.equals(State2)))
return State1.compareTo(State2);
else
return Address1.compareTo(Address2);
}
};
My driver that calls this method looks like this:
Arrays.sort(Data, Customer.SortComparator);
Every time I add this into my driver i get that error message.
Why and how do i fix this.
Thanks soo much