public void resolve(ClassScope upperScope) { if (this.binding == null) { this.ignoreFurtherInvestigation = true; } try { bindArguments(); resolveReceiver(); bindThrownExceptions(); resolveJavadoc(); resolveAnnotations(this.scope, this.annotations, this.binding, this.isConstructor()); long sourceLevel = this.scope.compilerOptions().sourceLevel; if (sourceLevel < ClassFileConstants.JDK1_8) // otherwise already checked via Argument.createBinding validateNullAnnotations(this.scope.environment().usesNullTypeAnnotations()); resolveStatements(); // check @Deprecated annotation presence if (this.binding != null && (this.binding.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0 && (this.binding.modifiers & ClassFileConstants.AccDeprecated) != 0 && sourceLevel >= ClassFileConstants.JDK1_5) { this.scope.problemReporter().missingDeprecatedAnnotationForMethod(this); } } catch (AbortMethod e) { // ========= abort on fatal error ============= this.ignoreFurtherInvestigation = true; } }
@Override public boolean hasTypeParameters() { TypeParameter[] typeParams = m_astNode.typeParameters(); return typeParams != null && typeParams.length > 0; }
public StringBuffer printBody(int indent, StringBuffer output) { if (isAbstract() || (this.modifiers & ExtraCompilerModifiers.AccSemicolonBody) != 0) return output.append(';'); output.append(" {"); //$NON-NLS-1$ if (this.statements != null) { for (int i = 0; i < this.statements.length; i++) { output.append('\n'); this.statements[i].printStatement(indent, output); } } output.append('\n'); printIndent(indent == 0 ? 0 : indent - 1, output).append('}'); return output; }
public static boolean containsIgnoredBody(AbstractMethodDeclaration method){ return !method.isDefaultConstructor() && !method.isClinit() && (method.modifiers & ExtraCompilerModifiers.AccSemicolonBody) == 0; } }
public void resolve(ClassScope upperScope) { if (this.binding == null) { this.ignoreFurtherInvestigation = true; } try { bindArguments(); resolveReceiver(); bindThrownExceptions(); resolveJavadoc(); resolveAnnotations(this.scope, this.annotations, this.binding); long sourceLevel = this.scope.compilerOptions().sourceLevel; validateNullAnnotations(sourceLevel); resolveStatements(); // check @Deprecated annotation presence if (this.binding != null && (this.binding.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0 && (this.binding.modifiers & ClassFileConstants.AccDeprecated) != 0 && sourceLevel >= ClassFileConstants.JDK1_5) { this.scope.problemReporter().missingDeprecatedAnnotationForMethod(this); } } catch (AbortMethod e) { // ========= abort on fatal error ============= this.ignoreFurtherInvestigation = true; } }
this.javadoc.print(tab, output); printIndent(tab, output); printModifiers(this.modifiers, output); if (this.annotations != null) printAnnotations(this.annotations, output); TypeParameter[] typeParams = typeParameters(); if (typeParams != null) { output.append('<'); printReturnType(0, output).append(this.selector).append('('); if (this.arguments != null) { for (int i = 0; i < this.arguments.length; i++) { printBody(tab + 1, output); return output;
@Override public boolean isConstructor() { return m_astNode.isConstructor(); }
private void format( AbstractMethodDeclaration methodDeclaration, ClassScope scope, boolean isChunkStart, boolean isFirstClassBodyDeclaration) { if (isFirstClassBodyDeclaration) { int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration; if (newLinesBeforeFirstClassBodyDeclaration > 0) { this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration); } } else { final int newLineBeforeChunk = isChunkStart ? this.preferences.blank_lines_before_new_chunk : 0; if (newLineBeforeChunk > 0) { this.scribe.printEmptyLines(newLineBeforeChunk); } } final int newLinesBeforeMethod = this.preferences.blank_lines_before_method; if (newLinesBeforeMethod > 0 && !isFirstClassBodyDeclaration) { this.scribe.printEmptyLines(newLinesBeforeMethod); } else if (this.scribe.line != 0 || this.scribe.column != 1) { this.scribe.printNewLine(); } methodDeclaration.traverse(this, scope); }
public void abstractMethodNeedingNoBody(AbstractMethodDeclaration method) { this.handle( IProblem.BodyForAbstractMethod, NoArgument, NoArgument, method.sourceStart, method.sourceEnd, method, method.compilationResult()); } public void alreadyDefinedLabel(char[] labelName, ASTNode location) {
attributeNumber++; } else { checkArgumentsSize();
method.abort(ProblemSeverities.AbortType, null);
this.javadoc.print(tab, output); printIndent(tab, output); printModifiers(this.modifiers, output); if (this.annotations != null) printAnnotations(this.annotations, output); TypeParameter[] typeParams = typeParameters(); if (typeParams != null) { output.append('<'); printReturnType(0, output).append(this.selector).append('('); if (this.arguments != null) { for (int i = 0; i < this.arguments.length; i++) { printBody(tab + 1, output); return output;
public static boolean containsIgnoredBody(AbstractMethodDeclaration method){ return !method.isDefaultConstructor() && !method.isClinit() && (method.modifiers & ExtraCompilerModifiers.AccSemicolonBody) == 0; } }
@Override public boolean isConstructor() { return mDeclaration.isConstructor(); }
private void format( AbstractMethodDeclaration methodDeclaration, ClassScope scope, boolean isChunkStart, boolean isFirstClassBodyDeclaration) { if (isFirstClassBodyDeclaration) { int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration; if (newLinesBeforeFirstClassBodyDeclaration > 0) { this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration); } } else { final int newLineBeforeChunk = isChunkStart ? this.preferences.blank_lines_before_new_chunk : 0; if (newLineBeforeChunk > 0) { this.scribe.printEmptyLines(newLineBeforeChunk); } } final int newLinesBeforeMethod = this.preferences.blank_lines_before_method; if (newLinesBeforeMethod > 0 && !isFirstClassBodyDeclaration) { this.scribe.printEmptyLines(newLinesBeforeMethod); } else if (this.scribe.line != 0 || this.scribe.column != 1) { this.scribe.printNewLine(); } methodDeclaration.traverse(this, scope); }
public void abstractMethodNeedingNoBody(AbstractMethodDeclaration method) { this.handle( IProblem.BodyForAbstractMethod, NoArgument, NoArgument, method.sourceStart, method.sourceEnd, method, method.compilationResult()); } public void alreadyDefinedLabel(char[] labelName, ASTNode location) {
method.abort(ProblemSeverities.AbortType, null);
public void resolve(ClassScope upperScope) { if (this.binding == null) { this.ignoreFurtherInvestigation = true; } try { bindArguments(); resolveReceiver(); bindThrownExceptions(); resolveJavadoc(); resolveAnnotations(this.scope, this.annotations, this.binding); long sourceLevel = this.scope.compilerOptions().sourceLevel; validateNullAnnotations(sourceLevel); resolveStatements(); // check @Deprecated annotation presence if (this.binding != null && (this.binding.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0 && (this.binding.modifiers & ClassFileConstants.AccDeprecated) != 0 && sourceLevel >= ClassFileConstants.JDK1_5) { this.scope.problemReporter().missingDeprecatedAnnotationForMethod(this); } } catch (AbortMethod e) { // ========= abort on fatal error ============= this.ignoreFurtherInvestigation = true; } }
this.javadoc.print(tab, output); printIndent(tab, output); printModifiers(this.modifiers, output); if (this.annotations != null) printAnnotations(this.annotations, output); TypeParameter[] typeParams = typeParameters(); if (typeParams != null) { output.append('<'); printReturnType(0, output).append(this.selector).append('('); if (this.arguments != null) { for (int i = 0; i < this.arguments.length; i++) { printBody(tab + 1, output); return output;