Package org.aspectj.weaver

Examples of org.aspectj.weaver.World$TimeCollector


        if (type.matchesInstanceof(argRTX).alwaysTrue()) {
          continue;
        }
      }

      World world = shadow.getIWorld();
      ResolvedType typeToExpose = type.getExactType().resolve(world);
      if (typeToExpose.isParameterizedType()) {
        boolean inDoubt = (type.matchesInstanceof(argRTX) == FuzzyBoolean.MAYBE);
        if (inDoubt && world.getLint().uncheckedArgument.isEnabled()) {
          String uncheckedMatchWith = typeToExpose.getSimpleBaseName();
          if (argRTX.isParameterizedType() && (argRTX.getRawType() == typeToExpose.getRawType())) {
            uncheckedMatchWith = argRTX.getSimpleName();
          }
          if (!isUncheckedArgumentWarningSuppressed()) {
            world.getLint().uncheckedArgument.signal(new String[] { typeToExpose.getSimpleName(), uncheckedMatchWith,
                typeToExpose.getSimpleBaseName(), shadow.toResolvedString(world) }, getSourceLocation(),
                new ISourceLocation[] { shadow.getSourceLocation() });
          }
        }
      }
View Full Code Here


    ret.inAspect = inAspect;
    if (inAspect.isAbstract()) {
      return ret;
    }

    World world = inAspect.getWorld();

    Pointcut concreteEntry = entry.concretize(inAspect, inAspect, 0, null);
    // concreteEntry = new AndPointcut(this, concreteEntry);
    // concreteEntry.state = Pointcut.CONCRETE;
    inAspect.crosscuttingMembers.addConcreteShadowMunger(Advice.makePerObjectEntry(world, concreteEntry, isThis, inAspect));

    // FIXME AV - don't use lateMunger here due to test
    // "inheritance, around advice and abstract pointcuts"
    // see #75442 thread. Issue with weaving order.
    ResolvedTypeMunger munger = new PerObjectInterfaceTypeMunger(inAspect, concreteEntry);
    inAspect.crosscuttingMembers.addLateTypeMunger(world.getWeavingSupport().concreteTypeMunger(munger, inAspect));

    // ATAJ: add a munger to add the aspectOf(..) to the @AJ aspects
    if (inAspect.isAnnotationStyleAspect() && !inAspect.isAbstract()) {
      inAspect.crosscuttingMembers.addLateTypeMunger(inAspect.getWorld().getWeavingSupport().makePerClauseAspect(inAspect,
          getKind()));
    }

    // ATAJ inline around advice support - don't use a late munger to allow
    // around inling for itself
    if (inAspect.isAnnotationStyleAspect() && !inAspect.getWorld().isXnoInline()) {
      inAspect.crosscuttingMembers.addTypeMunger(world.getWeavingSupport().createAccessForInlineMunger(inAspect));
    }

    return ret;
  }
View Full Code Here

  public ResolvedMember[] getDeclaredPointcuts() {
    if (pointcuts == null) {
      Pointcut[] pcs = this.myType.getDeclaredPointcuts();
      pointcuts = new ResolvedMember[pcs.length];
      InternalUseOnlyPointcutParser parser = null;
      World world = getWorld();
      if (world instanceof ReflectionWorld) {
        parser = new InternalUseOnlyPointcutParser(classLoaderReference.getClassLoader(), (ReflectionWorld) getWorld());
      } else {
        parser = new InternalUseOnlyPointcutParser(classLoaderReference.getClassLoader());
      }
      Set additionalPointcutHandlers = world.getRegisteredPointcutHandlers();
      for (Iterator handlerIterator = additionalPointcutHandlers.iterator(); handlerIterator.hasNext();) {
        PointcutDesignatorHandler handler = (PointcutDesignatorHandler) handlerIterator.next();
        parser.registerPointcutDesignatorHandler(handler);
      }
View Full Code Here

    }

    public void visit(Instanceof i) {
      ReflectionVar v = (ReflectionVar) i.getVar();
      Object value = v.getBindingAtJoinPoint(thisObject, targetObject, args);
      World world = v.getType().getWorld();
      ResolvedType desiredType = i.getType().resolve(world);
      ResolvedType actualType = world.resolve(value.getClass().getName());
      matches = desiredType.isAssignableFrom(actualType);
    }
View Full Code Here

    }

    public void visit(HasAnnotation hasAnnotation) {
      ReflectionVar v = (ReflectionVar) hasAnnotation.getVar();
      Object value = v.getBindingAtJoinPoint(thisObject, targetObject, args);
      World world = v.getType().getWorld();
      ResolvedType actualVarType = world.resolve(value.getClass().getName());
      ResolvedType requiredAnnotationType = hasAnnotation.getAnnotationType().resolve(world);
      matches = actualVarType.hasAnnotation(requiredAnnotationType);
    }
View Full Code Here

    }

    public void visit(Instanceof instanceofTest) {
      ReflectionVar v = (ReflectionVar) instanceofTest.getVar();
      Object value = v.getBindingAtJoinPoint(thisObject, targetObject, args);
      World world = v.getType().getWorld();
      ResolvedType desiredType = instanceofTest.getType().resolve(world);
      if (value == null) {
        matches = false;
      } else {
        ResolvedType actualType = world.resolve(value.getClass().getName());
        matches = desiredType.isAssignableFrom(actualType);
      }
    }
View Full Code Here

    }

    public void visit(HasAnnotation hasAnnotation) {
      ReflectionVar v = (ReflectionVar) hasAnnotation.getVar();
      Object value = v.getBindingAtJoinPoint(thisObject, targetObject, args);
      World world = v.getType().getWorld();
      ResolvedType actualVarType = world.resolve(value.getClass().getName());
      ResolvedType requiredAnnotationType = hasAnnotation.getAnnotationType().resolve(world);
      matches = actualVarType.hasAnnotation(requiredAnnotationType);
    }
View Full Code Here

    Options.WeaverOption weaverOption = Options.parse(allOptions.toString(), loader, getMessageHandler());

    // configure the weaver and world
    // AV - code duplicates AspectJBuilder.initWorldAndWeaver()
    World world = weaver.getWorld();
    setMessageHandler(weaverOption.messageHandler);
    world.setXlazyTjp(weaverOption.lazyTjp);
    world.setXHasMemberSupportEnabled(weaverOption.hasMember);
    world.setTiming(weaverOption.timers, true);
    world.setOptionalJoinpoints(weaverOption.optionalJoinpoints);
    world.setPinpointMode(weaverOption.pinpoint);
    weaver.setReweavableMode(weaverOption.notReWeavable);
    world.performExtraConfiguration(weaverOption.xSet);
    world.setXnoInline(weaverOption.noInline);
    // AMC - autodetect as per line below, needed for AtAjLTWTests.testLTWUnweavable
    world.setBehaveInJava5Way(LangUtil.is15VMOrGreater());
    world.setAddSerialVerUID(weaverOption.addSerialVersionUID);

    /* First load defaults */
    bcelWorld.getLint().loadDefaultProperties();

    /* Second overlay LTW defaults */
    bcelWorld.getLint().adviceDidNotMatch.setKind(null);

    /* Third load user file using -Xlintfile so that -Xlint wins */
    if (weaverOption.lintFile != null) {
      InputStream resource = null;
      try {
        resource = loader.getResourceAsStream(weaverOption.lintFile);
        Exception failure = null;
        if (resource != null) {
          try {
            Properties properties = new Properties();
            properties.load(resource);
            world.getLint().setFromProperties(properties);
          } catch (IOException e) {
            failure = e;
          }
        }
        if (failure != null || resource == null) {
View Full Code Here

    Options.WeaverOption weaverOption = Options.parse(allOptions.toString(), loader, getMessageHandler());

    // configure the weaver and world
    // AV - code duplicates AspectJBuilder.initWorldAndWeaver()
    World world = weaver.getWorld();
    setMessageHandler(weaverOption.messageHandler);
    world.setXlazyTjp(weaverOption.lazyTjp);
    world.setXHasMemberSupportEnabled(weaverOption.hasMember);
    world.setTiming(weaverOption.timers, true);
    world.setOptionalJoinpoints(weaverOption.optionalJoinpoints);
    world.setPinpointMode(weaverOption.pinpoint);
    weaver.setReweavableMode(weaverOption.notReWeavable);
    world.performExtraConfiguration(weaverOption.xSet);
    world.setXnoInline(weaverOption.noInline);
    // AMC - autodetect as per line below, needed for AtAjLTWTests.testLTWUnweavable
    world.setBehaveInJava5Way(LangUtil.is15VMOrGreater());
    world.setAddSerialVerUID(weaverOption.addSerialVersionUID);

    /* First load defaults */
    bcelWorld.getLint().loadDefaultProperties();

    /* Second overlay LTW defaults */
    bcelWorld.getLint().adviceDidNotMatch.setKind(null);

    /* Third load user file using -Xlintfile so that -Xlint wins */
    if (weaverOption.lintFile != null) {
      InputStream resource = null;
      try {
        resource = loader.getResourceAsStream(weaverOption.lintFile);
        Exception failure = null;
        if (resource != null) {
          try {
            Properties properties = new Properties();
            properties.load(resource);
            world.getLint().setFromProperties(properties);
          } catch (IOException e) {
            failure = e;
          }
        }
        if (failure != null || resource == null) {
View Full Code Here

    }

    public void visit(Instanceof instanceofTest) {
      ReflectionVar v = (ReflectionVar) instanceofTest.getVar();
      Object value = v.getBindingAtJoinPoint(thisObject, targetObject, args);
      World world = v.getType().getWorld();
      ResolvedType desiredType = instanceofTest.getType().resolve(world);
      ResolvedType actualType = world.resolve(value.getClass().getName());
      matches = desiredType.isAssignableFrom(actualType);
    }
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.World$TimeCollector

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.