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

Examples of org.eclipse.jdt.internal.compiler.ast.TypeReference$AnnotationCollector


                && (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
                && (returnType.bits & ASTNode.IgnoreRawTypeCheck) == 0) {
View Full Code Here


          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 interfaceNames;
}
protected char[] getSuperclassName(TypeDeclaration typeDeclaration) {
  TypeReference superclass = typeDeclaration.superclass;
  return superclass != null ? CharOperation.concatWith(superclass.getParameterizedTypeName(), '.') : null;
}
View Full Code Here

    }
  }
  return thrownExceptionTypes;
}
protected char[][] getTypeParameterBounds(TypeParameter typeParameter) {
  TypeReference firstBound = typeParameter.type;
  TypeReference[] otherBounds = typeParameter.bounds;
  char[][] typeParameterBounds = null;
  if (firstBound != null) {
    if (otherBounds != null) {
      int otherBoundsLength = otherBounds.length;
      char[][] boundNames = new char[otherBoundsLength+1][];
      boundNames[0] = CharOperation.concatWith(firstBound.getParameterizedTypeName(), '.');
      for (int j = 0; j < otherBoundsLength; j++) {
        boundNames[j+1] =
          CharOperation.concatWith(otherBounds[j].getParameterizedTypeName(), '.');
      }
      typeParameterBounds = boundNames;
    } else {
      typeParameterBounds = new char[][] { CharOperation.concatWith(firstBound.getParameterizedTypeName(), '.')};
    }
  } else {
    typeParameterBounds = CharOperation.NO_CHAR_CHAR;
  }
 
View Full Code Here

      currentModifiers |= ClassFileConstants.AccVarargs;
   
    // remember deprecation so as to not lose it below
    boolean deprecated = (currentModifiers & ClassFileConstants.AccDeprecated) != 0 || hasDeprecatedAnnotation(methodDeclaration.annotations)
     
    TypeReference returnType = methodDeclaration instanceof MethodDeclaration
      ? ((MethodDeclaration) methodDeclaration).returnType
      : null;
    ISourceElementRequestor.MethodInfo methodInfo = new ISourceElementRequestor.MethodInfo();
    methodInfo.isAnnotation = methodDeclaration instanceof AnnotationMethodDeclaration;
    methodInfo.declarationStart = methodDeclaration.declarationSourceStart;
    methodInfo.modifiers = deprecated ? (currentModifiers & ExtraCompilerModifiers.AccJustFlag) | ClassFileConstants.AccDeprecated : currentModifiers & ExtraCompilerModifiers.AccJustFlag;
    methodInfo.returnType = returnType == null ? null : CharOperation.concatWith(returnType.getParameterizedTypeName(), '.');
    methodInfo.name = methodDeclaration.selector;
    methodInfo.nameSourceStart = methodDeclaration.sourceStart;
    methodInfo.nameSourceEnd = selectorSourceEnd;
    methodInfo.parameterTypes = argumentTypes;
    methodInfo.parameterNames = argumentNames;
View Full Code Here

  }
  if ((this.tagBits & TagBits.HierarchyHasProblems) == 0) {
    return this.superclass;
  }
  if (this.scope != null) {
    TypeReference typeReference = this.scope.referenceContext.allocation.type;
    if (typeReference != null) {
      return (ReferenceBinding) typeReference.resolvedType;
    }
  }
  return this.superclass; // default answer
View Full Code Here

    }
  }

  boolean foundReturnTypeProblem = false;
  if (!method.isConstructor()) {
    TypeReference returnType = methodDecl instanceof MethodDeclaration
      ? ((MethodDeclaration) methodDecl).returnType
      : null;
    if (returnType == null) {
      methodDecl.scope.problemReporter().missingReturnType(methodDecl);
      method.returnType = null;
      foundReturnTypeProblem = true;
    } else {
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=322817
      boolean deferRawTypeCheck = !reportUnavoidableGenericTypeProblems && (returnType.bits & ASTNode.IgnoreRawTypeCheck) == 0;
      TypeBinding methodType;
      if (deferRawTypeCheck) {
        returnType.bits |= ASTNode.IgnoreRawTypeCheck;
      }
      try {
        methodType = returnType.resolveType(methodDecl.scope, true /* check bounds*/);
      } finally {
        if (deferRawTypeCheck) {
          returnType.bits &= ~ASTNode.IgnoreRawTypeCheck;
        }
      }
View Full Code Here

    LocalTypeBinding anonymousType = buildLocalType(enclosingType, enclosingType.fPackage);
    anonymousType.modifiers |= ExtraCompilerModifiers.AccLocallyUsed; // tag all anonymous types as used locally
    if (supertype.isInterface()) {
      anonymousType.superclass = getJavaLangObject();
      anonymousType.superInterfaces = new ReferenceBinding[] { supertype };
      TypeReference typeReference = this.referenceContext.allocation.type;
      if (typeReference != null) {
        if ((supertype.tagBits & TagBits.HasDirectWildcard) != 0) {
          problemReporter().superTypeCannotUseWildcard(anonymousType, typeReference, supertype);
          anonymousType.tagBits |= TagBits.HierarchyHasProblems;
          anonymousType.superInterfaces = Binding.NO_SUPERINTERFACES;
        }
      }
    } else {
      anonymousType.superclass = supertype;
      anonymousType.superInterfaces = Binding.NO_SUPERINTERFACES;
      TypeReference typeReference = this.referenceContext.allocation.type;
      if (typeReference != null) { // no check for enum constant body
        if (supertype.erasure().id == TypeIds.T_JavaLangEnum) {
          problemReporter().cannotExtendEnum(anonymousType, typeReference, supertype);
          anonymousType.tagBits |= TagBits.HierarchyHasProblems;
          anonymousType.superclass = getJavaLangObject();
View Full Code Here

      TypeReference[] boundRefs = typeParameter.bounds;
      if (boundRefs != null) {
        boolean checkSuperclass = typeVariable.firstBound == typeVariable.superclass;
        for (int j = 0, boundLength = boundRefs.length; j < boundLength; j++) {
          TypeReference typeRef = boundRefs[j];
          TypeBinding superType = typeRef.resolvedType;
          if (superType == null || !superType.isValidBinding()) continue;

          // check against superclass
          if (checkSuperclass)
View Full Code Here

      if (sourceType.isEnum() && compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) // do not connect if source < 1.5 as enum already got flagged as syntax error
        return connectEnumSuperclass();
      sourceType.superclass = getJavaLangObject();
      return !detectHierarchyCycle(sourceType, sourceType.superclass, null);
    }
    TypeReference superclassRef = this.referenceContext.superclass;
    ReferenceBinding superclass = findSupertype(superclassRef);
    if (superclass != null) { // is null if a cycle was detected cycle or a problem
      if (!superclass.isClass() && (superclass.tagBits & TagBits.HasMissingType) == 0) {
        problemReporter().superclassMustBeAClass(sourceType, superclassRef, superclass);
      } else if (superclass.isFinal()) {
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.ast.TypeReference$AnnotationCollector

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.