private List < Pair < MethodSymbol , Attribute > > attributeAnnotationValues ( JCAnnotation a , Type expected , Env < AttrContext > env ) { // The annotation might have had its type attributed (but not // checked) by attr.attribAnnotationTypes during MemberEnter, // in which case we do not need to do it again. Type at = ( a . annotationType . type != null ? a . annotationType . type : attr . attribType ( a . annotationType , env ) ) ; a . type = chk . checkType ( a . annotationType . pos ( ) , at , expected ) ; boolean isError = a . type . isErroneous ( ) ; if ( ! a . type . tsym . isAnnotationType ( ) && ! isError ) { log . error ( a . annotationType . pos ( ) , "not.annotation.type" , a . type . toString ( ) ) ; isError = true ; } // List of name=value pairs (or implicit "value=" if size 1) List < JCExpression > args = a . args ; boolean elidedValue = false ; // special case: elided "value=" assumed if ( args . length ( ) == 1 && ! args . head . hasTag ( ASSIGN ) ) { args . head = make . at ( args . head . pos ) . Assign ( make . Ident ( names . value ) , args . head ) ; elidedValue = true ; } ListBuffer < Pair < MethodSymbol , Attribute > > buf = new ListBuffer <> ( ) ; for ( List < JCExpression > tl = args ; tl . nonEmpty ( ) ; tl = tl . tail ) { Pair < MethodSymbol , Attribute > p = attributeAnnotationNameValuePair ( tl . head , a . type , isError , env , elidedValue ) ; if ( p != null && ! p . fst . type . isErroneous ( ) ) buf . append ( p ) ; } return buf . toList ( ) ; }
Attribute annotation elements creating a list of pairs of the Symbol representing that element and the value of that element as an Attribute .