Package org.aspectj.weaver

Examples of org.aspectj.weaver.World.resolve()


    return !bcelObjectType.isInterface();
  }

  private boolean mungeNewMemberType(BcelClassWeaver classWeaver, NewMemberClassTypeMunger munger) {
    World world = classWeaver.getWorld();
    ResolvedType onType = world.resolve(munger.getTargetType());
    if (onType.isRawType()) {
      onType = onType.getGenericType();
    }
    return onType.equals(classWeaver.getLazyClassGen().getType());
  }
View Full Code Here


    ResolvedMember interMethodBody = munger.getDeclaredInterMethodBody(aspectType, world);
    ResolvedMember interMethodDispatcher = munger.getDeclaredInterMethodDispatcher(aspectType, world);
    ResolvedMember memberHoldingAnyAnnotations = interMethodDispatcher;
    LazyClassGen classGen = classWeaver.getLazyClassGen();

    ResolvedType onType = world.resolve(unMangledInterMethod.getDeclaringType(), munger.getSourceLocation());
    if (onType.isRawType()) {
      onType = onType.getGenericType();
    }

    // Simple checks, can't ITD on annotations or enums
View Full Code Here

    World world = concreteAspect.getWorld();
    ResolvedType runtimeException = world.getCoreType(UnresolvedType.RUNTIME_EXCEPTION);
    ResolvedType error = world.getCoreType(UnresolvedType.ERROR);

    for (int i = 0, len = excs.length; i < len; i++) {
      ResolvedType t = world.resolve(excs[i], true);
      if (t.isMissing()) {
        world.getLint().cantFindType
            .signal(WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_EXCEPTION_TYPE, excs[i].getName()),
                getSourceLocation());
        // IMessage msg = new Message(
View Full Code Here

    if (thrownExceptions == null) {
      // ??? can we really lump in Around here, how does this interact with Throwable
      if (concreteAspect != null && concreteAspect.getWorld() != null && // null tests for test harness
          (getKind().isAfter() || getKind() == AdviceKind.Before || getKind() == AdviceKind.Around)) {
        World world = concreteAspect.getWorld();
        ResolvedMember m = world.resolve(signature);
        if (m == null) {
          thrownExceptions = Collections.emptyList();
        } else {
          thrownExceptions = collectCheckedExceptions(m.getExceptions());
        }
View Full Code Here

      return false;
    }

    ResolvedMember introduced = munger.getSignature();

    ResolvedType fromType = world.resolve(introduced.getDeclaringType(), munger.getSourceLocation());
    if (fromType.isRawType()) {
      fromType = fromType.getGenericType();
    }

    boolean shouldApply = munger.matches(weaver.getLazyClassGen().getType(), aspectType);
View Full Code Here

      // return type for the specific declaration at the shadow. (FastCar Sub.getCar())
      // XXX Put out another XLINT in this case?
      return;
    }
    // PR60015 - Don't report the warning if the declaring type is object and 'this' is an interface
    if (exactDeclaringType.resolve(world).isInterface() && shadowDeclaringType.equals(world.resolve("java.lang.Object"))) {
      return;
    }

    SignaturePattern nonConfusingPattern = new SignaturePattern(signature.getKind(), signature.getModifiers(), signature
        .getReturnType(), TypePattern.ANY, signature.getName(), signature.getParameterTypes(),
View Full Code Here

  private void checkWeaveAccess(UnresolvedType typeX, ASTNode location) {
    World world = inAspect.factory.getWorld();
    Lint.Kind check = world.getLint().typeNotExposedToWeaver;
    if (check.isEnabled()) {
      if (!world.resolve(typeX).isExposedToWeaver()) {
        ISourceLocation loc = null;
        if (location != null) {
          loc = new EclipseSourceLocation(inAspect.compilationResult, location.sourceStart, location.sourceEnd);
        }
        check.signal(typeX.getName() + " (needed for privileged access)", loc);
View Full Code Here

      // return type for the specific declaration at the shadow. (FastCar Sub.getCar())
      // XXX Put out another XLINT in this case?
      return;
    }
    // PR60015 - Don't report the warning if the declaring type is object and 'this' is an interface
    if (exactDeclaringType.resolve(world).isInterface() && shadowDeclaringType.equals(world.resolve("java.lang.Object"))) {
      return;
    }

    SignaturePattern nonConfusingPattern = new SignaturePattern(signature.getKind(), signature.getModifiers(),
        signature.getReturnType(), TypePattern.ANY, signature.getName(), signature.getParameterTypes(),
View Full Code Here

          superclassName = javaClass.getSuperclassName();
        }
        superclassSignature = getResolvedTypeX().getWorld().resolve(UnresolvedType.forName(superclassName)).getSignature();
      }
      World world = getResolvedTypeX().getWorld();
      supertype = world.resolve(UnresolvedType.forSignature(superclassSignature));
      superTypeReference = new WeakReference<ResolvedType>(supertype);
    }
    return supertype;
  }
View Full Code Here

          annotationTypes = new ResolvedType[annos.length];
          annotations = new AnnotationAJ[annos.length];
          for (int i = 0; i < annos.length; i++) {
            AnnotationGen annotation = annos[i];
            String typeSignature = annotation.getTypeSignature();
            ResolvedType rType = w.resolve(UnresolvedType.forSignature(typeSignature));
            if (rType == null) {
              throw new RuntimeException("Whilst unpacking annotations on '" + getResolvedTypeX().getName()
                  + "', failed to resolve type '" + typeSignature + "'");
            }
            annotationTypes[i] = rType;
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.