Construct ImmutableSortedSet without warnings

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前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准