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

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


        Argument[] arguments = methodDeclaration.arguments;
        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(
View Full Code Here


    Argument[] args = method.arguments;
    if (args != null) {
      int length = args.length;
      String[] signatures = new String[length];
      for (int i = 0; i < args.length; i++) {
        Argument arg = args[i];
        signatures[i] = typeSignature(arg.type);
      }
      return signatures;
    }
    return CharOperation.NO_STRINGS;
View Full Code Here

private LocalVariable[] acceptMethodParameters(Argument[] arguments, JavaElement methodHandle, MethodInfo methodInfo) {
  if (arguments == null) return null;
  LocalVariable[] result = new LocalVariable[arguments.length];
  Annotation[][] paramAnnotations = new Annotation[arguments.length][];
  for(int i = 0; i < arguments.length; i++) {
    Argument argument = arguments[i];
    AnnotatableInfo localVarInfo = new AnnotatableInfo();
    localVarInfo.setSourceRangeStart(argument.declarationSourceStart);
    localVarInfo.setSourceRangeEnd(argument.declarationSourceStart);
    localVarInfo.setNameSourceStart(argument.sourceStart);
    localVarInfo.setNameSourceEnd(argument.sourceEnd);
View Full Code Here

          }
        }
        for (int i=0; i<paramLen; i++) {
          info = inheritedNonNullnessInfos[i+1];
          if (!info.complained && info.inheritedNonNullness != null) {
            Argument currentArg = srcMethod == null ? null : srcMethod.arguments[i];
            recordArgNonNullness(currentMethod, paramLen, i, currentArg, info.inheritedNonNullness);
          }
        }

      }
View Full Code Here

      length = currentMethod.parameterNonNullness.length;

    for (int i = 0; i < length; i++) {
      if (currentMethod.parameters[i].isBaseType()) continue;

      Argument currentArgument = currentArguments == null
                    ? null : currentArguments[i];
      Boolean inheritedNonNullNess = (inheritedMethod.parameterNonNullness == null)
                    ? null : inheritedMethod.parameterNonNullness[i];
      Boolean currentNonNullNess = (currentMethod.parameterNonNullness == null)
                    ? null : currentMethod.parameterNonNullness[i];
View Full Code Here

    final int INVISIBLE_INDEX = 1;
    int invisibleParametersAnnotationsCounter = 0;
    int visibleParametersAnnotationsCounter = 0;
    int[][] annotationsCounters = new int[argumentsLength][2];
    for (int i = 0; i < argumentsLength; i++) {
      Argument argument = arguments[i];
      Annotation[] annotations = argument.annotations;
      if (annotations != null) {
        for (int j = 0, max2 = annotations.length; j < max2; j++) {
          Annotation annotation = annotations[j];
          if (annotation.isRuntimeInvisible()) {
            annotationsCounters[i][INVISIBLE_INDEX]++;
            invisibleParametersAnnotationsCounter++;
          } else if (annotation.isRuntimeVisible()) {
            annotationsCounters[i][VISIBLE_INDEX]++;
            visibleParametersAnnotationsCounter++;
          }
        }
      }
    }
    int attributesNumber = 0;
    int annotationAttributeOffset = this.contentsOffset;
    if (invisibleParametersAnnotationsCounter != 0) {
      int globalCounter = 0;
      if (this.contentsOffset + 7 >= this.contents.length) {
        resizeContents(7);
      }
      int attributeNameIndex =
        this.constantPool.literalIndex(AttributeNamesConstants.RuntimeInvisibleParameterAnnotationsName);
      this.contents[this.contentsOffset++] = (byte) (attributeNameIndex >> 8);
      this.contents[this.contentsOffset++] = (byte) attributeNameIndex;
      int attributeLengthOffset = this.contentsOffset;
      this.contentsOffset += 4; // leave space for the attribute length

      this.contents[this.contentsOffset++] = (byte) argumentsLength;
      for (int i = 0; i < argumentsLength; i++) {
        if (this.contentsOffset + 2 >= this.contents.length) {
          resizeContents(2);
        }
        if (invisibleParametersAnnotationsCounter == 0) {
          this.contents[this.contentsOffset++] = (byte) 0;
          this.contents[this.contentsOffset++] = (byte) 0;
        } else {
          final int numberOfInvisibleAnnotations = annotationsCounters[i][INVISIBLE_INDEX];
          int invisibleAnnotationsOffset = this.contentsOffset;
          // leave space for number of annotations
          this.contentsOffset += 2;
          int counter = 0;
          if (numberOfInvisibleAnnotations != 0) {
            Argument argument = arguments[i];
            Annotation[] annotations = argument.annotations;
            for (int j = 0, max = annotations.length; j < max; j++) {
              Annotation annotation = annotations[j];
              if (annotation.isRuntimeInvisible()) {
                int currentAnnotationOffset = this.contentsOffset;
                generateAnnotation(annotation, currentAnnotationOffset);
                if (this.contentsOffset != currentAnnotationOffset) {
                  counter++;
                  globalCounter++;
                }
                invisibleParametersAnnotationsCounter--;
              }
            }
          }
          this.contents[invisibleAnnotationsOffset++] = (byte) (counter >> 8);
          this.contents[invisibleAnnotationsOffset] = (byte) counter;
        }
      }
      if (globalCounter != 0) {
        int attributeLength = this.contentsOffset - attributeLengthOffset - 4;
        this.contents[attributeLengthOffset++] = (byte) (attributeLength >> 24);
        this.contents[attributeLengthOffset++] = (byte) (attributeLength >> 16);
        this.contents[attributeLengthOffset++] = (byte) (attributeLength >> 8);
        this.contents[attributeLengthOffset++] = (byte) attributeLength;
        attributesNumber++;
      } else {
        // if globalCounter is 0, this means that the code generation for all visible annotations failed
        this.contentsOffset = annotationAttributeOffset;
      }
    }
    if (visibleParametersAnnotationsCounter != 0) {
      int globalCounter = 0;
      if (this.contentsOffset + 7 >= this.contents.length) {
        resizeContents(7);
      }
      int attributeNameIndex =
        this.constantPool.literalIndex(AttributeNamesConstants.RuntimeVisibleParameterAnnotationsName);
      this.contents[this.contentsOffset++] = (byte) (attributeNameIndex >> 8);
      this.contents[this.contentsOffset++] = (byte) attributeNameIndex;
      int attributeLengthOffset = this.contentsOffset;
      this.contentsOffset += 4; // leave space for the attribute length

      this.contents[this.contentsOffset++] = (byte) argumentsLength;
      for (int i = 0; i < argumentsLength; i++) {
        if (this.contentsOffset + 2 >= this.contents.length) {
          resizeContents(2);
        }
        if (visibleParametersAnnotationsCounter == 0) {
          this.contents[this.contentsOffset++] = (byte) 0;
          this.contents[this.contentsOffset++] = (byte) 0;
        } else {
          final int numberOfVisibleAnnotations = annotationsCounters[i][VISIBLE_INDEX];
          int visibleAnnotationsOffset = this.contentsOffset;
          // leave space for number of annotations
          this.contentsOffset += 2;
          int counter = 0;
          if (numberOfVisibleAnnotations != 0) {
            Argument argument = arguments[i];
            Annotation[] annotations = argument.annotations;
            for (int j = 0, max = annotations.length; j < max; j++) {
              Annotation annotation = annotations[j];
              if (annotation.isRuntimeVisible()) {
                int currentAnnotationOffset = this.contentsOffset;
View Full Code Here

    if (this.declaringClass instanceof SourceTypeBinding) {
      SourceTypeBinding sourceType = (SourceTypeBinding) this.declaringClass;
      if (sourceType.scope != null) {
        AbstractMethodDeclaration methodDecl = sourceType.scope.referenceType().declarationOf(this);
        for (int i = 0; i < length; i++) {
          Argument argument = methodDecl.arguments[i];
          if (argument.annotations != null) {
            ASTNode.resolveAnnotations(methodDecl.scope, argument.annotations, argument.binding);
            allParameterAnnotations[i] = argument.binding.getAnnotations();
          } else {
            allParameterAnnotations[i] = Binding.NO_ANNOTATIONS;
View Full Code Here

  int argumentLength = arguments.length;
  char[][] argumentTypes = new char[argumentLength][];
  char[][] argumentNames = new char[argumentLength][];
  ParameterInfo[] parameterInfos = new ParameterInfo[argumentLength];
  for (int i = 0; i < argumentLength; i++) {
    Argument argument = arguments[i];
    argumentTypes[i] = CharOperation.concatWith(argument.type.getParameterizedTypeName(), '.');
    char[] name = argument.name;
    argumentNames[i] = name;
    ParameterInfo parameterInfo = new ParameterInfo();
    parameterInfo.declarationStart = argument.declarationSourceStart;
View Full Code Here

        if (methodDecl == null) return;
        TypeBinding [] parameterTypes = currentMethod.parameters;
        Argument[] arguments = methodDecl.arguments;
        for (int j = 0, size = currentMethod.parameters.length; j < size; j++) {
          TypeBinding parameterType = parameterTypes[j];
          Argument arg = arguments[j];
          if (parameterType.leafComponentType().isRawType()
            && compilerOptions.getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore
                && (arg.type.bits & ASTNode.IgnoreRawTypeCheck) == 0) {
            methodDecl.scope.problemReporter().rawTypeReference(arg.type, parameterType);
            }
View Full Code Here

  TypeBinding [] inheritedParameterTypes = inheritedMethod.parameters;
  Argument[] arguments = methodDecl.arguments;
  for (int j = 0, size = currentMethod.parameters.length; j < size; j++) {
    TypeBinding parameterType = parameterTypes[j];
    TypeBinding inheritedParameterType = inheritedParameterTypes[j];
    Argument arg = arguments[j];
    if (parameterType.leafComponentType().isRawType()) {
      if (inheritedParameterType.leafComponentType().isRawType()) {
        arg.binding.tagBits |= TagBits.ForcedToBeRawType;
      } else {
        if (compilerOptions.getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore
View Full Code Here

TOP

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

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.