1 package com.puppycrawl.tools.checkstyle.grammar.java8; 2 3 import static java.lang.annotation.ElementType.TYPE_USE; 4 5 import java.lang.annotation.Retention; 6 import java.lang.annotation.RetentionPolicy; 7 import java.lang.annotation.Target; 8 9 10 public final class InputAnnotationsOnArray { 11 12 private InputAnnotationsOnArray() { 13 } 14 15 public static <T> T[] checkNotNullContents(T @Nullable [] array) { 16 if (array == null) { 17 throw new NullPointerException(); 18 } 19 20 return array; 21 } 22 23 public static <T> T[][] checkNotNullContents2(T @Nullable [] @Nullable [] array) { 24 if (array == null) { 25 throw new NullPointerException(); 26 } 27 28 return array; 29 } 30 } 31 32 @Retention(RetentionPolicy.CLASS) 33 @Target({ TYPE_USE }) 34 @interface Nullable { 35 }