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

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


    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


  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

        // 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

        visitList(JavaEntityType.THROW, methodDeclaration.thrownExceptions);
    }

    private void visitReturnType(AbstractMethodDeclaration abstractMethodDeclaration, ClassScope scope) {
        if (abstractMethodDeclaration instanceof MethodDeclaration) {
            MethodDeclaration methodDeclaration = (MethodDeclaration) abstractMethodDeclaration;
            if (methodDeclaration.returnType != null) {
                methodDeclaration.returnType.traverse(this, scope);
            }
        }
    }
View Full Code Here

        }
        String result = node.toString();
        // method and type declaration strings contain their javadoc
        // get rid of the javadoc
        if (node instanceof MethodDeclaration || node instanceof TypeDeclaration) {
            MethodDeclaration method = (MethodDeclaration) node;
            if (method.javadoc != null) {
              return result.replace(method.javadoc.toString(), "");
            }
        }
        return result;
View Full Code Here

    BinaryTypeBinding binaryTypeBinding = new BinaryTypeBinding(null,
        new MockBinaryType(BINARY_TYPE_NAME), lookupEnvironment);
    typeDeclaration.superclass = createMockBinaryTypeReference(binaryTypeBinding);

    MethodDeclaration methodDeclaration = new MethodDeclaration(
        compilationResult);
    methodDeclaration.scope = new MethodScope(typeDeclaration.scope, null,
        false);
    methodDeclaration.returnType = createMockBinaryTypeReference(binaryTypeBinding);
View Full Code Here

      Initializer initializer,
      ClassScope scope,
      int from,
      char[][] discouragedNames,
      UnresolvedReferenceNameRequestor nameRequestor) {
    MethodDeclaration fakeMethod =
      this.findAfter(startWith, scope, from, initializer.bodyEnd, MAX_LINE_COUNT, false, discouragedNames, nameRequestor);
    if (fakeMethod != null) fakeMethod.traverse(this, scope);
  }
View Full Code Here

      char[] startWith,
      AbstractMethodDeclaration methodDeclaration,
      int from,
      char[][] discouragedNames,
      UnresolvedReferenceNameRequestor nameRequestor) {
    MethodDeclaration fakeMethod =
      this.findAfter(startWith, methodDeclaration.scope, from, methodDeclaration.bodyEnd, MAX_LINE_COUNT, false, discouragedNames, nameRequestor);
    if (fakeMethod != null) fakeMethod.traverse(this, methodDeclaration.scope.classScope());
  }
View Full Code Here

      ClassScope classScope,
      int from,
      int to,
      char[][] discouragedNames,
      UnresolvedReferenceNameRequestor nameRequestor) {
    MethodDeclaration fakeMethod =
      this.findAfter(startWith, scope, from, to, MAX_LINE_COUNT / 2, true, discouragedNames, nameRequestor);
    if (fakeMethod != null) fakeMethod.traverse(this, classScope);
  }
View Full Code Here

      end = maxEnd < to ? maxEnd : to;
    }

    this.parser.startRecordingIdentifiers(from, end);

    MethodDeclaration fakeMethod = this.parser.parseSomeStatements(
        from,
        end,
        outsideEnclosingBlock ? FAKE_BLOCKS_COUNT : 0,
        s.compilationUnitScope().referenceContext);
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.