Examples of MethodBinding


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

    classFile.contents[classFile.contentsOffset++] = (byte) 0;
    classFile.contents[classFile.contentsOffset++] = (byte) 0;
   
    classFile.setForMethodInfos();
    for (Iterator i = methods.iterator(); i.hasNext(); ) {
      MethodBinding b = (MethodBinding)i.next();
      generateMethod(classFile, b);
    }

    classFile.addAttributes();
     
View Full Code Here

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

    // two possible reasons for it being null:
    // 1. code is broken
    // 2. this resolvedmember is an EclipseResolvedMember created up front to represent a privileged'd accessed member
    if (tDecl != null) {
      if (realBinding instanceof MethodBinding) {
        MethodBinding methodBinding = (MethodBinding) realBinding;
        AbstractMethodDeclaration methodDecl = tDecl.declarationOf(methodBinding);
        if (methodDecl == null) {
          // pr284862
          // bindings may have been trashed by InterTypeMemberFinder.addInterTypeMethod() - and so we need to take
          // a better look. Really this EclipseResolvedMember is broken...

          // Grab the set of bindings with matching selector
          MethodBinding[] mb = ((MethodBinding) realBinding).declaringClass.getMethods(methodBinding.selector);
          if (mb != null) {
            for (int m = 0, max = mb.length; m < max; m++) {
              MethodBinding candidate = mb[m];
              if (candidate instanceof InterTypeMethodBinding) {
                if (InterTypeMemberFinder.matches(mb[m], methodBinding)) {
                  InterTypeMethodBinding intertypeMethodBinding = (InterTypeMethodBinding) candidate;
                  Annotation[] annos = intertypeMethodBinding.sourceMethod.annotations;
                  return annos;
View Full Code Here

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

   * @return the type declaration that contained this member, or NULL if it is not available (eg. this isn't currently related to
   *         a SOURCE-FORM artifact, it is instead related to a BINARY-FORM artifact)
   */
  private TypeDeclaration getTypeDeclaration() {
    if (realBinding instanceof MethodBinding) {
      MethodBinding mb = (MethodBinding) realBinding;
      if (mb != null) {
        SourceTypeBinding stb = (SourceTypeBinding) mb.declaringClass;
        if (stb != null) {
          ClassScope cScope = stb.scope;
          if (cScope != null) {
View Full Code Here

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

   */
  public boolean isDefaultConstructor() {
    if (!(realBinding instanceof MethodBinding)) {
      return false;
    }
    MethodBinding mb = (MethodBinding) realBinding;
    return mb.isConstructor() && ((mb.modifiers & ExtraCompilerModifiers.AccIsDefaultConstructor) != 0);
  }
View Full Code Here

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

  public InterTypeMethodBinding(EclipseFactory world, ResolvedTypeMunger munger, UnresolvedType withinType,
      AbstractMethodDeclaration sourceMethod) {
    super();
    ResolvedMember signature = munger.getSignature();
    MethodBinding mb = world.makeMethodBinding(signature, munger.getTypeVariableAliases());
    this.modifiers = mb.modifiers;
    this.selector = mb.selector;
    this.returnType = mb.returnType;
    this.parameters = mb.parameters;
    this.thrownExceptions = mb.thrownExceptions;
View Full Code Here

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

   * .jdt.internal.compiler.ast.Annotation)
   */
  public void disallowedTargetForAnnotation(Annotation annotation) {
    // if the annotation's recipient is an ITD, it might be allowed after all...
    if (annotation.recipient instanceof MethodBinding) {
      MethodBinding binding = (MethodBinding) annotation.recipient;
      String name = new String(binding.selector);
      if (name.startsWith("ajc$")) {
        long metaTagBits = annotation.resolvedType.getAnnotationTagBits(); // could be forward reference
        if (name.indexOf("interField") != -1) {
          if ((metaTagBits & TagBits.AnnotationForField) != 0)
View Full Code Here

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

      if (existingMember != null) {
        // already have an implementation, so don't do anything
        if (onType == existingMember.getDeclaringType() && Modifier.isFinal(munger.getSignature().getModifiers())) {
          // final modifier on default implementation is taken to mean that
          // no-one else can provide an implementation
          MethodBinding offendingBinding = sourceType.getExactMethod(binding.selector, binding.parameters,
              sourceType.scope.compilationUnitScope());
          sourceType.scope.problemReporter().finalMethodCannotBeOverridden(offendingBinding, binding);
        }
        // so that we find methods from our superinterfaces later on...
        findOrCreateInterTypeMemberFinder(sourceType);
View Full Code Here

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

    return true;
  }

  private void mungeNewConstructor(SourceTypeBinding sourceType, NewConstructorTypeMunger munger) {
    if (shouldTreatAsPublic()) {
      MethodBinding binding = world.makeMethodBinding(munger.getSignature(), munger.getTypeVariableAliases());
      findOrCreateInterTypeMemberFinder(sourceType).addInterTypeMethod(binding);
      TypeVariableBinding[] typeVariables = binding.typeVariables;
      for (int i = 0; i < typeVariables.length; i++) {
        TypeVariableBinding tv = typeVariables[i];
        String name = new String(tv.sourceName);
View Full Code Here

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

      key = inAspect.factory.makeResolvedMember(baseMethod);
    }
    if (accessors.containsKey(key))
      return (MethodBinding) accessors.get(key);

    MethodBinding ret;
    if (baseMethod.isConstructor()) {
      ret = new MethodBinding(baseMethod, baseMethod.declaringClass);
      ret.modifiers = AstUtil.makePublic(ret.modifiers);
      baseMethod.modifiers = ret.modifiers;
    } else {
      ret = inAspect.factory.makeMethodBinding(AjcMemberMaker.privilegedAccessMethodForMethod(inAspect.typeX, key));
    }
View Full Code Here

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

      TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
      org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding declaring = typeVariableBinding.declaringElement;
      StringBuffer binaryName = new StringBuffer();
      switch(declaring.kind()) {
        case org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding.METHOD :
          MethodBinding methodBinding = (MethodBinding) declaring;
          char[] constantPoolName = methodBinding.declaringClass.constantPoolName();
          if (constantPoolName == null) return null;
          binaryName
            .append(CharOperation.replaceOnCopy(constantPoolName, '/', '.'))
            .append('$')
            .append(methodBinding.signature())
            .append('$')
            .append(typeVariableBinding.sourceName);
          break;
        default :
          org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding = (org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding) declaring;
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.