Examples of FieldBinding


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

  // iteration on each field 
  while (index < length) {
    char[] token = this.tokens[index];
    if (type == null) return null; // could not resolve type prior to this point
    FieldBinding field = scope.getField(type, token, this);
    int place = index - this.indexOfFirstFieldBinding;
    this.otherBindings[place] = field;
    if (!field.isValidBinding()) {
      // try to retrieve the field as private field
      CodeSnippetScope localScope = new CodeSnippetScope(scope);
      if (this.delegateThis == null) {
        if (this.evaluationContext.declaringTypeName != null) {
          this.delegateThis = scope.getField(scope.enclosingSourceType(), DELEGATE_THIS, this);
          if (this.delegateThis == null){  // if not found then internal error, field should have been found
            return super.reportError(scope);
          }
        } else {
          this.constant = Constant.NotAConstant; //don't fill other constants slots...
          scope.problemReporter().invalidField(this, field, index, type);
          return null;
        }
      }
      field = localScope.getFieldForCodeSnippet(this.delegateThis.type, token, this);
      this.otherBindings[place] = field;
    }
    if (field.isValidBinding()) {
      // only last field is actually a write access if any
      if (isFieldUseDeprecated(field, scope, (this.bits & IsStrictlyAssigned) !=0 && index+1 == length)) {
        scope.problemReporter().deprecatedField(field, this);
      }
      // constant propagation can only be performed as long as the previous one is a constant too.
      if (this.constant != Constant.NotAConstant){
        this.constant = field.constant();
      }
      type = field.type;
      index++;
    } else {
      this.constant = Constant.NotAConstant; //don't fill other constants slots...
View Full Code Here

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

  }

  if ((this.binding instanceof ProblemFieldBinding && ((ProblemFieldBinding) this.binding).problemId() == NotFound)
    || (this.binding instanceof ProblemBinding && ((ProblemBinding) this.binding).problemId() == NotFound)){
    // will not support innerclass emulation inside delegate
    FieldBinding fieldBinding = scope.getField(this.delegateThis.type, this.tokens[0], this);
    if (!fieldBinding.isValidBinding()) {
      if (((ProblemFieldBinding) fieldBinding).problemId() == NotVisible) {
        // manage the access to a private field of the enclosing type
        CodeSnippetScope localScope = new CodeSnippetScope(scope);
        this.codegenBinding = this.binding = localScope.getFieldForCodeSnippet(this.delegateThis.type, this.tokens[0], this);
        if (this.binding.isValidBinding()) {
View Full Code Here

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

  ReferenceBinding currentType = (ReferenceBinding) receiverType;
  if (!currentType.canBeSeenBy(this))
    return new ProblemFieldBinding(currentType, fieldName, ProblemReasons.ReceiverTypeNotVisible);

  FieldBinding field = currentType.getField(fieldName, true /*resolve*/);
  if (field != null) {
    if (canBeSeenByForCodeSnippet(field, currentType, invocationSite, this))
      return field;
    else
      return new ProblemFieldBinding(field /* closest match*/, field.declaringClass, fieldName, ProblemReasons.NotVisible);
  }

  // collect all superinterfaces of receiverType until the field is found in a supertype
  ReferenceBinding[][] interfacesToVisit = null;
  int lastPosition = -1;
  FieldBinding visibleField = null;
  boolean keepLooking = true;
  boolean notVisible = false; // we could hold onto the not visible field for extra error reporting
  while (keepLooking) {
    ReferenceBinding[] itsInterfaces = currentType.superInterfaces();
    if (itsInterfaces != Binding.NO_SUPERINTERFACES) {
View Full Code Here

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

                ((ReferenceBinding)binding).closestMatch(),
                binding.problemId());
  }

  if ((mask & Binding.FIELD) != 0 && (binding instanceof FieldBinding)) { // was looking for a field and found a field
    FieldBinding field = (FieldBinding) binding;
    if (!field.isStatic()) {
      return new ProblemFieldBinding(
          field,
          field.declaringClass,
          CharOperation.concatWith(CharOperation.subarray(compoundName, 0, currentIndex), '.'),
          ProblemReasons.NonStaticReferenceInStaticContext);
View Full Code Here

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

  If no visible field is discovered, an error binding is answered.
*/

public FieldBinding getFieldForCodeSnippet(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite) {
  FieldBinding field = findFieldForCodeSnippet(receiverType, fieldName, invocationSite);
  if (field == null)
    return new ProblemFieldBinding(receiverType instanceof ReferenceBinding ? (ReferenceBinding) receiverType : null, fieldName, ProblemReasons.NotFound);
  else
    return field;
}
View Full Code Here

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

      }
    }

    FieldBinding[] fields = binding.fields();
    for (int i = 0, len = fields.length; i < len; i++) {
      FieldBinding f = fields[i];
      declaredFields.add(factory.makeResolvedMember(f));
    }

    this.declaredPointcuts = declaredPointcuts.toArray(new ResolvedPointcutDefinition[declaredPointcuts.size()]);
    this.declaredMethods = declaredMethods.toArray(new ResolvedMember[declaredMethods.size()]);
View Full Code Here

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

  }

  private AnnotationValue generateElementValueForNonConstantExpression(Expression defaultValue, TypeBinding defaultValueBinding) {
    if (defaultValueBinding != null) {
      if (defaultValueBinding.isEnum()) {
        FieldBinding fieldBinding = null;
        if (defaultValue instanceof QualifiedNameReference) {
          QualifiedNameReference nameReference = (QualifiedNameReference) defaultValue;
          fieldBinding = (FieldBinding) nameReference.binding;
        } else if (defaultValue instanceof SingleNameReference) {
          SingleNameReference nameReference = (SingleNameReference) defaultValue;
View Full Code Here

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

        // !!! understand and fix this case later
        receiverType = ref.otherBindings[0].declaringClass;
      }
      boolean cont = true; // don't continue if we come across a problem
      for (int i = 0, len = ref.otherBindings.length; i < len && cont; i++) {
        FieldBinding binding = ref.otherBindings[i];
        ref.otherBindings[i] = getAccessibleField(binding, receiverType);
        if (!(binding instanceof ProblemFieldBinding) && binding != null)
          receiverType = binding.type; // TODO Why is this sometimes null?
        else
          cont = false;
View Full Code Here

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

    }

    ResolvedMember m = world.makeResolvedMember(binding, receiverType);
    if (inAspect.accessForInline.containsKey(m))
      return (FieldBinding) inAspect.accessForInline.get(m);
    FieldBinding ret = new InlineAccessFieldBinding(inAspect, binding, m);

    // System.err.println("   made accessor: " + ret);

    inAspect.accessForInline.put(m, ret);
    return ret;
View Full Code Here

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

    EclipseFactory factory = ((AjLookupEnvironment) method.scope.environment()).factory;
    if (depthCounter != 0 && targetClass.isInterface()) {// pr198196 - when calling MarkerInterface.super.XXX()
      if (call.isSuperAccess() && !call.binding.isStatic()) {
        MethodScope currentMethodScope = scope.methodScope();
        SourceTypeBinding sourceType = currentMethodScope.enclosingSourceType();
        FieldBinding field = sourceType.addSyntheticFieldForInnerclass(targetClass);
        call.receiver = new KnownFieldReference(field, call.receiver.sourceStart, call.receiver.sourceEnd);
      } else {
        return;
      }
    } else if (depthCounter == 0) { // Allow case testSuperItds_pr198196_2/3
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.