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

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


    int methodCount = (typeDeclaration.methods == null) ? 0 : typeDeclaration.methods.length;
    int typeCount = (typeDeclaration.memberTypes == null) ? 0 : typeDeclaration.memberTypes.length;

    if (methodCount <= 2) {
      for (int i = 0, max = methodCount; i < max; i++) {
        final AbstractMethodDeclaration abstractMethodDeclaration = typeDeclaration.methods[i];
        if (abstractMethodDeclaration.isDefaultConstructor()) {
          methodCount--;
        } else if (abstractMethodDeclaration.isClinit()) {
          methodCount--;
        }
      }
    }
    final int memberLength = fieldCount + methodCount+typeCount;
View Full Code Here


    int methodCount = (typeDeclaration.methods == null) ? 0 : typeDeclaration.methods.length;
    int typeCount = (typeDeclaration.memberTypes == null) ? 0 : typeDeclaration.memberTypes.length;

    if (methodCount <= 2) {
      for (int i = 0, max = methodCount; i < max; i++) {
        final AbstractMethodDeclaration abstractMethodDeclaration = typeDeclaration.methods[i];
        if (abstractMethodDeclaration.isDefaultConstructor()) {
          methodCount--;
        } else if (abstractMethodDeclaration.isClinit()) {
          methodCount--;
        }
      }
    }
    final int memberLength = fieldCount + methodCount + typeCount;
View Full Code Here

    if (methodArray[s] == null) continue;
    MethodBinding[] current = (MethodBinding[]) methodArray[s];
    for (int i = 0, length = current.length; i < length; i++) {
      MethodBinding currentMethod = current[i];
      if ((currentMethod.modifiers & (ExtraCompilerModifiers.AccImplementing | ExtraCompilerModifiers.AccOverriding)) == 0) {
        AbstractMethodDeclaration methodDecl = currentMethod.sourceMethod();
        if (methodDecl == null) return;
        TypeBinding [] parameterTypes = currentMethod.parameters;
        Argument[] arguments = methodDecl.arguments;
        for (int j = 0, size = currentMethod.parameters.length; j < size; j++) {
          TypeBinding parameterType = parameterTypes[j];
          Argument arg = arguments[j];
          if (parameterType.leafComponentType().isRawType()
            && compilerOptions.getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore
                && (arg.type.bits & ASTNode.IgnoreRawTypeCheck) == 0) {
            methodDecl.scope.problemReporter().rawTypeReference(arg.type, parameterType);
            }
        }
        if (!methodDecl.isConstructor() && methodDecl instanceof MethodDeclaration) {
          TypeReference returnType = ((MethodDeclaration) methodDecl).returnType;
          TypeBinding methodType = currentMethod.returnType;
          if (returnType != null) {
            if (methodType.leafComponentType().isRawType()
                && compilerOptions.getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore
View Full Code Here

  CompilerOptions compilerOptions = this.type.scope.compilerOptions();
  if (compilerOptions.sourceLevel < ClassFileConstants.JDK1_5 // shouldn't whine at all
      || compilerOptions.reportUnavoidableGenericTypeProblems) { // must have already whined
    return;
  }
  AbstractMethodDeclaration methodDecl = currentMethod.sourceMethod();
  if (methodDecl == null) return;
  TypeBinding [] parameterTypes = currentMethod.parameters;
  TypeBinding [] inheritedParameterTypes = inheritedMethod.parameters;
  Argument[] arguments = methodDecl.arguments;
  for (int j = 0, size = currentMethod.parameters.length; j < size; j++) {
    TypeBinding parameterType = parameterTypes[j];
    TypeBinding inheritedParameterType = inheritedParameterTypes[j];
    Argument arg = arguments[j];
    if (parameterType.leafComponentType().isRawType()) {
      if (inheritedParameterType.leafComponentType().isRawType()) {
        arg.binding.tagBits |= TagBits.ForcedToBeRawType;
      } else {
        if (compilerOptions.getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore
            && (arg.type.bits & ASTNode.IgnoreRawTypeCheck) == 0) {
          methodDecl.scope.problemReporter().rawTypeReference(arg.type, parameterType);
        }
      }
      }
    }
  TypeReference returnType = null;
  if (!methodDecl.isConstructor() && methodDecl instanceof MethodDeclaration && (returnType = ((MethodDeclaration) methodDecl).returnType) != null) {
    final TypeBinding inheritedMethodType = inheritedMethod.returnType;
    final TypeBinding methodType = currentMethod.returnType;
    if (methodType.leafComponentType().isRawType()) {
      if (inheritedMethodType.leafComponentType().isRawType()) {
        //
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

  }
  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

  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

    allParameterAnnotations = new AnnotationBinding[length][];
    // forward reference to method, where param annotations have not yet been associated to method
    if (this.declaringClass instanceof SourceTypeBinding) {
      SourceTypeBinding sourceType = (SourceTypeBinding) this.declaringClass;
      if (sourceType.scope != null) {
        AbstractMethodDeclaration methodDecl = sourceType.scope.referenceType().declarationOf(this);
        for (int i = 0; i < length; i++) {
          Argument argument = methodDecl.arguments[i];
          if (argument.annotations != null) {
            ASTNode.resolveAnnotations(methodDecl.scope, argument.annotations, argument.binding);
            allParameterAnnotations[i] = argument.binding.getAnnotations();
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.