I want construct `ImmutableSortedSet`. I wrote code smt like:
Set obj = new HashSet();
Comparator myComparator = new Comparator(){
@Override
public int compare(String o1, String o2) {
return 0;
}
};
Set ordered = ImmutableSortedSet.copyOf(obj)
.orderedBy(myComparator).build();
but it generates warning:
> The static method
> orderedBy(Comparator) from the
> type ImmutableSortedSet should
> be accessed in a static way
How can I remove this warning without `@SuppressWarnings("static-access")`? Thanks. Yikes! Does anyone know, do both javac and eclipse give that warning? (Please say yes.)
以上就是Construct ImmutableSortedSet without warnings的详细内容,更多请关注web前端其它相关文章!