Package org.aspectj.weaver

Examples of org.aspectj.weaver.ShadowMunger


            world.getLint().adviceDidNotMatch.isEnabled()) {
          List l = world.getCrosscuttingMembersSet().getShadowMungers();
          Set alreadyWarnedLocations = new HashSet();
         
          for (Iterator iter = l.iterator(); iter.hasNext();) {
            ShadowMunger element = (ShadowMunger) iter.next();
            if (element instanceof BcelAdvice) { // This will stop us incorrectly reporting deow Checkers
                  BcelAdvice ba = (BcelAdvice)element;
                  if (!ba.hasMatchedSomething()) {
           // Because we implement some features of AJ itself by creating our own kind of mungers, you sometimes
              // find that ba.getSignature() is not a BcelMethod - for example it might be a cflow entry munger.
                   if (ba.getSignature()!=null) {
                    
                     // check we haven't already warned on this advice and line
                     // (cflow creates multiple mungers for the same advice)
                     AdviceLocation loc = new AdviceLocation(ba);
                     if (alreadyWarnedLocations.contains(loc)) {
                       continue;
                     } else {
                       alreadyWarnedLocations.add(loc);
                     }
                    
             if (!(ba.getSignature() instanceof BcelMethod)
                 || !Utility.isSuppressing((AnnotationX[])ba.getSignature().getAnnotations(),"adviceDidNotMatch")) {
                  world.getLint().adviceDidNotMatch.signal(ba.getDeclaringAspect().toString(),element.getSourceLocation());
             }               
                     }
                  }
            }
          }
View Full Code Here


    FastMatchInfo info = new FastMatchInfo(type, null);

    List result = new ArrayList();
    Iterator iter = list.iterator();
    while (iter.hasNext()) {
      ShadowMunger munger = (ShadowMunger)iter.next();
      FuzzyBoolean fb = munger.getPointcut().fastMatch(info);
      WeaverMetrics.recordFastMatchTypeResult(fb); // Could pass: munger.getPointcut().toString(),info
      if (fb.maybeTrue()) {
        result.add(munger);
      }
    }
View Full Code Here

        }
      }
     
      if (pointcutDec.isAbstract()) {
        //Thread.currentThread().dumpStack();
        ShadowMunger enclosingAdvice = bindings.getEnclosingAdvice();
        searchStart.getWorld().showMessage(IMessage.ERROR,
            WeaverMessages.format(WeaverMessages.ABSTRACT_POINTCUT,pointcutDec),
            getSourceLocation(),
            (null == enclosingAdvice) ? null : enclosingAdvice.getSourceLocation());
        return Pointcut.makeMatchesNothing(Pointcut.CONCRETE);
      }
         
      //System.err.println("start: " + searchStart);
      ResolvedType[] parameterTypes = searchStart.getWorld().resolve(pointcutDec.getParameterTypes());
View Full Code Here

          this.getSourceLocation(),null);
      return Pointcut.makeMatchesNothing(Pointcut.CONCRETE);
    }
   
    if (bindings.directlyInAdvice()) {
      ShadowMunger advice = bindings.getEnclosingAdvice();
      if (advice instanceof Advice) {
        ret.baseArgsCount = ((Advice)advice).getBaseParameterCount();
      } else {
        ret.baseArgsCount = 0;
      }
      ret.residueSource = advice.getPointcut().concretize(inAspect, inAspect, ret.baseArgsCount, advice);
    } else {
      ResolvedPointcutDefinition def = bindings.peekEnclosingDefinition();
      if (def == CflowPointcut.CFLOW_MARKER) {
        inAspect.getWorld().showMessage(IMessage.ERROR,
            WeaverMessages.format(WeaverMessages.IF_LEXICALLY_IN_CFLOW),
View Full Code Here

    // now we ask each munger to request our state
    isThisJoinPointLazy = true;//world.isXlazyTjp(); // lazy is default now

    badAdvice = null;
    for (Iterator iter = mungers.iterator(); iter.hasNext();) {
      ShadowMunger munger = (ShadowMunger) iter.next();
      munger.specializeOn(this);
    }
   
   
    initializeThisJoinPoint();
View Full Code Here

    }
   
    private boolean checkLazyTjp() {     
      // check for around advice
      for (Iterator i = mungers.iterator(); i.hasNext();) {
      ShadowMunger munger = (ShadowMunger) i.next();
      if (munger instanceof Advice) {
        if ( ((Advice)munger).getKind() == AdviceKind.Around) {
          if (munger.getSourceLocation()!=null) { // do we know enough to bother reporting?
            world.getLint().canNotImplementLazyTjp.signal(
                new String[] {toString()},
                getSourceLocation(),
                new ISourceLocation[] { munger.getSourceLocation() }
            );
          }
          return false;
        }
      }
View Full Code Here

    // ---- implementations of ShadowMunger's methods
   
  public ShadowMunger concretize(ResolvedType fromType, World world, PerClause clause) {
    suppressLintWarnings(world);
    ShadowMunger ret = super.concretize(fromType, world, clause);
    clearLintSuppressions(world,this.suppressedLintKinds);
    return ret;
  }
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.ShadowMunger

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.