code: public Attribute.Compound attributeAnnotation(JCAnnotation tree, Type expectedAnnotationType,
                                                    Env<AttrContext> env)
      {
          // The attribute might have been entered if it is Target or Repetable
          // Because TreeCopier does not copy type, redo this if type is null
          if (tree.attribute != null && tree.type != null)
              return tree.attribute;
  
          List<Pair<MethodSymbol, Attribute>> elems = attributeAnnotationValues(tree, expectedAnnotationType, env);
          Attribute.Compound ac = new Attribute.Compound(tree.type, elems);
  
          return tree.attribute = ac;
      }
docs: Attribute and store a semantic representation of the annotation tree {@code tree} into the
  tree.attribute field.
  
  @param tree the tree representing an annotation
  @param expectedAnnotationType the expected (super)type of the annotation
  @param env the current env in where the annotation instance is found