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

Examples of org.eclipse.jdt.internal.compiler.lookup.FieldBinding.canBeSeenBy()


  }
}
public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired) {
  boolean isStatic;
  FieldBinding codegenBinding = this.binding.original();
  if (codegenBinding.canBeSeenBy(this.actualReceiverType, this, currentScope)) {
    super.generatePostIncrement(currentScope, codeStream, postIncrement, valueRequired);
  } else {
    this.receiver.generateCode(currentScope, codeStream, !(isStatic = codegenBinding.isStatic()));
    if (isStatic) {
      codeStream.aconst_null();
View Full Code Here


  if ((this.bits & Binding.VARIABLE) == 0) { // nothing to do if type ref
    codeStream.recordPositionsFrom(pc, this.sourceStart);
    return;
  }
  FieldBinding lastFieldBinding = this.otherBindings == null ? (FieldBinding) this.binding : this.otherBindings[this.otherBindings.length-1];
  if (lastFieldBinding.canBeSeenBy(getFinalReceiverType(), this, currentScope)) {
    super.generateCode(currentScope, codeStream, valueRequired);
    return;
  }
  lastFieldBinding = generateReadSequence(currentScope, codeStream);
  if (lastFieldBinding != null) {
View Full Code Here

/**
* Check and/or redirect the field access to the delegate receiver if any
*/
public void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired) {
    FieldBinding lastFieldBinding = this.otherBindings == null ? (FieldBinding) this.binding : this.otherBindings[this.otherBindings.length-1];
  if (lastFieldBinding.canBeSeenBy(getFinalReceiverType(), this, currentScope)) {
    super.generateAssignment(currentScope, codeStream, assignment, valueRequired);
    return;
  }
  lastFieldBinding = generateReadSequence(currentScope, codeStream);
  codeStream.generateEmulationForField(lastFieldBinding);
View Full Code Here

  }
}

public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeStream, Expression expression, int operator, int assignmentImplicitConversion, boolean valueRequired) {
    FieldBinding lastFieldBinding = this.otherBindings == null ? (FieldBinding) this.binding : this.otherBindings[this.otherBindings.length-1];
  if (lastFieldBinding.canBeSeenBy(getFinalReceiverType(), this, currentScope)) {
    super.generateCompoundAssignment(currentScope, codeStream, expression, operator, assignmentImplicitConversion, valueRequired);
    return;
  }
  lastFieldBinding = generateReadSequence(currentScope, codeStream);
  if (lastFieldBinding.isStatic()){
View Full Code Here

  // value field receiver value
  codeStream.generateEmulatedWriteAccessForField(lastFieldBinding);
}
public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired) {
    FieldBinding lastFieldBinding = this.otherBindings == null ? (FieldBinding) this.binding : this.otherBindings[this.otherBindings.length-1];
  if (lastFieldBinding.canBeSeenBy(getFinalReceiverType(), this, currentScope)) {
    super.generatePostIncrement(currentScope, codeStream, postIncrement, valueRequired);
    return;
  }
  lastFieldBinding = generateReadSequence(currentScope, codeStream);
  codeStream.generateEmulatedReadAccessForField(lastFieldBinding);
View Full Code Here

      // if first field is actually constant, we can inline it
      if (lastFieldBinding.constant() != Constant.NotAConstant) {
        break;
      }
      if (needValue) {
        if (lastFieldBinding.canBeSeenBy(this.actualReceiverType, this, currentScope)) {
          if (!lastFieldBinding.isStatic()) {
            if ((this.bits & DepthMASK) != 0) {
              ReferenceBinding targetType = currentScope.enclosingSourceType().enclosingTypeAt((this.bits & DepthMASK) >> DepthSHIFT);
              Object[] emulationPath = currentScope.getEmulationPath(targetType, true /*only exact match*/, false/*consider enclosing arg*/);
              codeStream.generateOuterAccess(emulationPath, this, targetType, currentScope);
View Full Code Here

      if (field.isSynthetic()) continue next;

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

      if (!field.canBeSeenBy(receiverType, invocationSite, scope)) continue next;

      for (int i = fieldsFound.size; --i >= 0;) {
        FieldBinding otherField = (FieldBinding) fieldsFound.elementAt(i);
        if (CharOperation.equals(field.name, otherField.name, true)) {
          continue next;
View Full Code Here

      if (field.isSynthetic()) continue next;

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

      if (!field.canBeSeenBy(receiverType, invocationSite, scope)) continue next;

      for (int i = fieldsFound.size; --i >= 0;) {
        FieldBinding otherField = (FieldBinding) fieldsFound.elementAt(i);
        if (CharOperation.equals(field.name, otherField.name, true)) {
          continue next;
View Full Code Here

  if ((this.bits & Binding.VARIABLE) == 0) { // nothing to do if type ref
    codeStream.recordPositionsFrom(pc, this.sourceStart);
    return;
  }
  FieldBinding lastFieldBinding = this.otherBindings == null ? (FieldBinding) this.binding : this.otherBindings[this.otherBindings.length-1];
  if (lastFieldBinding.canBeSeenBy(getFinalReceiverType(), this, currentScope)) {
    super.generateCode(currentScope, codeStream, valueRequired);
    return;
  }
  lastFieldBinding = generateReadSequence(currentScope, codeStream);
  if (lastFieldBinding != null) {
View Full Code Here

/**
* Check and/or redirect the field access to the delegate receiver if any
*/
public void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired) {
    FieldBinding lastFieldBinding = this.otherBindings == null ? (FieldBinding) this.binding : this.otherBindings[this.otherBindings.length-1];
  if (lastFieldBinding.canBeSeenBy(getFinalReceiverType(), this, currentScope)) {
    super.generateAssignment(currentScope, codeStream, assignment, valueRequired);
    return;
  }
  lastFieldBinding = generateReadSequence(currentScope, codeStream);
  codeStream.generateEmulationForField(lastFieldBinding);
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.