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

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


    0,
    0);
}
public void defaultMethodOverridesObjectMethod(MethodBinding currentMethod) {
  // Java 8 feature
  AbstractMethodDeclaration method = currentMethod.sourceMethod();
  int sourceStart = 0;
  int sourceEnd = 0;
  if (method != null) {
    sourceStart = method.sourceStart;
    sourceEnd = method.sourceEnd;
View Full Code Here


      && !inheritedMethod.isPublic()){ // interface inheriting Object protected method
    id = IProblem.IncompatibleReturnTypeForNonInheritedInterfaceMethod;
  } else {
    id = IProblem.IncompatibleReturnType;
  }
  AbstractMethodDeclaration method = currentMethod.sourceMethod();
  int sourceStart = 0;
  int sourceEnd = 0;
  if (method == null) {
    if (declaringClass instanceof SourceTypeBinding) {
      SourceTypeBinding sourceTypeBinding = (SourceTypeBinding) declaringClass;
      sourceStart = sourceTypeBinding.sourceStart();
      sourceEnd = sourceTypeBinding.sourceEnd();
    }
  } else if (method.isConstructor()){
    sourceStart = method.sourceStart;
    sourceEnd = method.sourceEnd;
  } else {
    TypeReference returnType = ((MethodDeclaration) method).returnType;
    sourceStart = returnType.sourceStart;
View Full Code Here

  private boolean resolveMethods(TreeLogger logger, char[] unitSource,
      JClassType type, AbstractMethodDeclaration[] jmethods) {
    if (jmethods != null) {
      for (int i = 0; i < jmethods.length; i++) {
        AbstractMethodDeclaration jmethod = jmethods[i];
        if (!resolveMethod(logger, unitSource, type, jmethod)) {
          return false;
        }
      }
    }
View Full Code Here

          // init
          assert (enclosingType instanceof JClassType);
          method = (JMethod) enclosingType.methods.get(1);
        }
      } else {
        AbstractMethodDeclaration referenceMethod = methodScope.referenceMethod();
        method = (JMethod) typeMap.get(referenceMethod.binding);
      }
      assert !method.isNative() && !method.isAbstract();
      return (JMethodBody) method.getBody();
    }
View Full Code Here

  }
  while ((fieldIndex < fieldCounter)
      || (memberTypeIndex < memberTypeCounter)
      || (methodIndex < methodCounter)) {
    FieldDeclaration nextFieldDeclaration = null;
    AbstractMethodDeclaration nextMethodDeclaration = null;
    TypeDeclaration nextMemberDeclaration = null;

    int position = Integer.MAX_VALUE;
    int nextDeclarationType = -1;
    if (fieldIndex < fieldCounter) {
View Full Code Here

          return;

        // anonymous constructors are allowed to throw any exceptions (their thrown exceptions
        // clause will be fixed up later as per JLS 8.6).
        if (exceptionContext.associatedNode instanceof AbstractMethodDeclaration){
          AbstractMethodDeclaration method = (AbstractMethodDeclaration)exceptionContext.associatedNode;
          if (method.isConstructor() && method.binding.declaringClass.isAnonymousType()){

            exceptionContext.mergeUnhandledException(raisedException);
            return; // no need to complain, will fix up constructor exceptions
          }
        }
View Full Code Here

          }
        }
        // anonymous constructors are allowed to throw any exceptions (their thrown exceptions
        // clause will be fixed up later as per JLS 8.6).
        if (exceptionContext.associatedNode instanceof AbstractMethodDeclaration){
          AbstractMethodDeclaration method = (AbstractMethodDeclaration)exceptionContext.associatedNode;
          if (method.isConstructor() && method.binding.declaringClass.isAnonymousType()){

            for (int i = 0; i < raisedCount; i++) {
              TypeBinding raisedException;
              if ((raisedException = raisedExceptions[i]) != null) {
                exceptionContext.mergeUnhandledException(raisedException);
View Full Code Here

    priority += P_ERROR;
  }
  ReferenceContext context = this.problemsMap == null ? null : (ReferenceContext) this.problemsMap.get(problem);
  if (context != null){
    if (context instanceof AbstractMethodDeclaration){
      AbstractMethodDeclaration method = (AbstractMethodDeclaration) context;
      if (method.isStatic()) {
        priority += P_STATIC;
      }
    } else {
      priority += P_OUTSIDE_METHOD;
    }
View Full Code Here

  MethodBinding originalMethod = original();
  if ((originalMethod.tagBits & TagBits.AnnotationResolved) == 0 && originalMethod.declaringClass instanceof SourceTypeBinding) {
    ClassScope scope = ((SourceTypeBinding) originalMethod.declaringClass).scope;
    if (scope != null) {
      TypeDeclaration typeDecl = scope.referenceContext;
      AbstractMethodDeclaration methodDecl = typeDecl.declarationOf(originalMethod);
      if (methodDecl != null)
        ASTNode.resolveAnnotations(methodDecl.scope, methodDecl.annotations, originalMethod);
    }
  }
  return originalMethod.tagBits;
View Full Code Here

    //The method has not been resolved nor has its class been resolved.
    //It can only be from a source type within compilation units to process.
    if (originalMethod.declaringClass instanceof SourceTypeBinding) {
      SourceTypeBinding sourceType = (SourceTypeBinding) originalMethod.declaringClass;
      if (sourceType.scope != null) {
        AbstractMethodDeclaration methodDeclaration = originalMethod.sourceMethod();
        if (methodDeclaration != null && methodDeclaration.isAnnotationMethod()) {
          methodDeclaration.resolve(sourceType.scope);
        }
      }
    }
    originalMethod.tagBits |= TagBits.DefaultValueResolved;
  }
View Full Code Here

TOP

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

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.