Examples of ObjectVector


Examples of org.eclipse.jdt.internal.compiler.util.ObjectVector

      }
    } else if (qualifiedBinding instanceof VariableBinding) {
      setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition);
      TypeBinding receiverType = ((VariableBinding) qualifiedBinding).type;
      if (receiverType != null && (receiverType.tagBits & TagBits.HasMissingType) == 0) {
        ObjectVector fieldsFound = new ObjectVector();
        ObjectVector methodsFound = new ObjectVector();

        findFieldsAndMethods(
            this.completionToken,
            receiverType.capture(scope, ref.sourceEnd),
            scope,
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.util.ObjectVector

      }
    } else if (qualifiedBinding instanceof ReferenceBinding && !(qualifiedBinding instanceof TypeVariableBinding)) {
      if (!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) {
        setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition);

        ObjectVector typesFound = new ObjectVector();

        if (this.assistNodeIsException && astNodeParent instanceof TryStatement) {
          findExceptionFromTryStatement(
              this.completionToken,
              (ReferenceBinding)qualifiedBinding,
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.util.ObjectVector

      if (!this.requestor.isIgnored(CompletionProposal.FIELD_REF)) {
        this.assistNodeIsEnum = true;
        findEnumConstantsFromSwithStatement(this.completionToken, (SwitchStatement) astNodeParent);
      }
    } else if (this.expectedTypesPtr > -1 && this.expectedTypes[0].isAnnotationType()) {
      findTypesAndPackages(this.completionToken, scope, false, false, new ObjectVector());
    } else {
      if (this.expectedTypesPtr > -1) {
        this.assistNodeIsEnum = true;
        done : for (int i = 0; i <= this.expectedTypesPtr; i++) {
          if (!this.expectedTypes[i].isEnum()) {
            this.assistNodeIsEnum = false;
            break done;
          }
        }

      }
      if (scope instanceof BlockScope && !this.requestor.isIgnored(CompletionProposal.LOCAL_VARIABLE_REF)) {
        char[][] alreadyDefinedName = computeAlreadyDefinedName((BlockScope)scope, singleNameReference);

        findUnresolvedReference(
            singleNameReference.sourceStart,
            singleNameReference.sourceEnd,
            (BlockScope)scope,
            alreadyDefinedName);
      }
     
      checkCancel();
     
      findVariablesAndMethods(
        this.completionToken,
        scope,
        singleNameReference,
        scope,
        insideTypeAnnotation,
        singleNameReference.isInsideAnnotationAttribute);
     
      checkCancel();
     
      // can be the start of a qualified type name
      findTypesAndPackages(this.completionToken, scope, true, false, new ObjectVector());
      if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
        if (this.completionToken != null && this.completionToken.length != 0) {
          findKeywords(this.completionToken, singleNameReference.possibleKeywords, false, false);
        } else {
          findTrueOrFalseKeywords(singleNameReference.possibleKeywords);
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.util.ObjectVector

              astNodeParent instanceof ParameterizedQualifiedTypeReference)) {
        this.setSourceAndTokenRange(astNode.sourceStart, astNode.sourceStart - 1, false);

        findParameterizedType((TypeReference)astNodeParent, scope);
      } else {
        ObjectVector typesFound = new ObjectVector();
        if (this.assistNodeIsException && astNodeParent instanceof TryStatement) {
          findExceptionFromTryStatement(
              this.completionToken,
              null,
              scope.enclosingSourceType(),
              (BlockScope)scope,
              typesFound);
        }
       
        checkCancel();
       
        findTypesAndPackages(this.completionToken, scope, this.assistNodeIsConstructor, false, typesFound);
      }
    } else if (!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) {
      findMemberTypes(
        this.completionToken,
        (ReferenceBinding) qualifiedBinding,
        scope,
        scope.enclosingSourceType(),
        false,
        false,
        false,
        false,
        !this.assistNodeIsConstructor,
        null,
        new ObjectVector(),
        null,
        null,
        null,
        false);
    }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.util.ObjectVector

      findEnumConstants(
          enumConstantName,
          enumType,
          null /* doesn't need invocation scope */,
          new ObjectVector(),
          alreadyUsedConstants,
          alreadyUsedConstantCount,
          false);
    }
  }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.util.ObjectVector

    boolean missingElementsHaveProblems,
    char[] castedReceiver,
    int receiverStart,
    int receiverEnd) {

    ObjectVector newFieldsFound = new ObjectVector();
    // if the proposal is being asked inside a field's initialization, we'll record its id
    int fieldBeingCompletedId = -1;
    boolean isFieldBeingCompletedStatic = false;
    for (int f = fields.length; --f >=0;) {
      FieldBinding field = fields[f];
      FieldDeclaration fieldDeclaration = field.sourceField();
      // We maybe asking for a proposal inside this field's initialization. So record its id
      ASTNode astNode = this.parser.assistNode;
      if (fieldDeclaration != null && fieldDeclaration.initialization != null && astNode != null) {
        if (fieldDeclaration.initialization.sourceEnd > 0) {
          if (fieldDeclaration.initialization.sourceStart <= astNode.sourceStart &&
            astNode.sourceEnd <= fieldDeclaration.initialization.sourceEnd) {
            // completion is inside a field initializer
            fieldBeingCompletedId = field.id;
            isFieldBeingCompletedStatic = field.isStatic();
            break;
          }
        } else { // The sourceEnd may not yet be set
          CompletionNodeDetector detector = new CompletionNodeDetector(astNode, fieldDeclaration.initialization);
          if (detector.containsCompletionNode()) {  // completion is inside a field initializer
            fieldBeingCompletedId = field.id;
            isFieldBeingCompletedStatic = field.isStatic();
            break;
          }
        }
      }
    }
    // Inherited fields which are hidden by subclasses are filtered out
    // No visibility checks can be performed without the scope & invocationSite

    int fieldLength = fieldName.length;
    next : for (int f = fields.length; --f >= 0;) {
      FieldBinding field = fields[f];
     
      // Content assist invoked inside some field's initialization.
      // bug 310427 and 325481
      if (fieldBeingCompletedId >= 0 && field.id >= fieldBeingCompletedId) {
        // Don't propose field which is being declared currently
        // Don't propose fields declared after the current field declaration statement
        // Though, if field is static, then it can be still be proposed
        if (!field.isStatic()) {
          continue next;
        } else if (isFieldBeingCompletedStatic) {
          // static fields can't be proposed before they are actually declared if the
          // field currently being declared is also static
          continue next;
        }
      }
     
      if (field.isSynthetic())  continue next;

      if (onlyStaticFields && !field.isStatic()) continue next;

      if (fieldLength > field.name.length) continue next;

      if (!CharOperation.prefixEquals(fieldName, field.name, false /* ignore case */)
          && !(this.options.camelCaseMatch && CharOperation.camelCaseMatch(fieldName, field.name)))  continue next;

      if (this.options.checkDeprecation &&
          field.isViewedAsDeprecated() &&
          !scope.isDefinedInSameUnit(field.declaringClass))
        continue next;

      if (this.options.checkVisibility
        && !field.canBeSeenBy(receiverType, invocationSite, scope))  continue next;
     
      // don't propose non constant fields or strings (1.6 or below) in case expression
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=195346
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=343342
      if (this.assistNodeIsInsideCase) {
        if (field.isFinal() && field.isStatic()) {
          if (this.assistNodeIsString){
            if (field.type == null || field.type.id != TypeIds.T_JavaLangString)
              continue next;
          } else if (!(field.type instanceof BaseTypeBinding))
            continue next;
        } else {
          continue next; // non-constants not allowed in case. 
        }
      }

      boolean prefixRequired = false;

      for (int i = fieldsFound.size; --i >= 0;) {
        Object[] other = (Object[])fieldsFound.elementAt(i);
        FieldBinding otherField = (FieldBinding) other[0];
        ReferenceBinding otherReceiverType = (ReferenceBinding) other[1];
        if (field == otherField && receiverType == otherReceiverType)
          continue next;
        if (CharOperation.equals(field.name, otherField.name, true)) {
          if (field.declaringClass.isSuperclassOf(otherField.declaringClass))
            continue next;
          if (otherField.declaringClass.isInterface()) {
            if (field.declaringClass == scope.getJavaLangObject())
              continue next;
            if (field.declaringClass.implementsInterface(otherField.declaringClass, true))
              continue next;
          }
          if (field.declaringClass.isInterface())
            if (otherField.declaringClass.implementsInterface(field.declaringClass, true))
              continue next;
          if(canBePrefixed) {
            prefixRequired = true;
          } else {
            continue next;
          }
        }
      }

      for (int l = localsFound.size; --l >= 0;) {
        LocalVariableBinding local = (LocalVariableBinding) localsFound.elementAt(l);

        if (CharOperation.equals(field.name, local.name, true)) {
          SourceTypeBinding declarationType = scope.enclosingSourceType();
          if (declarationType.isAnonymousType() && declarationType != invocationScope.enclosingSourceType()) {
            continue next;
          }
          if(canBePrefixed) {
            prefixRequired = true;
          } else {
            continue next;
          }
          break;
        }
      }

      newFieldsFound.add(new Object[]{field, receiverType});

      char[] completion = field.name;

      if(prefixRequired || this.options.forceImplicitQualification){
        char[] prefix = computePrefix(scope.enclosingSourceType(), invocationScope.enclosingSourceType(), field.isStatic());
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.util.ObjectVector

      findFields(
        token,
        (ReferenceBinding) receiverType,
        scope,
        fieldsFound,
        new ObjectVector(),
        false,
        invocationSite,
        invocationScope,
        implicitCall,
        false,
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.util.ObjectVector

      Scope invocationScope,
      ObjectVector localsFound,
      ObjectVector fieldsFound,
      ObjectVector methodsFound) {

    ObjectVector methodsFoundFromFavorites = new ObjectVector();

    ImportBinding[] favoriteBindings = getFavoriteReferenceBindings(invocationScope);

    if (favoriteBindings != null && favoriteBindings.length > 0) {
      for (int i = 0; i < favoriteBindings.length; i++) {
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.util.ObjectVector

            boolean hasProblems) {
          findFieldsAndMethods(
            CompletionEngine.this.completionToken,
            guessedType,
            scope,
            new ObjectVector(),
            new ObjectVector(),
            invocationSite,
            invocationScope,
            false,
            false,
            missingElements,
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.util.ObjectVector

    ObjectVector methodsFound,
    //  boolean noVoidReturnType, how do you know?
    boolean exactMatch,
    ReferenceBinding receiverType) {

    ObjectVector newMethodsFound =  new ObjectVector();
    // Inherited methods which are hidden by subclasses are filtered out
    // No visibility checks can be performed without the scope & invocationSite
    int methodLength = methodName.length;
    next : for (int f = methods.length; --f >= 0;) {

      MethodBinding method = methods[f];
      if (method.isSynthetic())  continue next;

      if (method.isDefaultAbstract()) continue next;

      if (method.isConstructor()) continue next;

      if (method.isFinal()) {
                newMethodsFound.add(method);
                continue next;
            }

      if (this.options.checkDeprecation &&
          method.isViewedAsDeprecated() &&
          !scope.isDefinedInSameUnit(method.declaringClass))
        continue next;

      //    if (noVoidReturnType && method.returnType == BaseTypes.VoidBinding) continue next;
      if(method.isStatic()) continue next;

      if (!method.canBeSeenBy(receiverType, FakeInvocationSite , scope)) continue next;

      if (exactMatch) {
        if (!CharOperation.equals(methodName, method.selector, false /* ignore case */
          ))
          continue next;

      } else {

        if (methodLength > method.selector.length)
          continue next;

        if (!CharOperation.prefixEquals(methodName, method.selector, false/* ignore case */)
            && !(this.options.camelCaseMatch && CharOperation.camelCaseMatch(methodName, method.selector)))
          continue next;
      }

      for (int i = methodsFound.size; --i >= 0;) {
        MethodBinding otherMethod = (MethodBinding) methodsFound.elementAt(i);
        if (method == otherMethod)
          continue next;

        if (CharOperation.equals(method.selector, otherMethod.selector, true)
            && this.lookupEnvironment.methodVerifier().isMethodSubsignature(otherMethod, method)) {
          continue next;
        }
      }

      newMethodsFound.add(method);

      int length = method.parameters.length;
      char[][] parameterPackageNames = new char[length][];
      char[][] parameterFullTypeNames = new char[length][];

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.