View Javadoc
1   package com.puppycrawl.tools.checkstyle.api.fullident;
2   
3   import java.lang.reflect.InvocationTargetException;
4   import java.util.List;
5   
6   import javax.annotation.Nullable;
7   
8   import org.junit.Assert;
9   
10  import com.google.common.reflect.Invokable;
11  
12  public class InputFullIdentReturnNoAnnotation {
13      private static <T> @Nullable T invoke(Invokable<?, ? extends T> factory, List<?> args)
14                  throws InvocationTargetException, IllegalAccessException {
15              T returnValue = factory.invoke(null, args.toArray());
16              if (returnValue == null) {
17                  Assert.assertTrue(
18                          Boolean.parseBoolean(factory
19                                  + " returns null but it's not annotated with @Nullable"));
20              }
21              return returnValue;
22          }
23  }