1 11 package org.eclipse.jdt.internal.compiler.ast; 12 13 import org.eclipse.jdt.internal.compiler.ASTVisitor; 14 import org.eclipse.jdt.internal.compiler.lookup.*; 15 16 17 public class JavadocReturnStatement extends ReturnStatement { 18 19 public JavadocReturnStatement(int s, int e) { 20 super(null, s, e); 21 this.bits |= (ASTNode.InsideJavadoc | ASTNode.Empty); 22 } 23 24 27 public void resolve(BlockScope scope) { 28 MethodScope methodScope = scope.methodScope(); 29 MethodBinding methodBinding = null; 30 TypeBinding methodType = 31 (methodScope.referenceContext instanceof AbstractMethodDeclaration) 32 ? ((methodBinding = ((AbstractMethodDeclaration) methodScope.referenceContext).binding) == null 33 ? null 34 : methodBinding.returnType) 35 : TypeBinding.VOID; 36 if (methodType == null || methodType == TypeBinding.VOID) { 37 scope.problemReporter().javadocUnexpectedTag(this.sourceStart, this.sourceEnd); 38 } else if ((this.bits & ASTNode.Empty) != 0) { 39 scope.problemReporter().javadocEmptyReturnTag(this.sourceStart, this.sourceEnd, scope.getDeclarationModifiers()); 40 } 41 } 42 43 46 public StringBuffer printStatement(int tab, StringBuffer output) { 47 printIndent(tab, output).append("return"); if ((this.bits & ASTNode.Empty) == 0) 49 output.append(' ').append(" <not empty>"); return output; 51 } 52 53 57 public void traverse(ASTVisitor visitor, BlockScope scope) { 58 visitor.visit(this, scope); 59 visitor.endVisit(this, scope); 60 } 61 65 public void traverse(ASTVisitor visitor, ClassScope scope) { 66 visitor.visit(this, scope); 67 visitor.endVisit(this, scope); 68 } 69 } 70 | Popular Tags |