With type annotations, annotations can be written in more places, such as generic type arguments like List<@Nullable String>. This enhances error detection by static analysis tools, which will strengthen and refine Java's built-in type system.
- AnnotatedArrayType
- AnnotatedElement.getAnnotationsByType(Class)
- AnnotatedElement.getDeclaredAnnotation(Class)
- AnnotatedElement.getDeclaredAnnotationsByType(Class)
- AnnotatedParameterizedType
- AnnotatedType
- AnnotatedTypeVariable
- AnnotatedWildcardType
- Class.getAnnotatedInterfaces()
- Class.getAnnotatedSuperclass()
- Class.getTypeName()
- Class.toGenericString()
- Executable
- Field.getAnnotatedType()
- Method.isDefault()
- Modifier.parameterModifiers()
- Parameter - with parameter.getName(), etc.
- Native
- Repeatable
- Type.getTypeName()
- TypeVariable.getAnnotatedBounds()
Annotations are allowed in more places,
e.g. List<@Nullable String>. The biggest impact of this is likely
to be for static analysis tools such as Sonar and FindBugs.
No comments:
Post a Comment