예제 #1
0
 void testArr1b(@Nullable Object @Nullable [] a) {
   // one way to use as a cast:
   @NonNull Object[] l2 = NullnessUtil.castNonNullDeep(a);
   // Careful, the non-deep version only casts the main modifier.
   // :: error: (assignment.type.incompatible)
   @NonNull Object[] l2b = NullnessUtil.castNonNull(a);
   // OK
   @Nullable Object[] l2c = NullnessUtil.castNonNull(a);
 }
예제 #2
0
 void testRef1(@Nullable Object o) {
   // one way to use as a cast:
   @NonNull Object l1 = NullnessUtil.castNonNull(o);
 }
예제 #3
0
 void testRef3(@Nullable Object o) {
   // use as statement:
   NullnessUtil.castNonNull(o);
   o.toString();
 }
예제 #4
0
 void testRef2(@Nullable Object o) {
   // another way to use as a cast:
   NullnessUtil.castNonNull(o).toString();
 }