use of org.checkerframework.checker.signature.qual.BinaryName in project checker-framework by typetools.
the class WholeProgramInferenceJavaParserStorage method getFieldAnnotations.
@Override
public AnnotatedTypeMirror getFieldAnnotations(Element element, String fieldName, AnnotatedTypeMirror lhsATM, AnnotatedTypeFactory atypeFactory) {
ClassSymbol enclosingClass = ((VarSymbol) element).enclClass();
// Read in classes for the element.
getFileForElement(element);
// https://tinyurl.com/cfissue/3094
@SuppressWarnings("signature") @BinaryName String className = enclosingClass.flatname.toString();
ClassOrInterfaceAnnos classAnnos = classToAnnos.get(className);
// and it won't have extra annotations, so just return the basic type:
if (classAnnos.enumConstants.contains(fieldName)) {
return lhsATM;
} else {
return classAnnos.fields.get(fieldName).getType(lhsATM, atypeFactory);
}
}
use of org.checkerframework.checker.signature.qual.BinaryName in project checker-framework by typetools.
the class AnnotationUtils method annotationBinaryName.
/**
* Returns the binary name of an annotation as a String.
*
* @param annotation the annotation whose binary name to return
* @return the binary name of an annotation as a String
*/
@BinaryName
public static final String annotationBinaryName(AnnotationMirror annotation) {
final DeclaredType annoType = annotation.getAnnotationType();
final TypeElement elm = (TypeElement) annoType.asElement();
return ElementUtils.getBinaryName(elm);
}
Aggregations