Package org.eclipse.jdt.internal.compiler.ast

Examples of org.eclipse.jdt.internal.compiler.ast.MethodDeclaration


  boolean inCycle = false; // check each method before failing
  for (int i = 0, l = currentMethods.length; i < l; i++) {
    TypeBinding returnType = currentMethods[i].returnType.leafComponentType().erasure();
    if (this == returnType) {
      if (this instanceof SourceTypeBinding) {
        MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod();
        ((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, this, decl != null ? decl.returnType : null);
      }
    } else if (returnType.isAnnotationType() && ((ReferenceBinding) returnType).detectAnnotationCycle()) {
      if (this instanceof SourceTypeBinding) {
        MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod();
        ((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, returnType, decl != null ? decl.returnType : null);
      }
      inCycle = true;
    }
  }
View Full Code Here


    if (methodDeclarations != null) {
      TypeDeclaration currentDeclaration = this.referenceBinding.scope.referenceContext;
      int typeDeclarationSourceStart = currentDeclaration.sourceStart();
      int typeDeclarationSourceEnd = currentDeclaration.sourceEnd();
      for (int i = 0, max = methodDeclarations.length; i < max; i++) {
        MethodDeclaration methodDeclaration = methodDeclarations[i];
        MethodBinding methodBinding = methodDeclaration.binding;
         String readableName = new String(methodBinding.readableName());
         CategorizedProblem[] problems = compilationResult.problems;
         int problemsCount = compilationResult.problemCount;
        for (int j = 0; j < problemsCount; j++) {
View Full Code Here

    if (methodDeclarations != null) {
      TypeDeclaration currentDeclaration = this.referenceBinding.scope.referenceContext;
      int typeDeclarationSourceStart = currentDeclaration.sourceStart();
      int typeDeclarationSourceEnd = currentDeclaration.sourceEnd();
      for (int i = 0, max = methodDeclarations.length; i < max; i++) {
        MethodDeclaration methodDeclaration = methodDeclarations[i];
        MethodBinding methodBinding = methodDeclaration.binding;
         String readableName = new String(methodBinding.readableName());
         CategorizedProblem[] problems = compilationResult.problems;
         int problemsCount = compilationResult.problemCount;
        for (int j = 0; j < problemsCount; j++) {
View Full Code Here

    new String[] { new String(argument.name), new String(declaringClass.shortReadableName()), new String(inheritedAnnotationName[inheritedAnnotationName.length-1])},
    argument.type.sourceStart,
    argument.type.sourceEnd);
}
public void illegalReturnRedefinition(AbstractMethodDeclaration abstractMethodDecl, MethodBinding inheritedMethod, char[][] nonNullAnnotationName) {
  MethodDeclaration methodDecl = (MethodDeclaration) abstractMethodDecl;
  StringBuffer methodSignature = new StringBuffer();
  methodSignature
    .append(inheritedMethod.declaringClass.readableName())
    .append('.')
    .append(inheritedMethod.readableName());
View Full Code Here

}

public void nullAnnotationIsRedundant(AbstractMethodDeclaration sourceMethod, int i) {
  int sourceStart, sourceEnd;
  if (i == -1) {
    MethodDeclaration methodDecl = (MethodDeclaration) sourceMethod;
    Annotation annotation = findAnnotation(methodDecl.annotations, TypeIds.T_ConfiguredAnnotationNonNull);
    sourceStart = annotation != null ? annotation.sourceStart : methodDecl.returnType.sourceStart;
    sourceEnd = methodDecl.returnType.sourceEnd;
  } else {
    Argument arg = sourceMethod.arguments[i];
View Full Code Here

  boolean inCycle = false; // check each method before failing
  for (int i = 0, l = currentMethods.length; i < l; i++) {
    TypeBinding returnType = currentMethods[i].returnType.leafComponentType().erasure();
    if (this == returnType) {
      if (this instanceof SourceTypeBinding) {
        MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod();
        ((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, this, decl != null ? decl.returnType : null);
      }
    } else if (returnType.isAnnotationType() && ((ReferenceBinding) returnType).detectAnnotationCycle()) {
      if (this instanceof SourceTypeBinding) {
        MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod();
        ((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, returnType, decl != null ? decl.returnType : null);
      }
      inCycle = true;
    }
  }
View Full Code Here

  boolean inCycle = false; // check each method before failing
  for (int i = 0, l = currentMethods.length; i < l; i++) {
    TypeBinding returnType = currentMethods[i].returnType.leafComponentType().erasure();
    if (TypeBinding.equalsEquals(this, returnType)) {
      if (this instanceof SourceTypeBinding) {
        MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod();
        ((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, this, decl != null ? decl.returnType : null);
      }
    } else if (returnType.isAnnotationType() && ((ReferenceBinding) returnType).detectAnnotationCycle()) {
      if (this instanceof SourceTypeBinding) {
        MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod();
        ((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, returnType, decl != null ? decl.returnType : null);
      }
      inCycle = true;
    }
  }
View Full Code Here

    new String[] { new String(declaringClass.shortReadableName()), new String(inheritedAnnotationName[inheritedAnnotationName.length-1])},
    sourceStart,
    sourceEnd);
}
public void illegalReturnRedefinition(AbstractMethodDeclaration abstractMethodDecl, MethodBinding inheritedMethod, char[][] nonNullAnnotationName) {
  MethodDeclaration methodDecl = (MethodDeclaration) abstractMethodDecl;
  StringBuffer methodSignature = new StringBuffer();
  methodSignature
    .append(inheritedMethod.declaringClass.readableName())
    .append('.')
    .append(inheritedMethod.readableName());
View Full Code Here

}

public void nullAnnotationIsRedundant(AbstractMethodDeclaration sourceMethod, int i) {
  int sourceStart, sourceEnd;
  if (i == -1) {
    MethodDeclaration methodDecl = (MethodDeclaration) sourceMethod;
    Annotation annotation = findAnnotation(methodDecl.annotations, TypeIds.T_ConfiguredAnnotationNonNull);
    sourceStart = annotation != null ? annotation.sourceStart : methodDecl.returnType.sourceStart;
    sourceEnd = methodDecl.returnType.sourceEnd;
  } else {
    Argument arg = sourceMethod.arguments[i];
View Full Code Here

        // node is an AnnotationMethodDeclaration
        AnnotationMethodDeclaration typeMemberDeclaration = (AnnotationMethodDeclaration) node;
        return (JavaElement) declaringType.getMethod(String.valueOf(typeMemberDeclaration.selector), CharOperation.NO_STRINGS); // annotation type members don't have parameters
      } else {
        // node is an MethodDeclaration
        MethodDeclaration methodDeclaration = (MethodDeclaration) node;

        Argument[] arguments = methodDeclaration.arguments;
        String[] parameterSignatures;
        if (arguments != null) {
          parameterSignatures = new String[arguments.length];
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.ast.MethodDeclaration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.