Package org.eclipse.jdt.internal.compiler.lookup

Examples of org.eclipse.jdt.internal.compiler.lookup.FieldBinding


*/
public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo, boolean isReadAccess) {
  if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0return;
 
  // if field from parameterized type got found, use the original field at codegen time
  FieldBinding codegenBinding = this.binding.original();
  if (this.binding.isPrivate()) {
    if ((currentScope.enclosingSourceType() != codegenBinding.declaringClass)
        && this.binding.constant() == Constant.NotAConstant) {
      if (this.syntheticAccessors == null)
        this.syntheticAccessors = new MethodBinding[2];
View Full Code Here


    if (((CastExpression)this.receiver).expression.resolvedType == this.actualReceiverType) {
        scope.problemReporter().unnecessaryCast((CastExpression)this.receiver);
    }
  }
  // the case receiverType.isArrayType and token = 'length' is handled by the scope API
  FieldBinding fieldBinding = this.binding = scope.getField(this.actualReceiverType, this.token, this);
  if (!fieldBinding.isValidBinding()) {
    this.constant = Constant.NotAConstant;
    if (this.receiver.resolvedType instanceof ProblemReferenceBinding) {
      // problem already got signaled on receiver, do not report secondary problem
      return null;
    }
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=245007 avoid secondary errors in case of
    // missing super type for anonymous classes ...
    ReferenceBinding declaringClass = fieldBinding.declaringClass;
    boolean avoidSecondary = declaringClass != null &&
                 declaringClass.isAnonymousType() &&
                 declaringClass.superclass() instanceof MissingTypeBinding;
    if (!avoidSecondary) {
      scope.problemReporter().invalidField(this, this.actualReceiverType);
    }
    if (fieldBinding instanceof ProblemFieldBinding) {
      ProblemFieldBinding problemFieldBinding = (ProblemFieldBinding) fieldBinding;
      FieldBinding closestMatch = problemFieldBinding.closestMatch;
      switch(problemFieldBinding.problemId()) {
        case ProblemReasons.InheritedNameHidesEnclosingName :
        case ProblemReasons.NotVisible :
        case ProblemReasons.NonStaticReferenceInConstructorInvocation :
        case ProblemReasons.NonStaticReferenceInStaticContext :
View Full Code Here

      }
    }

    public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) {
      try {
        FieldBinding b = fieldDeclaration.binding;
        SourceInfo info = makeSourceInfo(fieldDeclaration);
        JReferenceType enclosingType = (JReferenceType) typeMap.get(scope.enclosingSourceType());
        createField(info, b, enclosingType,
            fieldDeclaration.initialization != null);
        return true;
View Full Code Here

      }
    }

    JExpression processExpression(FieldReference x) {
      SourceInfo info = makeSourceInfo(x);
      FieldBinding fieldBinding = x.binding;
      JField field;
      if (fieldBinding.declaringClass == null) {
        // probably array.length
        field = program.getSpecialField("Array.length");
        if (!field.getName().equals(String.valueOf(fieldBinding.name))) {
View Full Code Here

       * each qualified by everything to the left. So each subsequent item in
       * otherBindings takes the current expression as a qualifier.
       */
      if (x.otherBindings != null) {
        for (int i = 0; i < x.otherBindings.length; i++) {
          FieldBinding fieldBinding = x.otherBindings[i];
          JField field;
          if (fieldBinding.declaringClass == null) {
            // probably array.length
            field = program.getSpecialField("Array.length");
            if (!field.getName().equals(String.valueOf(fieldBinding.name))) {
View Full Code Here

      }
    }

    private void checkFieldRef(JsniRef jsniRef, Set<String> errors) {
      assert jsniRef.isField();
      FieldBinding target = getField(jsniRef);
      if (target == null) {
        return;
      }
      if (containsLong(target.type)) {
        errors.add("Referencing field '" + jsniRef.className() + "."
View Full Code Here

      }
    }

    JExpression processExpression(FieldReference x) {
      SourceInfo info = makeSourceInfo(x);
      FieldBinding fieldBinding = x.binding;
      JField field;
      if (fieldBinding.declaringClass == null) {
        // probably array.length
        field = program.getIndexedField("Array.length");
        if (!field.getName().equals(String.valueOf(fieldBinding.name))) {
View Full Code Here

       * each qualified by everything to the left. So each subsequent item in
       * otherBindings takes the current expression as a qualifier.
       */
      if (x.otherBindings != null) {
        for (int i = 0; i < x.otherBindings.length; ++i) {
          FieldBinding fieldBinding = x.otherBindings[i];
          JField field;
          if (fieldBinding.declaringClass == null) {
            // probably array.length
            field = program.getIndexedField("Array.length");
            if (!field.getName().equals(String.valueOf(fieldBinding.name))) {
View Full Code Here

    }

    @Override
    public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) {
      try {
        FieldBinding b = fieldDeclaration.binding;
        SourceInfo info = makeSourceInfo(fieldDeclaration);
        JReferenceType enclosingType = (JReferenceType) typeMap.get(scope.enclosingSourceType());
        Expression initialization = fieldDeclaration.initialization;
        if (initialization != null
            && initialization instanceof AllocationExpression
View Full Code Here

            //noinspection VariableNotUsedInsideIf
            if (lvb.type != null) {
                return new EcjResolvedVariable(lvb);
            }
        } else if (binding instanceof FieldBinding) {
            FieldBinding fb = (FieldBinding) binding;
            if (fb instanceof ProblemFieldBinding) {
                return null;
            }
            if (fb.type != null && fb.declaringClass != null) {
                return new EcjResolvedField(fb);
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.lookup.FieldBinding

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.