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

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


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


      fakeBlocksCount = FAKE_BLOCKS_COUNT;
    }

    this.parser.startRecordingIdentifiers(start, recordTo);

    MethodDeclaration fakeMethod = this.parser.parseSomeStatements(
        start,
        parseTo,
        fakeBlocksCount,
        s.compilationUnitScope().referenceContext);
View Full Code Here

      ConstructorDeclaration decl = new ConstructorDeclaration(this.compilationResult);
      decl.bits &= ~ASTNode.IsDefaultConstructor;
      decl.typeParameters = typeParams;
      methodDeclaration = decl;
    } else {
      MethodDeclaration decl = type.isAnnotation() ? new AnnotationMethodDeclaration(this.compilationResult) : new MethodDeclaration(this.compilationResult);
      /* convert return type */
      TypeReference typeReference = createTypeReference(method.getReturnType());
      if (typeReference == null) return null;
      decl.returnType = typeReference;
      decl.typeParameters = typeParams;
View Full Code Here

        Annotation[] annotations = methodDeclaration.annotations;
        if (annotations != null && !methodDeclaration.isClinit() && (methodDeclaration.isConstructor() || binding.returnType.id != T_void)) {
          methodDeclaration.getAllAnnotationContexts(AnnotationTargetTypeConstants.METHOD_RETURN, allTypeAnnotationContexts);
        }
        if (!methodDeclaration.isConstructor() && !methodDeclaration.isClinit() && binding.returnType.id != T_void) {
          MethodDeclaration declaration = (MethodDeclaration) methodDeclaration;
          TypeReference typeReference = declaration.returnType;
          if ((typeReference.bits & ASTNode.HasTypeAnnotations) != 0) {
            typeReference.getAllAnnotationContexts(AnnotationTargetTypeConstants.METHOD_RETURN, allTypeAnnotationContexts);
          }
        }
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

  boolean inCycle = false; // check each method before failing
  for (int i = 0, l = currentMethods.length; i < l; i++) {
    TypeBinding returnType = currentMethods[i].returnType.leafComponentType();
    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

    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.