protected void consumeSingleMemberAnnotation() { // SingleMemberAnnotation ::= '@' Name '(' MemberValue ')' SingleMemberAnnotation singleMemberAnnotation = null; int oldIndex = this.identifierPtr; TypeReference typeReference = getAnnotationType(); singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--; singleMemberAnnotation.declarationSourceEnd = this.rParenPos; pushOnExpressionStack(singleMemberAnnotation); if(this.currentElement != null) { annotationRecoveryCheckPoint(singleMemberAnnotation.sourceStart, singleMemberAnnotation.declarationSourceEnd); if (this.currentElement instanceof RecoveredAnnotation) { this.currentElement = ((RecoveredAnnotation)this.currentElement).addAnnotation(singleMemberAnnotation, oldIndex); } } if(!this.statementRecoveryActivated && this.options.sourceLevel < ClassFileConstants.JDK1_5 && this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) { problemReporter().invalidUsageOfAnnotation(singleMemberAnnotation); } this.recordStringLiterals = true; } protected void consumeSingleMemberAnnotationMemberValue() {
protected void consumeSingleMemberAnnotation() { // SingleMemberAnnotation ::= '@' Name '(' MemberValue ')' SingleMemberAnnotation singleMemberAnnotation = null; int oldIndex = this.identifierPtr; TypeReference typeReference = getAnnotationType(); singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--; singleMemberAnnotation.declarationSourceEnd = this.rParenPos; pushOnExpressionStack(singleMemberAnnotation); if(this.currentElement != null) { annotationRecoveryCheckPoint(singleMemberAnnotation.sourceStart, singleMemberAnnotation.declarationSourceEnd); if (this.currentElement instanceof RecoveredAnnotation) { this.currentElement = ((RecoveredAnnotation)this.currentElement).addAnnotation(singleMemberAnnotation, oldIndex); } } if(!this.statementRecoveryActivated && this.options.sourceLevel < ClassFileConstants.JDK1_5 && this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) { problemReporter().invalidUsageOfAnnotation(singleMemberAnnotation); } this.recordStringLiterals = true; } protected void consumeSingleMemberAnnotationMemberValue() {
protected void consumeSingleMemberAnnotation() { // SingleMemberAnnotation ::= '@' Name '(' MemberValue ')' SingleMemberAnnotation singleMemberAnnotation = null; int oldIndex = this.identifierPtr; TypeReference typeReference = getAnnotationType(); singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--; singleMemberAnnotation.declarationSourceEnd = this.rParenPos; pushOnExpressionStack(singleMemberAnnotation); if(this.currentElement != null) { annotationRecoveryCheckPoint(singleMemberAnnotation.sourceStart, singleMemberAnnotation.declarationSourceEnd); if (this.currentElement instanceof RecoveredAnnotation) { this.currentElement = ((RecoveredAnnotation)this.currentElement).addAnnotation(singleMemberAnnotation, oldIndex); } } if(!this.statementRecoveryActivated && this.options.sourceLevel < ClassFileConstants.JDK1_5 && this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) { problemReporter().invalidUsageOfAnnotation(singleMemberAnnotation); } this.recordStringLiterals = true; } protected void consumeSingleMemberAnnotationMemberValue() {
this.lastCheckPoint = typeReference.sourceEnd + 1; singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
this.lastCheckPoint = typeReference.sourceEnd + 1; singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
this.lastCheckPoint = typeReference.sourceEnd + 1; singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
this.lastCheckPoint = typeReference.sourceEnd + 1; singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
this.lastCheckPoint = typeReference.sourceEnd + 1; singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
this.lastCheckPoint = typeReference.sourceEnd + 1; singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]); singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr--;
@Override public boolean visitAnnotation(lombok.ast.Annotation node) { //TODO add test where the value is the result of string concatenation TypeReference type = (TypeReference) toTree(node.astAnnotationTypeReference()); boolean isEcjNormal = Position.UNPLACED == getConversionPositionInfo(node, "isNormalAnnotation"); if (node.astElements().isEmpty() && countStructure(node, "(") == 0 && !isEcjNormal) { MarkerAnnotation ann = new MarkerAnnotation(type, start(node)); ann.declarationSourceEnd = end(node); return set(node, ann); } MemberValuePair[] values = toArray(MemberValuePair.class, node.astElements()); if (values != null && (values.length == 1 && values[0].name == null)) { SingleMemberAnnotation ann = new SingleMemberAnnotation(type, start(node)); ann.declarationSourceEnd = end(node); ann.memberValue = values[0].value; return set(node, ann); } NormalAnnotation ann = new NormalAnnotation(type, start(node)); ann.declarationSourceEnd = end(node); ann.memberValuePairs = values; return set(node, ann); }
@Override public boolean visitAnnotation(lombok.ast.Annotation node) { //TODO add test where the value is the result of string concatenation TypeReference type = (TypeReference) toTree(node.astAnnotationTypeReference()); boolean isEcjNormal = Position.UNPLACED == getConversionPositionInfo(node, "isNormalAnnotation"); if (node.astElements().isEmpty() && countStructure(node, "(") == 0 && !isEcjNormal) { MarkerAnnotation ann = new MarkerAnnotation(type, start(node)); ann.declarationSourceEnd = end(node); return set(node, ann); } MemberValuePair[] values = toArray(MemberValuePair.class, node.astElements()); if (values != null && (values.length == 1 && values[0].name == null)) { SingleMemberAnnotation ann = new SingleMemberAnnotation(type, start(node)); ann.declarationSourceEnd = end(node); ann.memberValue = values[0].value; return set(node, ann); } NormalAnnotation ann = new NormalAnnotation(type, start(node)); ann.declarationSourceEnd = end(node); ann.memberValuePairs = values; return set(node, ann); }
@Override public boolean visitAnnotation(lombok.ast.Annotation node) { //TODO add test where the value is the result of string concatenation TypeReference type = (TypeReference) toTree(node.astAnnotationTypeReference()); boolean isEcjNormal = Position.UNPLACED == getConversionPositionInfo(node, "isNormalAnnotation"); if (node.astElements().isEmpty() && countStructure(node, "(") == 0 && !isEcjNormal) { MarkerAnnotation ann = new MarkerAnnotation(type, start(node)); ann.declarationSourceEnd = end(node); return set(node, ann); } MemberValuePair[] values = toArray(MemberValuePair.class, node.astElements()); if (values != null && (values.length == 1 && values[0].name == null)) { SingleMemberAnnotation ann = new SingleMemberAnnotation(type, start(node)); ann.declarationSourceEnd = end(node); ann.memberValue = values[0].value; return set(node, ann); } NormalAnnotation ann = new NormalAnnotation(type, start(node)); ann.declarationSourceEnd = end(node); ann.memberValuePairs = values; return set(node, ann); }