NullAwayNativeModels.java 文件源码

java
阅读 45 收藏 0 点赞 0 评论 0

项目:NullAway 作者:
static void guavaStuff() {
  Collection<String> c = null;
  Object o = null;
  // BUG: Diagnostic contains: passing @Nullable parameter 'c' where @NonNull is required
  ImmutableList.builder().addAll(c).build();
  // BUG: Diagnostic contains: passing @Nullable parameter 'o' where @NonNull is required
  ImmutableList.builder().add(o).build();
  // BUG: Diagnostic contains: passing @Nullable parameter 'c' where @NonNull is required
  ImmutableSet.builder().addAll(c).build();
  // BUG: Diagnostic contains: passing @Nullable parameter 'o' where @NonNull is required
  ImmutableSet.builder().add(o).build();
  // BUG: Diagnostic contains: passing @Nullable parameter 'c' where @NonNull is required
  ImmutableSortedSet.builder().addAll(c).build();
  // BUG: Diagnostic contains: passing @Nullable parameter 'o' where @NonNull is required
  ImmutableSortedSet.builder().add(o).build();
  // BUG: Diagnostic contains: passing @Nullable parameter 'c' where @NonNull is required
  Iterables.getFirst(c, "hi");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号