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

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


    if (binding instanceof FieldBinding) {
      FieldBinding fieldBinding = (FieldBinding) binding;
      if (!fieldBinding.isStatic()) return;
      refBinding = fieldBinding.declaringClass;
    } else if (binding instanceof MethodBinding) {
      MethodBinding methodBinding = (MethodBinding) binding;
      if (!methodBinding.isStatic()) return;
      refBinding = methodBinding.declaringClass;
    } else if (binding instanceof MemberTypeBinding) {
      MemberTypeBinding memberBinding = (MemberTypeBinding) binding;
      if (!memberBinding.isStatic()) return;
    }
View Full Code Here


  }
  return true;
}
protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {

  MethodBinding constructorBinding = null;
  boolean isSynthetic = false;
  if (reference instanceof ExplicitConstructorCall) {
    ExplicitConstructorCall call = (ExplicitConstructorCall) reference;
    isSynthetic = call.isImplicitSuper();
    constructorBinding = call.binding;
View Full Code Here

}
public int resolveLevel(Binding binding) {
  if (binding == null) return INACCURATE_MATCH;
  if (!(binding instanceof MethodBinding)) return IMPOSSIBLE_MATCH;

  MethodBinding constructor = (MethodBinding) binding;
  int level= matchConstructor(constructor);
  if (level== IMPOSSIBLE_MATCH) {
    if (constructor != constructor.original()) {
      level= matchConstructor(constructor.original());
    }
  }
  return level;
}
View Full Code Here

          if (needValue) {
            codeStream.generateConstant(fieldConstant, 0);
          }
        } else {
          if (needValue || (i > 0 && complyTo14) || lastGenericCast != null) {
            MethodBinding accessor = this.syntheticReadAccessors == null ? null : this.syntheticReadAccessors[i];
            if (accessor == null) {
              TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, lastFieldBinding, lastReceiverType, i == 0 && this.indexOfFirstFieldBinding == 1);
              if (lastFieldBinding.isStatic()) {
                codeStream.fieldAccess(Opcodes.OPC_getstatic, lastFieldBinding, constantPoolDeclaringClass);
              } else {
                codeStream.fieldAccess(Opcodes.OPC_getfield, lastFieldBinding, constantPoolDeclaringClass);
              }
            } else {
              codeStream.invoke(Opcodes.OPC_invokestatic, accessor, null /* default declaringClass */);
            }
            if (lastGenericCast != null) {
              codeStream.checkcast(lastGenericCast);
              lastReceiverType = lastGenericCast;
            } else {
              lastReceiverType = lastFieldBinding.type;
            }
            if (!needValue) codeStream.pop();
          } else {
            if (lastFieldBinding == initialFieldBinding) {
              if (lastFieldBinding.isStatic()){
                // if no valueRequired, still need possible side-effects of <clinit> invocation, if field belongs to different class
                if (initialFieldBinding.declaringClass != this.actualReceiverType.erasure()) {
                  MethodBinding accessor = this.syntheticReadAccessors == null ? null : this.syntheticReadAccessors[i];
                  if (accessor == null) {
                    TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, lastFieldBinding, lastReceiverType, i == 0 && this.indexOfFirstFieldBinding == 1);
                    codeStream.fieldAccess(Opcodes.OPC_getstatic, lastFieldBinding, constantPoolDeclaringClass);
                  } else {
                    codeStream.invoke(Opcodes.OPC_invokestatic, accessor, null /* default declaringClass */);
 
View Full Code Here

  // at this point we know we have something to report
  if (localBinding.declaration instanceof Argument) {
    // check compiler options to report against unused arguments
    MethodScope methodScope = currentScope.methodScope();
    if (methodScope != null) {
      MethodBinding method = ((AbstractMethodDeclaration)methodScope.referenceContext()).binding;
     
      boolean shouldReport = !method.isMain();
      if (method.isImplementing()) {
        shouldReport &= currentScope.compilerOptions().reportUnusedParameterWhenImplementingAbstract;
      } else if (method.isOverriding()) {
        shouldReport &= currentScope.compilerOptions().reportUnusedParameterWhenOverridingConcrete;
      }
     
      if (shouldReport) {
        // report the case of an argument that is unread except through a special operator
View Full Code Here

      public void setFieldIndex(int depth){ /* ignore */}
      public int sourceStart() { return 0; }
      public int sourceEnd() { return 0; }
      public TypeBinding expectedType() { return invocationSite.expectedType(); }
    };
    MethodBinding bindingIfNoCast;
    if (binding.isConstructor()) {
      bindingIfNoCast = scope.getConstructor((ReferenceBinding)receiverType, alternateArgumentTypes, fakeInvocationSite);
    } else {
      bindingIfNoCast = receiver.isImplicitThis()
        ? scope.getImplicitMethod(binding.selector, alternateArgumentTypes, fakeInvocationSite)
View Full Code Here

    exprContainCast = true;
  }
  TypeBinding expressionType = this.expression.resolveType(scope);
  if (this.expression instanceof MessageSend) {
    MessageSend messageSend = (MessageSend) this.expression;
    MethodBinding methodBinding = messageSend.binding;
    if (methodBinding != null && methodBinding.isPolymorphic()) {
      messageSend.binding = scope.environment().updatePolymorphicMethodReturnType((PolymorphicMethodBinding) methodBinding, castType);
      expressionType = castType;
    }
  }
  if (castType != null) {
View Full Code Here

* Determines whether apparent unnecessary cast wasn't actually used to
* perform return type inference of generic method invocation or boxing.
*/
private boolean isIndirectlyUsed() {
  if (this.expression instanceof MessageSend) {
    MethodBinding method = ((MessageSend)this.expression).binding;
    if (method instanceof ParameterizedGenericMethodBinding
          && ((ParameterizedGenericMethodBinding)method).inferredReturnType) {
      if (this.expectedType == null)
        return true;
      if (this.resolvedType != this.expectedType)
View Full Code Here

  } else {
    if (isThisReceiver) {
      if (isStatic){
        // if no valueRequired, still need possible side-effects of <clinit> invocation, if field belongs to different class
        if (this.binding.original().declaringClass != this.actualReceiverType.erasure()) {
          MethodBinding accessor = this.syntheticAccessors == null ? null : this.syntheticAccessors[FieldReference.READ];
          if (accessor == null) {
            TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenBinding, this.actualReceiverType, this.receiver.isImplicitThis());
            codeStream.fieldAccess(Opcodes.OPC_getstatic, codegenBinding, constantPoolDeclaringClass);
          } else {
            codeStream.invoke(Opcodes.OPC_invokestatic, accessor, null /* default declaringClass */);
 
View Full Code Here

      }
    }
  }
}
public void acceptLocalMethodTypeParameter(TypeVariableBinding typeVariableBinding) {
  MethodBinding methodBinding = (MethodBinding)typeVariableBinding.declaringElement;
  IJavaElement res = findLocalElement(methodBinding.sourceStart());
  if(res != null && res.getElementType() == IJavaElement.METHOD) {
    IMethod method = (IMethod) res;

    ITypeParameter typeParameter = method.getTypeParameter(new String(typeVariableBinding.sourceName));
    if (typeParameter.exists()) {
View Full Code Here

TOP

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

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.