Examples of TypeBinding


Examples of org.apache.qpid.agent.binding.TypeBinding

                List<ParameterBinding> params = method.getInParameters();
                Object[] args = new Object[params.size()];
                int idx = 0;
                for (ParameterBinding p : params)
                {
                    TypeBinding typeBinding = p.getType();
                    log
                            .trace(String
                                    .format(
                                            "Decoding parameter with type %s ref package %s ref class %s ",
                                            typeBinding.getCode(), typeBinding
                                                    .getRefPackage(),
                                            typeBinding.getRefClass()));
                    args[idx++] = typeBinding.decode(dec);
                    log.trace("Done");
                }
                try
                {
                    Object[] result = mo.invoke(method, args);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

  }

  return index;
}
public int literalIndex(TypeBinding binding) {
  TypeBinding typeBinding = binding.leafComponentType();
  if (typeBinding.isNestedType()) {
    this.classFile.recordInnerClasses(typeBinding);
  }
  return literalIndex(binding.signature());
}
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

* This method returns the index into the constantPool corresponding to the type descriptor
* corresponding to a type constant pool name
* binding must not be an array type.
*/
public int literalIndexForType(final TypeBinding binding) {
  TypeBinding typeBinding = binding.leafComponentType();
  if (typeBinding.isNestedType()) {
    this.classFile.recordInnerClasses(typeBinding);
  }
  return this.literalIndexForType(binding.constantPoolName());
}
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

 
  private void removeCaughtExceptions(TryStatement tryStatement) {
    Argument[] catchArguments = tryStatement.catchArguments;
    int length = catchArguments == null ? 0 : catchArguments.length;
    for (int i = 0; i < length; i++) {
      TypeBinding exception = catchArguments[i].type.resolvedType;
      if (exception != null && exception.isValidBinding()) {
        this.removeCaughtException((ReferenceBinding)exception);
       
      }
    }
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

  output.append("<SelectOnQualifiedSuper:"); //$NON-NLS-1$
  return super.printExpression(0, output).append('>');
}

public TypeBinding resolveType(BlockScope scope) {
  TypeBinding binding = super.resolveType(scope);

  if (binding == null || !binding.isValidBinding())
    throw new SelectionNodeFound();
  else
    throw new SelectionNodeFound(binding);
}
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

  public void resolve(BlockScope upperScope) {
    // use the scope that will hold the init declarations
    scope = new BlockScope(upperScope);
    this.elementVariable.resolve(scope); // collection expression can see itemVariable
    TypeBinding elementType = this.elementVariable.type.resolvedType;
    TypeBinding collectionType = this.collection == null ? null : this.collection.resolveType(scope);

    if (elementType != null && collectionType != null) {
      if (collectionType.isArrayType()) { // for(E e : E[])
        this.kind = ARRAY;
        this.collection.computeConversion(scope,collectionType, collectionType);
        this.collectionElementType = ((ArrayBinding) collectionType).elementsType();
        if (!collectionElementType.isCompatibleWith(elementType)
            && !scope.isBoxingCompatibleWith(collectionElementType, elementType)) {
          scope.problemReporter().notCompatibleTypesErrorInForeach(collection, collectionElementType, elementType);
        }
        // in case we need to do a conversion
        int compileTimeTypeID = collectionElementType.id;
        if (elementType.isBaseType()) {
          if (!collectionElementType.isBaseType()) {
            compileTimeTypeID = scope.environment().computeBoxingType(collectionElementType).id;
            this.elementVariableImplicitWidening = UNBOXING;
            if (elementType.isBaseType()) {
              this.elementVariableImplicitWidening |= (elementType.id << 4) + compileTimeTypeID;
              scope.problemReporter().autoboxing(collection, collectionElementType, elementType);
            }
          } else {
            this.elementVariableImplicitWidening = (elementType.id << 4) + compileTimeTypeID;
          }
        } else {
          if (collectionElementType.isBaseType()) {
            int boxedID = scope.environment().computeBoxingType(collectionElementType).id;
            this.elementVariableImplicitWidening = BOXING | (compileTimeTypeID << 4) | compileTimeTypeID; // use primitive type in implicit conversion
            compileTimeTypeID = boxedID;
            scope.problemReporter().autoboxing(collection, collectionElementType, elementType);
          }
        }
      } else if (collectionType instanceof ReferenceBinding) {
          ReferenceBinding iterableType = ((ReferenceBinding)collectionType).findSuperTypeErasingTo(T_JavaLangIterable, false /*Iterable is not a class*/);
          checkIterable: {
            if (iterableType == null) break checkIterable;
           
          this.iteratorReceiverType = collectionType.erasure();
          if (((ReferenceBinding)iteratorReceiverType).findSuperTypeErasingTo(T_JavaLangIterable, false) == null) {
            this.iteratorReceiverType = iterableType; // handle indirect inheritance thru variable secondary bound
               this.collection.computeConversion(scope, iterableType, collectionType);
          } else {
               this.collection.computeConversion(scope, collectionType, collectionType);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

        boolean[] locallyCaught = new boolean[raisedCount]; // at most

        for (int caughtIndex = 0; caughtIndex < caughtCount; caughtIndex++) {
          ReferenceBinding caughtException = caughtExceptions[caughtIndex];
          for (int raisedIndex = 0; raisedIndex < raisedCount; raisedIndex++) {
            TypeBinding raisedException;
            if ((raisedException = raisedExceptions[raisedIndex]) != null) {
                int state = caughtException == null
                  ? Scope.EQUAL_OR_MORE_SPECIFIC /* any exception */
                    : Scope.compareTypes(raisedException, caughtException);
              switch (state) {
                case Scope.EQUAL_OR_MORE_SPECIFIC :
                  exceptionContext.recordHandlingException(
                    caughtException,
                    flowInfo.unconditionalInits(),
                    raisedException,
                    location,
                    locallyCaught[raisedIndex]);
                  // was already definitely caught ?
                  if (!locallyCaught[raisedIndex]) {
                    locallyCaught[raisedIndex] = true;
                    // remember that this exception has been definitely caught
                    remainingCount--;
                  }
                  break;
                case Scope.MORE_GENERIC :
                  exceptionContext.recordHandlingException(
                    caughtException,
                    flowInfo.unconditionalInits(),
                    raisedException,
                    location,
                    false);
                  // was not caught already per construction
              }
            }
          }
        }
        // remove locally caught exceptions from the remaining ones
        for (int i = 0; i < raisedCount; i++) {
          if (locallyCaught[i]) {
            raisedExceptions[i] = null; // removed from the remaining ones.
          }
        }
      }
      // method treatment for unchecked exceptions
      if (exceptionContext.isMethodContext) {
        for (int i = 0; i < raisedCount; i++) {
          TypeBinding raisedException;
          if ((raisedException = raisedExceptions[i]) != null) {
            if (raisedException.isUncheckedException(false)) {
              remainingCount--;
              raisedExceptions[i] = null;
            }
          }
        }
        // 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);
              }
            }
            return; // no need to complain, will fix up constructor exceptions           
          }
        }
        break; // not handled anywhere, thus jump to error handling
      }
    }
    if (remainingCount == 0)
      return;
     
    traversedContext.recordReturnFrom(flowInfo.unconditionalInits());
   
    if (traversedContext instanceof InsideSubRoutineFlowContext) {
      ASTNode node = traversedContext.associatedNode;
      if (node instanceof TryStatement) {
        TryStatement tryStatement = (TryStatement) node;
        flowInfo.addInitializationsFrom(tryStatement.subRoutineInits); // collect inits     
      }
    }   
    traversedContext = traversedContext.parent;
  }
  // if reaches this point, then there are some remaining unhandled exception types. 
  nextReport: for (int i = 0; i < raisedCount; i++) {
    TypeBinding exception;
    if ((exception = raisedExceptions[i]) != null) {
      // only one complaint if same exception declared to be thrown more than once
      for (int j = 0; j < i; j++) {
        if (raisedExceptions[j] == exception) continue nextReport; // already reported
      }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

  output.append("<SelectOnSuper:"); //$NON-NLS-1$
  return super.printExpression(0, output).append('>');
}
public TypeBinding resolveType(BlockScope scope) {
  TypeBinding binding = super.resolveType(scope);

  if (binding == null || !binding.isValidBinding())
    throw new SelectionNodeFound();
  else
    throw new SelectionNodeFound(binding);
}
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

        output.append("[]"); //$NON-NLS-1$
      }
      return output;
    } else if (tr instanceof SingleTypeReference) {
      SingleTypeReference str = (SingleTypeReference) tr;
      TypeBinding tb = mscope.getType(str.token);
      output.append(tb.debugName()); // fq name
      for (int i = 0; i < str.dimensions(); i++) {
        output.append("[]"); //$NON-NLS-1$
      }
      return output;
    } else if (tr instanceof QualifiedTypeReference) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

     
      nextSubstitution(substituedTypeNodes, subtitutions, substitutionsIndexes);
     
     
      this.problemFactory.startCheckingProblems();
      TypeBinding guessedType = null;
      switch (scope.kind) {
        case Scope.METHOD_SCOPE :
        case Scope.BLOCK_SCOPE :
          resolutionCleaner.cleanUp(convertedType, (BlockScope)scope);
          guessedType = convertedType.resolveType((BlockScope)scope);
          break;
        case Scope.CLASS_SCOPE :
          resolutionCleaner.cleanUp(convertedType, (ClassScope)scope);
          guessedType = convertedType.resolveType((ClassScope)scope);
          break;
      }
      this.problemFactory.stopCheckingProblems();
      if (!this.problemFactory.hasForbiddenProblems) {
        if (guessedType != null) {
          Binding[] missingElements = new Binding[length];
          int[] missingElementsStarts = new int[length];
          int[] missingElementsEnds = new int[length];
         
          if(computeMissingElements(
              substituedTypeNodes,
              originalTypeNames,
              missingElements,
              missingElementsStarts,
              missingElementsEnds)) {
            requestor.accept(
                guessedType.capture(scope, typeRef.sourceEnd),
                missingElements,
                missingElementsStarts,
                missingElementsEnds,
                this.problemFactory.hasAllowedProblems);
          }
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.