mirror of https://github.com/apache/jclouds.git
issue 1069: Allowing @Nullable container to be null in compareTo
This commit is contained in:
parent
887d4d1de8
commit
2984626b9c
|
@ -33,6 +33,7 @@ import org.jclouds.openstack.swift.domain.ObjectInfo;
|
|||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Objects.ToStringHelper;
|
||||
import com.google.common.collect.ComparisonChain;
|
||||
import com.google.common.collect.Ordering;
|
||||
|
||||
/**
|
||||
* Class ObjectInfoImpl
|
||||
|
@ -243,6 +244,6 @@ public class ObjectInfoImpl implements ObjectInfo {
|
|||
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue