Mark freshly supported annotations to use that mark for reporting corresponding warnings

This commit is contained in:
Victor Petukhov
2020-12-11 17:29:12 +03:00
parent 9693ea19fb
commit d6017420de
5 changed files with 21 additions and 9 deletions
@@ -94,4 +94,9 @@ public class JavaAnnotationImpl extends JavaElementImpl<PsiAnnotation> implement
ExternalAnnotationsManager externalAnnotationManager = ExternalAnnotationsManager.getInstance(psi.getProject());
return externalAnnotationManager.isExternalAnnotation(psi);
}
@Override
public boolean isFreshlySupportedTypeUseAnnotation() {
return false;
}
}
@@ -96,13 +96,13 @@ class BinaryJavaClass(
val baseType: JavaType = if (typeReference.superTypeIndex == -1) superclass!! else interfaces[typeReference.superTypeIndex]
val targetType = BinaryJavaAnnotation.computeTargetType(baseType, translatedPath)
return BinaryJavaAnnotation.addAnnotation(targetType as JavaPlainType, descriptor, context, signatureParser)
return BinaryJavaAnnotation.addAnnotation(targetType as JavaPlainType, descriptor, context, signatureParser, true)
}
TypeReference.CLASS_TYPE_PARAMETER_BOUND -> {
val baseType = computeTypeParameterBound(typeParameters, typeReference)
val targetType = BinaryJavaAnnotation.computeTargetType(baseType, translatedPath)
return BinaryJavaAnnotation.addAnnotation(targetType as JavaPlainType, descriptor, context, signatureParser)
return BinaryJavaAnnotation.addAnnotation(targetType as JavaPlainType, descriptor, context, signatureParser, true)
}
}
}
@@ -110,11 +110,11 @@ class BinaryJavaClass(
return when (typeReference.sort) {
TypeReference.CLASS_TYPE_PARAMETER ->
BinaryJavaAnnotation.addAnnotation(
typeParameters[typeReference.typeParameterIndex] as BinaryJavaTypeParameter, descriptor, context, signatureParser
typeParameters[typeReference.typeParameterIndex] as BinaryJavaTypeParameter, descriptor, context, signatureParser, true
)
TypeReference.CLASS_TYPE_PARAMETER_BOUND ->
BinaryJavaAnnotation.addAnnotation(
computeTypeParameterBound(typeParameters, typeReference) as JavaPlainType, descriptor, context, signatureParser
computeTypeParameterBound(typeParameters, typeReference) as JavaPlainType, descriptor, context, signatureParser, true
)
else -> null
}