Examples of TypeBinding


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

   * or inserted a generic cast, the converted type will differ from the resolved type (surface side-effects from
   * #computeConversion(...)).
   * @return the type after implicit conversion
   */
  public TypeBinding postConversionType(Scope scope) {
    TypeBinding convertedType = this.resolvedType;
    int runtimeType = (this.implicitConversion & TypeIds.IMPLICIT_CONVERSION_MASK) >> 4;
    switch (runtimeType) {
      case T_boolean :
        convertedType = TypeBinding.BOOLEAN;
        break;
View Full Code Here

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

  public TypeBinding resolveTypeExpecting(
    BlockScope scope,
    TypeBinding expectedType) {

    this.setExpectedType(expectedType); // needed in case of generic method invocation
    TypeBinding expressionType = this.resolveType(scope);
    if (expressionType == null) return null;
    if (expressionType == expectedType) return expressionType;
   
    if (!expressionType.isCompatibleWith(expectedType)) {
      if (scope.isBoxingCompatibleWith(expressionType, expectedType)) {
        this.computeConversion(scope, expectedType, expressionType);
      } else {
        scope.problemReporter().typeMismatchError(expressionType, expectedType, this);
        return null;
View Full Code Here

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

   
    if (this.resolvedType != null) return this.resolvedType;
    if (dimensions > 255) {
      scope.problemReporter().tooManyDimensions(this);
    }
    TypeBinding leafComponentType = scope.getType(token);
    return scope.createArrayType(leafComponentType, dimensions);
 
  }
View Full Code Here

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

    if (numberOfInnerClasses != 0) {
      ReferenceBinding[] innerClasses = new ReferenceBinding[numberOfInnerClasses];
      this.innerClassesBindings.toArray(innerClasses);
      Arrays.sort(innerClasses, new Comparator() {
        public int compare(Object o1, Object o2) {
          TypeBinding binding1 = (TypeBinding) o1;
          TypeBinding binding2 = (TypeBinding) o2;
          return CharOperation.compareTo(binding1.constantPoolName(), binding2.constantPoolName());
        }
      });
      // Generate the inner class attribute
      int exSize = 8 * numberOfInnerClasses + 8;
      if (exSize + contentsOffset >= this.contents.length) {
View Full Code Here

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

      LocalVariableBinding[] genericLocalVariables = null;
      int numberOfGenericEntries = 0;
     
      for (int i = 0, max = codeStream.allLocalsCounter; i < max; i++) {
        LocalVariableBinding localVariable = codeStream.locals[i];
        final TypeBinding localVariableTypeBinding = localVariable.type;
        boolean isParameterizedType = localVariableTypeBinding.isParameterizedType() || localVariableTypeBinding.isTypeVariable();
        if (localVariable.initializationCount != 0 && isParameterizedType) {
          if (genericLocalVariables == null) {
            // we cannot have more than max locals
            genericLocalVariables = new LocalVariableBinding[max];
          }
          genericLocalVariables[genericLocalVariablesCounter++] = localVariable;
        }
        for (int j = 0; j < localVariable.initializationCount; j++) {
          int startPC = localVariable.initializationPCs[j << 1];
          int endPC = localVariable.initializationPCs[(j << 1) + 1];
          if (startPC != endPC) { // only entries for non zero length
            if (endPC == -1) {
              localVariable.declaringScope.problemReporter().abortDueToInternalError(
                  Messages.bind(Messages.abort_invalidAttribute, new String(localVariable.name)),
                  (ASTNode) localVariable.declaringScope.methodScope().referenceContext);
            }
            if (isParameterizedType) {
              numberOfGenericEntries++;
            }
            // now we can safely add the local entry
            numberOfEntries++;
            this.contents[localContentsOffset++] = (byte) (startPC >> 8);
            this.contents[localContentsOffset++] = (byte) startPC;
            int length = endPC - startPC;
            this.contents[localContentsOffset++] = (byte) (length >> 8);
            this.contents[localContentsOffset++] = (byte) length;
            nameIndex = constantPool.literalIndex(localVariable.name);
            this.contents[localContentsOffset++] = (byte) (nameIndex >> 8);
            this.contents[localContentsOffset++] = (byte) nameIndex;
            descriptorIndex = constantPool.literalIndex(localVariableTypeBinding.signature());
            this.contents[localContentsOffset++] = (byte) (descriptorIndex >> 8);
            this.contents[localContentsOffset++] = (byte) descriptorIndex;
            int resolvedPosition = localVariable.resolvedPosition;
            this.contents[localContentsOffset++] = (byte) (resolvedPosition >> 8);
            this.contents[localContentsOffset++] = (byte) resolvedPosition;
View Full Code Here

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

        LocalVariableBinding[] genericLocalVariables = null;
        int numberOfGenericEntries = 0;

        for (int i = 0, max = codeStream.allLocalsCounter; i < max; i++) {
          LocalVariableBinding localVariable = codeStream.locals[i];
          final TypeBinding localVariableTypeBinding = localVariable.type;
          boolean isParameterizedType = localVariableTypeBinding.isParameterizedType() || localVariableTypeBinding.isTypeVariable();
          if (localVariable.initializationCount != 0 && isParameterizedType) {
            if (genericLocalVariables == null) {
              // we cannot have more than max locals
              genericLocalVariables = new LocalVariableBinding[max];
            }
            genericLocalVariables[genericLocalVariablesCounter++] = localVariable;
          }
          for (int j = 0; j < localVariable.initializationCount; j++) {
            int startPC = localVariable.initializationPCs[j << 1];
            int endPC = localVariable.initializationPCs[(j << 1) + 1];
            if (startPC != endPC) { // only entries for non zero length
              if (endPC == -1) {
                localVariable.declaringScope.problemReporter().abortDueToInternalError(
                  Messages.bind(Messages.abort_invalidAttribute, new String(localVariable.name)),
                  (ASTNode) localVariable.declaringScope.methodScope().referenceContext);
              }
              if (localContentsOffset + 10 >= this.contents.length) {
                resizeContents(10);
              }
              // now we can safely add the local entry
              numberOfEntries++;
              if (isParameterizedType) {
                numberOfGenericEntries++;
              }
              this.contents[localContentsOffset++] = (byte) (startPC >> 8);
              this.contents[localContentsOffset++] = (byte) startPC;
              int length = endPC - startPC;
              this.contents[localContentsOffset++] = (byte) (length >> 8);
              this.contents[localContentsOffset++] = (byte) length;
              nameIndex = constantPool.literalIndex(localVariable.name);
              this.contents[localContentsOffset++] = (byte) (nameIndex >> 8);
              this.contents[localContentsOffset++] = (byte) nameIndex;
              descriptorIndex = constantPool.literalIndex(localVariableTypeBinding.signature());
              this.contents[localContentsOffset++] = (byte) (descriptorIndex >> 8);
              this.contents[localContentsOffset++] = (byte) descriptorIndex;
              int resolvedPosition = localVariable.resolvedPosition;
              this.contents[localContentsOffset++] = (byte) (resolvedPosition >> 8);
              this.contents[localContentsOffset++] = (byte) resolvedPosition;
View Full Code Here

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

          argSize = methodDeclaringClass.enclosingInstancesSlotSize;
          SyntheticArgumentBinding[] syntheticArguments;
          if ((syntheticArguments = methodDeclaringClass.syntheticEnclosingInstances()) != null) {
            for (int i = 0, max = syntheticArguments.length; i < max; i++) {
              LocalVariableBinding localVariable = syntheticArguments[i];
              final TypeBinding localVariableTypeBinding = localVariable.type;
              if (localVariableTypeBinding.isParameterizedType() || localVariableTypeBinding.isTypeVariable()) {
                if (genericLocalVariables == null) {
                  // we cannot have more than max locals
                  genericLocalVariables = new LocalVariableBinding[max];
                }
                genericLocalVariables[genericLocalVariablesCounter++] = localVariable;
                numberOfGenericEntries++;               
              }
              if (localContentsOffset + 10 >= this.contents.length) {
                resizeContents(10);
              }
              // now we can safely add the local entry
              numberOfEntries++;
              this.contents[localContentsOffset++] = 0;
              this.contents[localContentsOffset++] = 0;
              this.contents[localContentsOffset++] = (byte) (code_length >> 8);
              this.contents[localContentsOffset++] = (byte) code_length;
              nameIndex = constantPool.literalIndex(localVariable.name);
              this.contents[localContentsOffset++] = (byte) (nameIndex >> 8);
              this.contents[localContentsOffset++] = (byte) nameIndex;
              descriptorIndex = constantPool.literalIndex(localVariableTypeBinding.signature());
              this.contents[localContentsOffset++] = (byte) (descriptorIndex >> 8);
              this.contents[localContentsOffset++] = (byte) descriptorIndex;
              int resolvedPosition = localVariable.resolvedPosition;
              this.contents[localContentsOffset++] = (byte) (resolvedPosition >> 8);
              this.contents[localContentsOffset++] = (byte) resolvedPosition;
            }
          }
        } else {
          argSize = 1;
        }
      } else {
        argSize = binding.isStatic() ? 0 : 1;
      }
     
      int genericArgumentsCounter = 0;
      int[] genericArgumentsNameIndexes = null;
      int[] genericArgumentsResolvedPositions = null;
      TypeBinding[] genericArgumentsTypeBindings = null;

      if (method.binding != null) {
        TypeBinding[] parameters = method.binding.parameters;
        Argument[] arguments = method.arguments;
        if ((parameters != null) && (arguments != null)) {
          for (int i = 0, max = parameters.length; i < max; i++) {
            TypeBinding argumentBinding = parameters[i];
            if (localContentsOffset + 10 >= this.contents.length) {
              resizeContents(10);
            }
            // now we can safely add the local entry
            numberOfEntries++;
            this.contents[localContentsOffset++] = 0;
            this.contents[localContentsOffset++] = 0;
            this.contents[localContentsOffset++] = (byte) (code_length >> 8);
            this.contents[localContentsOffset++] = (byte) code_length;
            nameIndex = constantPool.literalIndex(arguments[i].name);
            this.contents[localContentsOffset++] = (byte) (nameIndex >> 8);
            this.contents[localContentsOffset++] = (byte) nameIndex;
            int resolvedPosition = argSize;
            if (argumentBinding.isParameterizedType() || argumentBinding.isTypeVariable()) {
              if (genericArgumentsCounter == 0) {
                // we cannot have more than max locals
                genericArgumentsNameIndexes = new int[max];
                genericArgumentsResolvedPositions = new int[max];
                genericArgumentsTypeBindings = new TypeBinding[max];
              }
              genericArgumentsNameIndexes[genericArgumentsCounter] = nameIndex;
              genericArgumentsResolvedPositions[genericArgumentsCounter] = resolvedPosition;
              genericArgumentsTypeBindings[genericArgumentsCounter++] = argumentBinding;
            }
            descriptorIndex = constantPool.literalIndex(argumentBinding.signature());
            this.contents[localContentsOffset++] = (byte) (descriptorIndex >> 8);
            this.contents[localContentsOffset++] = (byte) descriptorIndex;
            if ((argumentBinding == TypeBinding.LONG)
              || (argumentBinding == TypeBinding.DOUBLE))
              argSize += 2;
View Full Code Here

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

      LocalVariableBinding[] genericLocalVariables = null;
      int numberOfGenericEntries = 0;
     
      for (int i = 0, max = codeStream.allLocalsCounter; i < max; i++) {
        LocalVariableBinding localVariable = codeStream.locals[i];
        final TypeBinding localVariableTypeBinding = localVariable.type;
        boolean isParameterizedType = localVariableTypeBinding.isParameterizedType() || localVariableTypeBinding.isTypeVariable();
        if (localVariable.initializationCount != 0 && isParameterizedType) {
          if (genericLocalVariables == null) {
            // we cannot have more than max locals
            genericLocalVariables = new LocalVariableBinding[max];
          }
          genericLocalVariables[genericLocalVariablesCounter++] = localVariable;
        }
        for (int j = 0; j < localVariable.initializationCount; j++) {
          int startPC = localVariable.initializationPCs[j << 1];
          int endPC = localVariable.initializationPCs[(j << 1) + 1];
          if (startPC != endPC) { // only entries for non zero length
            if (endPC == -1) {
              localVariable.declaringScope.problemReporter().abortDueToInternalError(
                Messages.bind(Messages.abort_invalidAttribute, new String(localVariable.name)),
                (ASTNode) localVariable.declaringScope.methodScope().referenceContext);
            }
            if (localContentsOffset + 10 > this.contents.length) {
              resizeContents(10);
            }
            // now we can safely add the local entry
            numberOfEntries++;
            if (isParameterizedType) {
              numberOfGenericEntries++;
            }
            contents[localContentsOffset++] = (byte) (startPC >> 8);
            contents[localContentsOffset++] = (byte) startPC;
            int length = endPC - startPC;
            contents[localContentsOffset++] = (byte) (length >> 8);
            contents[localContentsOffset++] = (byte) length;
            nameIndex = constantPool.literalIndex(localVariable.name);
            contents[localContentsOffset++] = (byte) (nameIndex >> 8);
            contents[localContentsOffset++] = (byte) nameIndex;
            descriptorIndex = constantPool.literalIndex(localVariableTypeBinding.signature());
            contents[localContentsOffset++] = (byte) (descriptorIndex >> 8);
            contents[localContentsOffset++] = (byte) descriptorIndex;
            int resolvedPosition = localVariable.resolvedPosition;
            contents[localContentsOffset++] = (byte) (resolvedPosition >> 8);
            contents[localContentsOffset++] = (byte) resolvedPosition;
View Full Code Here

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

  private void generateAnnotation(Annotation annotation, int attributeOffset) {
    if (contentsOffset + 4 >= this.contents.length) {
      resizeContents(4);
    }
    TypeBinding annotationTypeBinding = annotation.resolvedType;
    if (annotationTypeBinding == null) {
      this.contentsOffset = attributeOffset;
      return;
    }
    final int typeIndex = constantPool.literalIndex(annotationTypeBinding.signature());
    contents[contentsOffset++] = (byte) (typeIndex >> 8);
    contents[contentsOffset++] = (byte) typeIndex;
    if (annotation instanceof NormalAnnotation) {
      NormalAnnotation normalAnnotation = (NormalAnnotation) annotation;
      MemberValuePair[] memberValuePairs = normalAnnotation.memberValuePairs;
View Full Code Here

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

  private void generateElementValue(
      Expression defaultValue,
      TypeBinding memberValuePairReturnType,
      int attributeOffset) {
    Constant constant = defaultValue.constant;
    TypeBinding defaultValueBinding = defaultValue.resolvedType;
    if (defaultValueBinding == null) {
      contentsOffset = attributeOffset;
    } else {
      if (memberValuePairReturnType.isArrayType() && !defaultValueBinding.isArrayType()) {
        // automatic wrapping
        if (contentsOffset + 3 >= this.contents.length) {
          resizeContents(3);
        }
        contents[contentsOffset++] = (byte) '[';
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.