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

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


    }
  }

  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 {
      TypeBinding methodType = returnType.resolveType(methodDecl.scope, true /* check bounds*/);
      if (methodType == null) {
        foundReturnTypeProblem = true;
      } else if (methodType.isArrayType() && ((ArrayBinding) methodType).leafComponentType == TypeBinding.VOID) {
        methodDecl.scope.problemReporter().returnTypeCannotBeVoidArray((MethodDeclaration) methodDecl);
        foundReturnTypeProblem = true;
View Full Code Here


  private boolean resolveThrownTypes(TreeLogger logger, JAbstractMethod method,
      TypeReference[] jthrows) {
    if (jthrows != null) {
      for (int i = 0; i < jthrows.length; i++) {
        TypeReference jthrown = jthrows[i];
        if (!resolveThrownType(logger, method, jthrown)) {
          return false;
        }
      }
    }
View Full Code Here

        checkRefs(meth, scope);
      }
    }

    private void checkDecl(MethodDeclaration meth, ClassScope scope) {
      TypeReference returnType = meth.returnType;
      if (containsLong(returnType, scope)) {
        longAccessError(meth, "Type '" + typeString(returnType)
            + "' may not be returned from a JSNI method");
      }
View Full Code Here

      suppressWarningsStack.push(getSuppressedWarnings(typeDeclaration.annotations));
      return true;
    }

    private void checkDecl(MethodDeclaration meth, ClassScope scope) {
      TypeReference returnType = meth.returnType;
      if (containsLong(returnType, scope)) {
        longAccessError(meth, "Type '" + typeString(returnType)
            + "' may not be returned from a JSNI method");
      }
View Full Code Here

    char[][] expectedTypekeys= this.completionContext.getExpectedTypesKeys();
    if (expectedTypekeys == null || expectedTypekeys.length == 0)
      return true;
    // Next, find out whether any of the constructor parameters are the same as one of the
    // class type variables. If yes, diamond cannot be used.
    TypeReference ref;
    if (cn.length == 1) {
      ref = new SingleTypeReference(cn[0], 0);
    } else {
      ref = new QualifiedTypeReference(cn,new long[cn.length]);
    }
    switch (scope.kind) {
      case Scope.METHOD_SCOPE :
      case Scope.BLOCK_SCOPE :
        guessedType = ref.resolveType((BlockScope)scope);
        break;
      case Scope.CLASS_SCOPE :
        guessedType = ref.resolveType((ClassScope)scope);
        break;
    }
    if (guessedType != null && guessedType.isValidBinding()) {
      // the erasure must be used because guessedType can be a RawTypeBinding
      guessedType = guessedType.erasure();
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

          binding = typeBinding;
        } else {
          binding = typeBinding;
        }
      } else if (node instanceof TypeReference) {
        TypeReference typeReference = (TypeReference) node;
        binding = typeReference.resolvedType;
      } else if (node instanceof SingleNameReference && ((SingleNameReference)node).isTypeReference()) {
        binding = (((SingleNameReference)node).resolvedType);
      } else if (node instanceof QualifiedNameReference && ((QualifiedNameReference)node).isTypeReference()) {
        binding = (((QualifiedNameReference)node).resolvedType);
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) {
    ArrayList argumentList = new ArrayList(1);
    int count = 0;
    argumentsLoop: while (this.namePos < length) {
      TypeReference argument = decodeType(typeName, length, start, end);
      count++;
      argumentList.add(argument);
      if (this.namePos >= length) break argumentsLoop;
      if (typeName[this.namePos] == '>') {
        break argumentsLoop;
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

TOP

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

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.