< prev index next >
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java
Print this page
*** 422,432 ****
* @param env the current env in where the annotation instance is found
*/
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);
--- 422,432 ----
* @param env the current env in where the annotation instance is found
*/
public Attribute.Compound attributeAnnotation(JCAnnotation tree, Type expectedAnnotationType,
Env<AttrContext> env)
{
! // The attribute might have been entered if it is Target or Repeatable
// 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);
*** 443,453 ****
* @param env the the current env in where the annotation instance is found
*/
public Attribute.TypeCompound attributeTypeAnnotation(JCAnnotation a, 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 (a.attribute == null || a.type == null || !(a.attribute instanceof Attribute.TypeCompound)) {
// Create a new TypeCompound
List<Pair<MethodSymbol,Attribute>> elems =
attributeAnnotationValues(a, expectedAnnotationType, env);
--- 443,453 ----
* @param env the the current env in where the annotation instance is found
*/
public Attribute.TypeCompound attributeTypeAnnotation(JCAnnotation a, Type expectedAnnotationType,
Env<AttrContext> env)
{
! // The attribute might have been entered if it is Target or Repeatable
// Because TreeCopier does not copy type, redo this if type is null
if (a.attribute == null || a.type == null || !(a.attribute instanceof Attribute.TypeCompound)) {
// Create a new TypeCompound
List<Pair<MethodSymbol,Attribute>> elems =
attributeAnnotationValues(a, expectedAnnotationType, env);
*** 538,548 ****
/** Attribute an annotation element value */
private Attribute attributeAnnotationValue(Type expectedElementType, JCExpression tree,
Env<AttrContext> env)
{
! //first, try completing the symbol for the annotation value - if acompletion
//error is thrown, we should recover gracefully, and display an
//ordinary resolution diagnostic.
try {
expectedElementType.tsym.complete();
} catch(CompletionFailure e) {
--- 538,548 ----
/** Attribute an annotation element value */
private Attribute attributeAnnotationValue(Type expectedElementType, JCExpression tree,
Env<AttrContext> env)
{
! //first, try completing the symbol for the annotation value - if a completion
//error is thrown, we should recover gracefully, and display an
//ordinary resolution diagnostic.
try {
expectedElementType.tsym.complete();
} catch(CompletionFailure e) {
*** 1125,1135 ****
}
}
@Override
public void visitBindingPattern(JCTree.JCBindingPattern tree) {
! //type binding pattern's type will be annotated separatelly, avoid
//adding its annotations into the owning method here (would clash
//with repeatable annotations).
}
@Override
--- 1125,1135 ----
}
}
@Override
public void visitBindingPattern(JCTree.JCBindingPattern tree) {
! //type binding pattern's type will be annotated separately, avoid
//adding its annotations into the owning method here (would clash
//with repeatable annotations).
}
@Override
*** 1162,1172 ****
Annotate.this.attributeAnnotationType(context);
}
};
/* Last stage completer to enter just enough annotations to have a prototype annotation type.
! * This currently means entering @Target and @Repetable.
*/
public AnnotationTypeCompleter annotationTypeSourceCompleter() {
return theSourceCompleter;
}
--- 1162,1172 ----
Annotate.this.attributeAnnotationType(context);
}
};
/* Last stage completer to enter just enough annotations to have a prototype annotation type.
! * This currently means entering @Target and @Repeatable.
*/
public AnnotationTypeCompleter annotationTypeSourceCompleter() {
return theSourceCompleter;
}
< prev index next >