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

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


                if (begin == -1) {
                  begin = i;
                }
                count++;
                if (count > ENUM_CONSTANTS_THRESHOLD) {
                  SyntheticMethodBinding syntheticMethod = declaringType.binding.addSyntheticMethodForEnumInitialization(begin, i);
                  codeStream.invoke(Opcodes.OPC_invokestatic, syntheticMethod, null /* default declaringClass */);
                  begin = i;
                  count = 0;
                }
              }
            }
          }
          if (count != 0) {
            // add last synthetic method
            SyntheticMethodBinding syntheticMethod = declaringType.binding.addSyntheticMethodForEnumInitialization(begin, max);
            codeStream.invoke(Opcodes.OPC_invokestatic, syntheticMethod, null /* default declaringClass */);
          }
        }
      } else if (fieldDeclarations != null) {
        for (int i = 0, max = fieldDeclarations.length; i < max; i++) {
View Full Code Here


            } else {
              // could occur if !valueRequired but compliance >= 1.4
              codeStream.pop();
            }
          } else {
            SyntheticMethodBinding accessor = this.syntheticReadAccessors == null ? null : this.syntheticReadAccessors[this.syntheticReadAccessors.length - 1];
            if (accessor == null) {
              TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, lastFieldBinding, getFinalReceiverType(), isFirst);
              if (isStatic) {
                codeStream.fieldAccess(Opcodes.OPC_getstatic, lastFieldBinding, constantPoolDeclaringClass);
              } else {
View Full Code Here

  reportOnlyUselesslyReadPrivateField(currentScope, lastFieldBinding, valueRequired);
  boolean isFirst = lastFieldBinding == this.binding
    && (this.indexOfFirstFieldBinding == 1 || lastFieldBinding.declaringClass == currentScope.enclosingReceiverType())
    && this.otherBindings == null; // could be dup: next.next.next
  TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, lastFieldBinding, getFinalReceiverType(), isFirst);     
  SyntheticMethodBinding accessor = this.syntheticReadAccessors == null ? null : this.syntheticReadAccessors[this.syntheticReadAccessors.length - 1];
  if (lastFieldBinding.isStatic()) {
    if (accessor == null) {
      codeStream.fieldAccess(Opcodes.OPC_getstatic, lastFieldBinding, constantPoolDeclaringClass);
    } else {
      codeStream.invoke(Opcodes.OPC_invokestatic, accessor, null /* default declaringClass */);
 
View Full Code Here

  reportOnlyUselesslyReadPrivateField(currentScope, lastFieldBinding, valueRequired);
  boolean isFirst = lastFieldBinding == this.binding
    && (this.indexOfFirstFieldBinding == 1 || lastFieldBinding.declaringClass == currentScope.enclosingReceiverType())
    && this.otherBindings == null; // could be dup: next.next.next
  TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, lastFieldBinding, getFinalReceiverType(), isFirst);     
  SyntheticMethodBinding accessor = this.syntheticReadAccessors == null
      ? null
      : this.syntheticReadAccessors[this.syntheticReadAccessors.length - 1];
  if (lastFieldBinding.isStatic()) {
    if (accessor == null) {
      codeStream.fieldAccess(Opcodes.OPC_getstatic, lastFieldBinding, constantPoolDeclaringClass);
View Full Code Here

    }
    // add synthetic methods infos
    SyntheticMethodBinding[] syntheticMethods = this.referenceBinding.syntheticMethods();
    if (syntheticMethods != null) {
      for (int i = 0, max = syntheticMethods.length; i < max; i++) {
        SyntheticMethodBinding syntheticMethod = syntheticMethods[i];
        switch (syntheticMethod.purpose) {
          case SyntheticMethodBinding.FieldReadAccess :
          case SyntheticMethodBinding.SuperFieldReadAccess :
            // generate a method info to emulate an reading access to
            // a non-accessible field
View Full Code Here

        type = (ReferenceBinding) b.type.erasure();
      } else {
        throw new InternalCompilerException("Unknown emulation path.");
      }
      for (int i = 1; i < path.length; ++i) {
        SyntheticMethodBinding b = (SyntheticMethodBinding) path[i];
        assert type == b.declaringClass.erasure();
        FieldBinding fieldBinding = b.targetReadField;
        JField field = typeMap.get(fieldBinding);
        assert field != null;
        ref = new JFieldRef(info, ref, field, curClass.classType);
View Full Code Here

        type = (ReferenceBinding) b.type.erasure();
      } else {
        throw new InternalCompilerException("Unknown emulation path.");
      }
      for (int i = 1; i < path.length; ++i) {
        SyntheticMethodBinding b = (SyntheticMethodBinding) path[i];
        assert type == b.declaringClass.erasure();
        FieldBinding fieldBinding = b.targetReadField;
        JField field = typeMap.get(fieldBinding);
        assert field != null;
        ref = new JFieldRef(info, ref, field, curClass.classType);
View Full Code Here

      continueScanningSynthetics = false;
      SyntheticMethodBinding[] syntheticMethods = this.referenceBinding.syntheticMethods();
      int currentSyntheticsCount = syntheticMethods == null ? 0: syntheticMethods.length;
      if (emittedSyntheticsCount != currentSyntheticsCount) {
        for (int i = emittedSyntheticsCount, max = currentSyntheticsCount; i < max; i++) {
          SyntheticMethodBinding syntheticMethod = syntheticMethods[i];
          switch (syntheticMethod.purpose) {
            case SyntheticMethodBinding.FieldReadAccess :
            case SyntheticMethodBinding.SuperFieldReadAccess :
              // generate a method info to emulate an reading access to
              // a non-accessible field
View Full Code Here

      attributesNumber += generateSignatureAttribute(genericSignature);
    }
    if (this.targetJDK >= ClassFileConstants.JDK1_4) {
      AbstractMethodDeclaration methodDeclaration = methodBinding.sourceMethod();
      if (methodBinding instanceof SyntheticMethodBinding) {
        SyntheticMethodBinding syntheticMethod = (SyntheticMethodBinding) methodBinding;
        if (syntheticMethod.purpose == SyntheticMethodBinding.SuperMethodAccess && CharOperation.equals(syntheticMethod.selector, syntheticMethod.targetMethod.selector))
          methodDeclaration = ((SyntheticMethodBinding)methodBinding).targetMethod.sourceMethod();
      }
      if (methodDeclaration != null) {
        Annotation[] annotations = methodDeclaration.annotations;
View Full Code Here

        type = (ReferenceBinding) b.type.erasure();
      } else {
        throw new InternalCompilerException("Unknown emulation path.");
      }
      for (int i = 1; i < path.length; ++i) {
        SyntheticMethodBinding b = (SyntheticMethodBinding) path[i];
        assert type == b.declaringClass.erasure();
        FieldBinding fieldBinding = b.targetReadField;
        JField field = typeMap.get(fieldBinding);
        assert field != null;
        ref = new JFieldRef(info, ref, field, curClass.classType);
View Full Code Here

TOP

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

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.