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

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


      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


    boolean noProblems = true;
    int length = this.referenceContext.superInterfaces.length;
    ReferenceBinding[] interfaceBindings = new ReferenceBinding[length];
    int count = 0;
    nextInterface : for (int i = 0; i < length; i++) {
        TypeReference superInterfaceRef = this.referenceContext.superInterfaces[i];
      ReferenceBinding superInterface = findSupertype(superInterfaceRef);
      if (superInterface == null) { // detected cycle
        sourceType.tagBits |= TagBits.HierarchyHasProblems;
        noProblems = false;
        continue nextInterface;
View Full Code Here

      if (length > 0) {
        parameter.type = createTypeReference(typeParameterBounds[0], start, end);
        if (length > 1) {
          parameter.bounds = new TypeReference[length-1];
          for (int i = 1; i < length; i++) {
            TypeReference bound = createTypeReference(typeParameterBounds[i], start, end);
            bound.bits |= ASTNode.IsSuperType;
            parameter.bounds[i-1] = bound;
          }
        }
      }
View Full Code Here

  private TypeReference[] decodeTypeArguments(char[] typeName, int length, int start, int end, boolean includeGenericsAnyway) {
    ArrayList argumentList = new ArrayList(1);
    int count = 0;
    argumentsLoop: while (this.namePos < length) {
      TypeReference argument = decodeType(typeName, length, start, end, includeGenericsAnyway);
      count++;
      argumentList.add(argument);
      if (this.namePos >= length) break argumentsLoop;
      if (typeName[this.namePos] == '>') {
        break argumentsLoop;
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

  private TypeReference[] decodeTypeArguments(String typeSignature, int length, int start, int end) {
    ArrayList argumentList = new ArrayList(1);
    int count = 0;
    argumentsLoop: while (this.namePos < length) {
      TypeReference argument = decodeType(typeSignature, length, start, end);
      count++;
      argumentList.add(argument);
      if (this.namePos >= length) break argumentsLoop;
      if (typeSignature.charAt(this.namePos) == Signature.C_GENERIC_END) {
        break argumentsLoop;
View Full Code Here

    }
  } else if (method.isConstructor()){
    sourceStart = method.sourceStart;
    sourceEnd = method.sourceEnd;
  } else {
    TypeReference returnType = ((MethodDeclaration) method).returnType;
    sourceStart = returnType.sourceStart;
    if (returnType instanceof ParameterizedSingleTypeReference) {
      ParameterizedSingleTypeReference typeReference = (ParameterizedSingleTypeReference) returnType;
      TypeReference[] typeArguments = typeReference.typeArguments;
      if (typeArguments[typeArguments.length - 1].sourceEnd > typeReference.sourceEnd) {
View Full Code Here

        String[] parameterSignatures;
        if (arguments != null) {
          parameterSignatures = new String[arguments.length];
          for (int i = 0; i < arguments.length; i++) {
            Argument argument = arguments[i];
            TypeReference typeReference = argument.type;
            int arrayDim = typeReference.dimensions();

            String typeSig =
              Signature.createTypeSignature(
                  CharOperation.concatWith(
                      typeReference.getTypeName(), '.'), false);
            if (arrayDim > 0) {
              typeSig = Signature.createArraySignature(typeSig, arrayDim);
            }
            parameterSignatures[i] = typeSig;
View Full Code Here

  if (this.typeArguments != null) {
    int length = this.typeArguments.length;
    boolean argHasError = scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_5;
    this.genericTypeArguments = new TypeBinding[length];
    for (int i = 0; i < length; i++) {
      TypeReference typeReference = this.typeArguments[i];
      if ((this.genericTypeArguments[i] = typeReference.resolveType(scope, true /* check bounds*/)) == null) {
        argHasError = true;
      }
      if (argHasError && typeReference instanceof Wildcard) {
        scope.problemReporter().illegalUsageOfWildcard(typeReference);
      }
View Full Code Here

  }

  public CastExpression convert(org.eclipse.jdt.internal.compiler.ast.CastExpression expression) {
    CastExpression castExpression = new CastExpression(this.ast);
    castExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1);
    TypeReference type = expression.type;
    trimWhiteSpacesAndComments(type);
    castExpression.setType(convertType(type));
    castExpression.setExpression(convert(expression.expression));
    if (this.resolveBindings) {
      recordNodes(castExpression, expression);
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.