Package org.aspectj.weaver

Examples of org.aspectj.weaver.BCException


  public void resetState() {
    if (javaClass == null) {
      // we might store the classname and allow reloading?
      // At this point we are relying on the world to not evict if it
      // might want to reweave multiple times
      throw new BCException("can't weave evicted type");
    }

    bitflag = 0x0000;

    this.annotationTypes = null;
View Full Code Here


    return (bitflag & ANNOTATION_UNPACK_IN_PROGRESS) != 0;
  }

  private void ensureAnnotationsUnpacked() {
    if (isUnpackingAnnotations()) {
      throw new BCException("Re-entered weaver instance whilst unpacking annotations on " + this.className);
    }
    if (annotationTypes == null) {
      try {
        bitflag |= ANNOTATION_UNPACK_IN_PROGRESS;
        AnnotationGen annos[] = javaClass.getAnnotations();
View Full Code Here

          if (aspectType.isRawType()) {
            toLookOn = aspectType.getGenericType();
          }
          ResolvedMember realMember = getRealMemberForITDFromAspect(toLookOn, memberHoldingAnyAnnotations, false);
          if (realMember == null) {
            throw new BCException("Couldn't find ITD holder member '" + memberHoldingAnyAnnotations + "' on aspect "
                + aspectType);
          }
          annotationsOnRealMember = realMember.getAnnotations();

          if (annotationsOnRealMember != null) {
View Full Code Here

  public TypePattern getPerTypePointcut(Pointcut perClausePointcut) {
    Object o = perClausePointcut.accept(this, perClausePointcut);
    if (o instanceof TypePattern) {
      return (TypePattern) o;
    } else {
      throw new BCException("perClausePointcut visitor did not return a typepattern, it returned " + o
          + (o == null ? "" : " of type " + o.getClass()));
    }
  }
View Full Code Here

  }

  public static AnnotationTypePattern read(VersionedDataInputStream s, ISourceContext context) throws IOException {
    byte version = s.readByte();
    if (version > VERSION) {
      throw new BCException("BindingAnnotationTypePattern was written by a more recent version of AspectJ");
    }
    AnnotationTypePattern ret = new BindingAnnotationTypePattern(UnresolvedType.read(s), s.readShort());
    ret.readLocation(context, s);
    return ret;
  }
View Full Code Here

        effectiveSignature = (AjAttribute.EffectiveSignatureAttribute) attr;
      } else if (attr instanceof AjAttribute.PointcutDeclarationAttribute) {
        // this is an @AspectJ annotated advice method, with pointcut pre-resolved by ajc
        preResolvedPointcut = ((AjAttribute.PointcutDeclarationAttribute) attr).reify();
      } else {
        throw new BCException("weird method attribute " + attr);
      }
    }
  }
View Full Code Here

      shadow.weaveSoftener(this, ((ExactTypePattern) exceptionType).getType());
    } else if (getKind() == AdviceKind.PerTypeWithinEntry) {
      // PTWIMPL Entry to ptw is the static initialization of a type that matched the ptw type pattern
      shadow.weavePerTypeWithinAspectInitialization(this, shadow.getEnclosingType());
    } else {
      throw new BCException("unimplemented kind: " + getKind());
    }
    return true;
  }
View Full Code Here

      UnresolvedType annoType = btp.getAnnotationType();
      // TODO 2 need to sort out appropriate creation of the AnnotationAccessFieldVar - what happens for
      // reflective (ReflectionShadow) access to types?
      Var var = shadow.getKindedAnnotationVar(annoType);
      if (var == null) {
        throw new BCException("Unexpected problem locating annotation at join point '" + shadow + "'");
      }
      state.set(btp.getFormalIndex(), var.getAccessorForValue(formalType, btp.formalName));
    } else if (annotationTypePattern instanceof BindingAnnotationTypePattern) {
      BindingAnnotationTypePattern btp = (BindingAnnotationTypePattern) annotationTypePattern;
      UnresolvedType annotationType = btp.getAnnotationType();
View Full Code Here

            continue;
          }
          // fall-through
        case '|':
            if (i == chars.length) {
              throw new BCException("bad " + ch);
            }
            char nextChar = chars[i++];
            if (nextChar == ch) {
              tokens.add(BasicToken.makeOperator(makeString(ch, 2), i-2, i-1));
            } else {
View Full Code Here

  }

  public static TypePattern readTypePattern150(VersionedDataInputStream s, ISourceContext context) throws IOException {
    byte version = s.readByte();
    if (version > VERSION) {
      throw new BCException("WildTypePattern was written by a more recent version of AspectJ, cannot read");
    }
    int len = s.readShort();
    NamePattern[] namePatterns = new NamePattern[len];
    for (int i = 0; i < len; i++) {
      namePatterns[i] = NamePattern.read(s);
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.BCException

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.