Package org.aspectj.util

Examples of org.aspectj.util.FuzzyBoolean


      if (pLeft > tLeft) {
        return FuzzyBoolean.NO;
      }

      ResolvedType type = target.getResolved(ti);
      FuzzyBoolean ff = null;
      try {
        if (parameterAnnotations != null) {
          type.temporaryAnnotationTypes = parameterAnnotations[ti];
        }
        ff = patternChar.matches(type, kind);
      } finally {
        type.temporaryAnnotationTypes = null;
      }

      if (ff.maybeTrue()) {
        FuzzyBoolean xx = outOfStar(pattern, target, pi + 1, ti + 1, pLeft - 1, tLeft - 1, starsLeft, kind,
            parameterAnnotations);
        if (xx.maybeTrue()) {
          return ff.and(xx);
        }
      }
      ti++;
      tLeft--;
View Full Code Here


  public FuzzyBoolean fastMatch(FastMatchInfo type) {
    return left.fastMatch(type).or(right.fastMatch(type));
  }

  protected FuzzyBoolean matchInternal(Shadow shadow) {
    FuzzyBoolean leftMatch = left.match(shadow);
    if (leftMatch.alwaysTrue()) {
      return leftMatch;
    }
    return leftMatch.or(right.match(shadow));
  }
View Full Code Here

   *
   * @see org.aspectj.weaver.patterns.Pointcut#match(org.aspectj.weaver.Shadow)
   */
  protected FuzzyBoolean matchInternal(Shadow shadow) {
    arguments.resolve(shadow.getIWorld());
    FuzzyBoolean ret = arguments.matches(shadow.getIWorld().resolve(shadow.getArgTypes()));
    return ret;
  }
View Full Code Here

    }
    if ((numArgsMatchedByEllipsis > 0) && (ellipsisCount == 0)) {
      return FuzzyBoolean.NO;
    }
    // now work through the args and the patterns, skipping at ellipsis
    FuzzyBoolean ret = FuzzyBoolean.YES;
    int argsIndex = 0;
    for (int i = 0; i < typePatterns.length; i++) {
      if (typePatterns[i] == AnnotationTypePattern.ELLIPSIS) {
        // match ellipsisMatchCount args
        argsIndex += numArgsMatchedByEllipsis;
      } else if (typePatterns[i] == AnnotationTypePattern.ANY) {
        argsIndex++;
      } else {
        // match the argument type at argsIndex with the ExactAnnotationTypePattern
        // we know it is exact because nothing else is allowed in args
        if (someArgs[argsIndex].isPrimitiveType()) {
          return FuzzyBoolean.NO; // can never match
        }
        ExactAnnotationTypePattern ap = (ExactAnnotationTypePattern) typePatterns[i];
        FuzzyBoolean matches = ap.matchesRuntimeType(someArgs[argsIndex]);
        if (matches == FuzzyBoolean.NO) {
          return FuzzyBoolean.MAYBE; // could still match at runtime
        } else {
          argsIndex++;
          ret = ret.and(matches);
View Full Code Here

    return FuzzyBoolean.MAYBE;
  }

  protected FuzzyBoolean matchInternal(Shadow shadow) {
    ResolvedType[] argumentsToMatchAgainst = getArgumentsToMatchAgainst(shadow);
    FuzzyBoolean ret = arguments.matches(argumentsToMatchAgainst, TypePattern.DYNAMIC);
    return ret;
  }
View Full Code Here

    boolean wantsAnnotationMatch = wantToMatchAnnotationPattern();
    JoinPointSignatureIterator candidateMatches = joinPointSignature.getJoinPointSignatures(world);
    while (candidateMatches.hasNext()) {
      JoinPointSignature aSig = candidateMatches.next();
      // System.out.println(aSig);
      FuzzyBoolean matchResult = matchesExactly(aSig, world, allowBridgeMethods, subjectMatch);
      if (matchResult.alwaysTrue()) {
        return true;
      } else if (matchResult.alwaysFalse()) {
        return false;
      }
      // if we got a "MAYBE" it's worth looking at the other signatures
      // The first signature is the subject signature - and against it we must match modifiers/annotations/throws
      // see http://www.eclipse.org/aspectj/doc/next/adk15notebook/join-point-modifiers.html
View Full Code Here

    // see http://www.eclipse.org/aspectj/doc/next/adk15notebook/join-point-modifiers.html
    if (subjectMatch && !modifiers.matches(aMember.getModifiers())) {
      return FuzzyBoolean.NO;
    }

    FuzzyBoolean matchesIgnoringAnnotations = FuzzyBoolean.YES;
    if (kind == Member.STATIC_INITIALIZATION) {
      matchesIgnoringAnnotations = matchesExactlyStaticInitialization(aMember, inAWorld);
    } else if (kind == Member.FIELD) {
      matchesIgnoringAnnotations = matchesExactlyField(aMember, inAWorld);
    } else if (kind == Member.METHOD) {
      matchesIgnoringAnnotations = matchesExactlyMethod(aMember, inAWorld, subjectMatch);
    } else if (kind == Member.CONSTRUCTOR) {
      matchesIgnoringAnnotations = matchesExactlyConstructor(aMember, inAWorld);
    }
    if (matchesIgnoringAnnotations.alwaysFalse()) {
      return FuzzyBoolean.NO;
    }

    // Only the subject is checked for annotations (239441/119749)
    // see http://www.eclipse.org/aspectj/doc/next/adk15notebook/join-point-modifiers.html
View Full Code Here

  {
    Question question = new Question(pattern, type, kind);
    //??? should we use this table to do caching or is that a pessimization
    //??? if we do that optimization we can also do error checking that the result
    //??? doesn't change
    FuzzyBoolean answer = question.ask();
    questionsAndAnswers.put(question, answer);
    return answer;
  }
View Full Code Here

 
  public Question anyChanges() {
    for (Iterator i = questionsAndAnswers.entrySet().iterator(); i.hasNext(); ) {
      Map.Entry entry = (Map.Entry)i.next();
      Question question = (Question)entry.getKey();
      FuzzyBoolean expectedAnswer = (FuzzyBoolean)entry.getValue();
     
      FuzzyBoolean currentAnswer = question.ask();
      //System.out.println(question + ":" + currentAnswer);
      if (currentAnswer != expectedAnswer) {
        return question;
      }
    }
View Full Code Here

    StringBuffer buf = new StringBuffer();
    buf.append("TypePatternQuestions{");
    for (Iterator i = questionsAndAnswers.entrySet().iterator(); i.hasNext(); ) {
      Map.Entry entry = (Map.Entry)i.next();
      Question question = (Question)entry.getKey();
      FuzzyBoolean expectedAnswer = (FuzzyBoolean)entry.getValue();
      buf.append(question);
      buf.append(":");
      buf.append(expectedAnswer);
      buf.append(", ");
    }
View Full Code Here

TOP

Related Classes of org.aspectj.util.FuzzyBoolean

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.