issue 1069: Allowing @Nullable container to be null in compareTo

This commit is contained in:
Andrew Phillips 2012-09-14 12:30:44 -04:00
parent 887d4d1de8
commit 2984626b9c
1 changed files with 2 additions and 1 deletions

View File

@ -33,6 +33,7 @@ import org.jclouds.openstack.swift.domain.ObjectInfo;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper; import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ComparisonChain; import com.google.common.collect.ComparisonChain;
import com.google.common.collect.Ordering;
/** /**
* Class ObjectInfoImpl * Class ObjectInfoImpl
@ -243,6 +244,6 @@ public class ObjectInfoImpl implements ObjectInfo {
@Override @Override
public int compareTo(ObjectInfo other) { public int compareTo(ObjectInfo other) {
return ComparisonChain.start().compare(name, other.getName()).compare(container, other.getContainer()).result(); return ComparisonChain.start().compare(name, other.getName()).compare(container, other.getContainer(), Ordering.natural().nullsLast()).result();
} }
} }