Package org.aspectj.weaver

Examples of org.aspectj.weaver.ConcreteTypeMunger


    }

    InstructionList ret = new InstructionList();

    for (Iterator i = list.iterator(); i.hasNext();) {
      ConcreteTypeMunger cmunger = (ConcreteTypeMunger) i.next();
      NewFieldTypeMunger munger = (NewFieldTypeMunger) cmunger.getMunger();
      ResolvedMember initMethod = munger.getInitMethod(cmunger.getAspectType());
      if (!isStatic) {
        ret.append(InstructionConstants.ALOAD_0);
      }
      ret.append(Utility.createInvoke(fact, world, initMethod));
    }
View Full Code Here


      // we sort it out elsewhere and don't come into this method -
      // so we don't have to worry about interfaces, just the superclass.
        onTypeX = factory.fromEclipse(type.superclass()); //abstractMethod.declaringClass);
    }
    for (Iterator i = onTypeX.getInterTypeMungersIncludingSupers().iterator(); i.hasNext(); ) {
      ConcreteTypeMunger m = (ConcreteTypeMunger)i.next();
      ResolvedMember sig = m.getSignature();
            if (!Modifier.isAbstract(sig.getModifiers())) {
        if (ResolvedType
          .matches(
            AjcMemberMaker.interMethod(
              sig,
              m.getAspectType(),
              sig.getDeclaringType().resolve(factory.getWorld()).isInterface()),
            factory.makeResolvedMember(concreteMethod))) {
          return;
        }
      }
View Full Code Here

      // we sort it out elsewhere and don't come into this method -
      // so we don't have to worry about interfaces, just the superclass.
        onTypeX = factory.fromEclipse(type.superclass()); //abstractMethod.declaringClass);
    }
    for (Iterator i = onTypeX.getInterTypeMungersIncludingSupers().iterator(); i.hasNext(); ) {
      ConcreteTypeMunger m = (ConcreteTypeMunger)i.next();
      ResolvedMember sig = m.getSignature();
            if (!Modifier.isAbstract(sig.getModifiers())) {
        if (ResolvedType
          .matches(
            AjcMemberMaker.interMethod(
              sig,
              m.getAspectType(),
              sig.getDeclaringType().resolve(factory.getWorld()).isInterface()),
            factory.makeResolvedMember(abstractMethod))) {
          return;
        }
      }
View Full Code Here

      // affects other code in the problem reporter that looks through ITDs...
      ResolvedType supertypeToLookAt = onTypeX.getSuperclass();
      while (supertypeToLookAt!=null) {
        List itMungers = supertypeToLookAt.getInterTypeMungers();
        for (Iterator i = itMungers.iterator(); i.hasNext(); ) {
        ConcreteTypeMunger m = (ConcreteTypeMunger)i.next();
        ResolvedMember sig = m.getSignature();
        ResolvedMember rm = AjcMemberMaker.interMethod(sig,m.getAspectType(),
            sig.getDeclaringType().resolve(factory.getWorld()).isInterface());
        if (ResolvedType.matches(rm,possiblyErroneousRm)) {
          // match, so dont need to report a problem!
          return;
        }
View Full Code Here

                    }    
                    if (discoveredImpl == null) {
                        // didnt find a valid implementation, lets check the ITDs on this type to see if they satisfy it
                        boolean satisfiedByITD = false;
                        for (Iterator ii = newParentTarget.getType().getInterTypeMungersIncludingSupers().iterator(); ii.hasNext(); ) {
                            ConcreteTypeMunger m = (ConcreteTypeMunger)ii.next();
                            if (m.getMunger().getKind() == ResolvedTypeMunger.Method) {
                                ResolvedMember sig = m.getSignature();
                                if (!Modifier.isAbstract(sig.getModifiers())) {
                                 
                                  // If the ITD shares a type variable with some target type, we need to tailor it for that
                                  // type
                                  if (m.isTargetTypeParameterized()) {
                                      ResolvedType genericOnType = getWorld().resolve(sig.getDeclaringType()).getGenericType();
                                    m = m.parameterizedFor(newParent.discoverActualOccurrenceOfTypeInHierarchy(genericOnType));
                                      sig = m.getSignature(); // possible sig change when type parameters filled in
                                  }
                                    if (ResolvedType
                                        .matches(
                                            AjcMemberMaker.interMethod(
                                                sig,m.getAspectType(),sig.getDeclaringType().resolve(weaver.getWorld()).isInterface()),o)) {
                                        satisfiedByITD = true;
                                    }
                                }
                            } else if (m.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate) {
                                satisfiedByITD = true;//AV - that should be enough, no need to check more
                            }
                        }
                        if (!satisfiedByITD) {
                          error(weaver,
View Full Code Here

                  if (newCtor == null) {
                               
                                // 2. Check ITDCs to see if the necessary ctor is provided that way
                                boolean satisfiedByITDC = false;
                                for (Iterator ii = newParentTarget.getType().getInterTypeMungersIncludingSupers().iterator(); ii.hasNext() && !satisfiedByITDC; ) {
                                    ConcreteTypeMunger m = (ConcreteTypeMunger)ii.next();
                                    if (m.getMunger() instanceof NewConstructorTypeMunger) {
                                        if (m.getSignature().getSignature().equals(invokeSpecial.getSignature(cpg))) {
                                            satisfiedByITDC = true;
                                        }
                                    }
                                }
                               
View Full Code Here

        }
   
    InstructionList ret = new InstructionList();
   
    for (Iterator i = list.iterator(); i.hasNext();) {
      ConcreteTypeMunger cmunger = (ConcreteTypeMunger) i.next();
      NewFieldTypeMunger munger = (NewFieldTypeMunger) cmunger.getMunger();
      ResolvedMember initMethod = munger.getInitMethod(cmunger.getAspectType());
      if (!isStatic) ret.append(InstructionConstants.ALOAD_0);
      ret.append(Utility.createInvoke(fact, world, initMethod));
    }
    return ret;
  }
View Full Code Here

      }
    }
    // try itds before we give up
    List mungers = type.getInterTypeMungersIncludingSupers();
    for (Iterator iter = mungers.iterator(); iter.hasNext();) {
      ConcreteTypeMunger munger = (ConcreteTypeMunger) iter.next();
      Member member = munger.getSignature();
      if (signaturePattern.matches(member, type.getWorld(), false)) {
        if (!Modifier.isPublic(member.getModifiers())) continue;
        return true;
      }
    }
View Full Code Here

   
    public void weaveNormalTypeMungers(ResolvedType onType) {
      ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.PROCESSING_TYPE_MUNGERS, onType.getName());
      if (onType.isRawType() || onType.isParameterizedType()) onType = onType.getGenericType();
    for (Iterator i = typeMungerList.iterator(); i.hasNext(); ) {
      ConcreteTypeMunger m = (ConcreteTypeMunger)i.next();
      if (!m.isLateMunger() && m.matches(onType)) {
        onType.addInterTypeMunger(m);
      }
    }
    CompilationAndWeavingContext.leavingPhase(tok);
  }
View Full Code Here

    // XXX by Andy: why do we mix up the mungers here? it means later we know about two sets
    // and the late ones are a subset of the complete set? (see pr114436)
        baseTypeMungers.addAll(getWorld().getCrosscuttingMembersSet().getLateTypeMungers());

    for (Iterator i = baseTypeMungers.iterator(); i.hasNext(); ) {
      ConcreteTypeMunger munger = (ConcreteTypeMunger) i.next();
      EclipseTypeMunger etm = makeEclipseTypeMunger(munger);
      if (etm != null) ret.add(etm);
    }
    finishedTypeMungers = ret;
  }
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.ConcreteTypeMunger

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.