Examples of TypeReference


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

      handleSig.append('Q').append(pstr.token);
      TypeReference[] typeRefs = pstr.typeArguments;
      if (typeRefs != null && typeRefs.length > 0) {
        handleSig.append("\\<");
        for (int i = 0; i < typeRefs.length; i++) {
          TypeReference typeR = typeRefs[i];
          TypeBinding typeB = typeR.resolvedType;
          if (typeB == null) {
            typeB = typeR.resolveType(scope);
          }
          createHandleSigForReference(typeR, typeB, scope, handleSig);
        }
        handleSig.append('>');
      }
      handleSig.append(';');
    } else if (ref instanceof ArrayTypeReference) {
      ArrayTypeReference atr = (ArrayTypeReference) ref;
      for (int i = 0; i < atr.dimensions; i++) {
        handleSig.append("\\[");
      }
      TypeBinding typeB = atr.resolvedType;
      if (typeB == null) {
        typeB = atr.resolveType(scope);
      }
      if (typeB.leafComponentType().isBaseType()) {
        handleSig.append(tb.leafComponentType().signature());
      } else {
        handleSig.append('Q').append(atr.token).append(';');
      }
    } else if (ref instanceof SingleTypeReference) {
      SingleTypeReference str = (SingleTypeReference) ref;
      if (tb.isBaseType()) {
        handleSig.append(tb.signature());
      } else {
        handleSig.append('Q').append(str.token).append(';');
      }
    } else if (ref instanceof ParameterizedQualifiedTypeReference) {
      ParameterizedQualifiedTypeReference pstr = (ParameterizedQualifiedTypeReference) ref;
      char[][] tokens = pstr.tokens;
      for (int i = pstr.dimensions(); i > 0; i--) {
        handleSig.append("\\[");
      }
      handleSig.append('Q');
      for (int i = 0; i < tokens.length; i++) {
        if (i > 0) {
          handleSig.append('.');
        }
        handleSig.append(tokens[i]);
        TypeReference[] typeRefs = pstr.typeArguments[i];
        if (typeRefs != null && typeRefs.length > 0) {
          handleSig.append("\\<");
          for (int j = 0; j < typeRefs.length; j++) {
            TypeReference typeR = typeRefs[j];
            TypeBinding typeB = typeR.resolvedType;
            if (typeB == null) {
              typeB = typeR.resolveType(scope);
            }
            createHandleSigForReference(typeR, typeB, scope, handleSig);
          }
          handleSig.append('>');
        }
View Full Code Here

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

      boolean problemWithSourceRefs = false;
      for (int i = 0; i < argArray.length; i++) {
        String argName = new String(argArray[i].name);
        // String argType = "<UnknownType>"; // pr135052
        if (acceptArgument(argName, argArray[i].type.toString())) {
          TypeReference typeR = argArray[i].type;
          if (typeR != null && md.scope != null) {
            TypeBinding typeB = typeR.resolvedType;
            if (typeB == null) {
              typeB = typeR.resolveType(md.scope);
            }
            // This code will conjure up a 'P' style signature:
            // EclipseFactory factory = EclipseFactory.fromScopeLookupEnvironment(md.scope);
            // UnresolvedType ut = factory.fromBinding(typeB);
            // paramSigs.add(ut.getSignature().toCharArray());
View Full Code Here

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

   */
  public void ensureScopeSetup() {
    if (scopeSetup) return; // don't do it again
    MethodScope scope = this.scope;
   
    TypeReference ot = onType;
    ReferenceBinding rb = null;
   
    if (ot instanceof ParameterizedQualifiedTypeReference) { // pr132349
      ParameterizedQualifiedTypeReference pref = (ParameterizedQualifiedTypeReference) ot;
      if (pref.typeArguments!=null && pref.typeArguments.length!=0) {
        boolean usingNonTypeVariableInITD = false;
        // Check if any of them are not type variables
        for (int i = 0; i < pref.typeArguments.length; i++) {
          TypeReference[] refs = pref.typeArguments[i];
          for (int j = 0; refs!=null && j < refs.length; j++) {
            TypeBinding tb = refs[j].getTypeBindingPublic(scope.parent);
            if (!tb.isTypeVariable() && !(tb instanceof ProblemReferenceBinding)) {
              usingNonTypeVariableInITD = true;
            }
           
          }
        }
        if (usingNonTypeVariableInITD) {
          scope.problemReporter().signalError(sourceStart,sourceEnd,
            "Cannot make inter-type declarations on parameterized types");
          // to prevent disgusting cascading errors after this problem - lets null out what leads to them (pr105038)
          this.arguments=null;
          this.returnType=new SingleTypeReference(TypeReference.VOID,0L);
         
          this.ignoreFurtherInvestigation=true;
          ReferenceBinding closestMatch = null;
          rb = new ProblemReferenceBinding(ot.getParameterizedTypeName(),closestMatch,0);   
          onType=null;
        }
      }
   
    }

    // Work out the real base type
    if (ot instanceof ParameterizedSingleTypeReference) {
      ParameterizedSingleTypeReference pref = (ParameterizedSingleTypeReference) ot;
      long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd;
      ot = new SingleTypeReference(pref.token,pos);
    } else if (ot instanceof ParameterizedQualifiedTypeReference) {
      ParameterizedQualifiedTypeReference pref = (ParameterizedQualifiedTypeReference) ot;
      long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd;
      ot = new QualifiedTypeReference(pref.tokens,new long[]{pos});//SingleTypeReference(pref.Quatoken,pos);
    }
   
    // resolve it
    if (rb==null) {
      rb = (ReferenceBinding)ot.getTypeBindingPublic(scope.parent);
    }
   
    // pr203646 - if we have ended up with the raw type, get back to the underlying generic one.
    if (rb.isRawType() && rb.isMemberType()) {
      // if the real target type used a type variable alias then we can do this OK, but need to switch things around, we want the generic type
View Full Code Here

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

    simpleName.internalSetIdentifier(new String(typeParameter.name));
    int start = typeParameter.sourceStart;
    int end = typeParameter.sourceEnd;
    simpleName.setSourceRange(start, end - start + 1);
    typeParameter2.setName(simpleName);
    final TypeReference superType = typeParameter.type;
    end = typeParameter.declarationSourceEnd;
    if (superType != null) {
      Type type = convertType(superType);
      typeParameter2.typeBounds().add(type);
      end = type.getStartPosition() + type.getLength() - 1;
View Full Code Here

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

    return qualifiedName;
  }

  protected void setTypeNameForAnnotation(org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation compilerAnnotation,
      Annotation annotation) {
    TypeReference typeReference = compilerAnnotation.type;
    if (typeReference instanceof QualifiedTypeReference) {
      QualifiedTypeReference qualifiedTypeReference = (QualifiedTypeReference) typeReference;
      char[][] tokens = qualifiedTypeReference.tokens;
      long[] positions = qualifiedTypeReference.sourcePositions;
      // QualifiedName
View Full Code Here

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

           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

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

    char[][] typeName = CharOperation.splitOn('.', name.replace('$', '.').toCharArray()); // pr149293 - not bulletproof...
    long[] positions = new long[typeName.length];
    for (int i = 0; i < positions.length; i++) {
      positions[i] = pos;
    }
    TypeReference annType = new QualifiedTypeReference(typeName, positions);
    NormalAnnotation ann = new NormalAnnotation(annType, pos);
    ann.resolvedType = tb; // yuck - is this OK in all cases?
    // We don't need membervalues...
    // Expression pcExpr = new
    // StringLiteral(pointcutExpression.toCharArray(),pos,pos);
View Full Code Here

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

          }
        }
      }

      // fix up declare parents - may need to attach them to existing ones
      TypeReference sr = sourceTypeBinding.scope.referenceContext.superclass;
      TypeReference[] trs = sourceTypeBinding.scope.referenceContext.superInterfaces;
      List<ExactTypePattern> newParents = additionalParents.get(sourceTypeBinding);
      StringBuffer extendsString = new StringBuffer();
      StringBuffer implementsString = new StringBuffer();
      if (newParents != null && newParents.size() > 0) {
View Full Code Here

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

    adviceDecl.sourceStart = (int) (pos >>> 32);
       
    // but put in a placeholder name
        adviceDecl.selector = new char[] {'a','j','c','$','a','d','v','i','c','e'};

    TypeReference returnType = getTypeReference(intStack[intPtr--]);
   
    //modifiers
    adviceDecl.declarationSourceStart = intStack[intPtr--];
    adviceDecl.modifiers = intStack[intPtr--];
View Full Code Here

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

    if (hasTypeParameters) {
      pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
    } else {
      consumeClassOrInterfaceName();
    }
    TypeReference onType = getTypeReference(0);


    TypeReference returnType = getTypeReference(intStack[intPtr--]);
    this.display();

    int decSourceStart = intStack[intPtr--];
    int fieldModifiers = intStack[intPtr--];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.