Add some missing annotations to Utils
@@ -288,7 +288,7 @@ final class Utils {
* Returns the declaring class of {@code typeVariable}, or {@code null} if it was not declared by
* a class.
*/
- private static Class<?> declaringClassOf(TypeVariable<?> typeVariable) {
+ private static @Nullable Class<?> declaringClassOf(TypeVariable<?> typeVariable) {
GenericDeclaration genericDeclaration = typeVariable.getGenericDeclaration();
return genericDeclaration instanceof Class ? (Class<?>) genericDeclaration : null;
}
@@ -384,7 +384,7 @@ final class Utils {
}
static final class ParameterizedTypeImpl implements ParameterizedType {
- private final Type ownerType;
+ private final @Nullable Type ownerType;
private final Type rawType;
private final Type[] typeArguments;
@@ -413,7 +413,7 @@ final class Utils {
return rawType;
}
- @Override public Type getOwnerType() {
+ @Override public @Nullable Type getOwnerType() {
return ownerType;
}
@@ -471,7 +471,7 @@ final class Utils {
*/
private static final class WildcardTypeImpl implements WildcardType {
private final Type upperBound;
- private final Type lowerBound;
+ private final @Nullable Type lowerBound;
WildcardTypeImpl(Type[] upperBounds, Type[] lowerBounds) {
if (lowerBounds.length > 1) throw new IllegalArgumentException();
