Examples of World


Examples of org.aspectj.weaver.World

    if (kind.isPerEntry() || kind == AdviceKind.Softener) {
      return 0;
    }

    // System.out.println("compare: " + this + " with " + other);
    World world = concreteAspect.getWorld();

    int ret = concreteAspect.getWorld().compareByPrecedence(concreteAspect, o.concreteAspect);
    if (ret != 0) {
      return ret;
    }
View Full Code Here

Examples of org.aspectj.weaver.World

    weaver.getLazyClassGen().addField(field, null);
    return true;
  }

  private ResolvedMember getRealMemberForITDFromAspect(ResolvedType aspectType, ResolvedMember lookingFor, boolean isCtorRelated) {
    World world = aspectType.getWorld();
    boolean debug = false;
    if (debug) {
      System.err.println("Searching for a member on type: " + aspectType);
      System.err.println("Member we are looking for: " + lookingFor);
    }
View Full Code Here

Examples of org.aspectj.weaver.World

  private final static String declareAtPrefix = "ajc$declare_at";

  private boolean hasField(ResolvedType type) {
    // TODO what about ITDs
    World world = type.getWorld();
    for (Iterator iter = type.getFields(); iter.hasNext();) {
      Member field = (Member) iter.next();
      if (field.getName().startsWith(declareAtPrefix)) {
        continue;
      }
View Full Code Here

Examples of org.aspectj.weaver.World

    return false;
  }

  private boolean hasMethod(ResolvedType type) {
    // TODO what about ITDs
    World world = type.getWorld();
    for (Iterator iter = type.getMethods(true, true); iter.hasNext();) {
      Member method = (Member) iter.next();
      if (method.getName().startsWith(declareAtPrefix)) {
        continue;
      }
View Full Code Here

Examples of org.aspectj.weaver.World

    }

  }

  public void warnOnAddedInterface(ResolvedType type, ResolvedType parent) {
    World world = factory.getWorld();
    ResolvedType serializable = world.getCoreType(UnresolvedType.SERIALIZABLE);
    if (serializable.isAssignableFrom(type) && !serializable.isAssignableFrom(parent)
        && !LazyClassGen.hasSerialVersionUIDField(type)) {
      world.getLint().needsSerialVersionUIDField.signal(new String[] { type.getName().toString(),
          "added interface " + parent.getName().toString() }, null, null);
    }
  }
View Full Code Here

Examples of org.aspectj.weaver.World

    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

Examples of org.aspectj.weaver.World

    // no warnings for declare error/warning
    if (munger instanceof Checker) {
      return;
    }

    World world = shadow.getIWorld();

    // warning never needed if the declaring type is any
    UnresolvedType exactDeclaringType = signature.getDeclaringType().getExactType();

    ResolvedType shadowDeclaringType = shadow.getSignature().getDeclaringType().resolve(world);

    if (signature.getDeclaringType().isStar() || ResolvedType.isMissing(exactDeclaringType)
        || exactDeclaringType.resolve(world).isMissing()) {
      return;
    }

    // warning not needed if match type couldn't ever be the declaring type
    if (!shadowDeclaringType.isAssignableFrom(exactDeclaringType.resolve(world))) {
      return;
    }

    // if the method in the declaring type is *not* visible to the
    // exact declaring type then warning not needed.
    ResolvedMember rm = shadow.getSignature().resolve(world);
    // rm can be null in the case where we are binary weaving, and looking at a class with a call to a method in another class,
    // but because of class incompatibilities, the method does not exist on the target class anymore.
    // this will be reported elsewhere.
    if (rm == null) {
      return;
    }

    int shadowModifiers = rm.getModifiers();
    if (!ResolvedType.isVisible(shadowModifiers, shadowDeclaringType, exactDeclaringType.resolve(world))) {
      return;
    }

    if (!signature.getReturnType().matchesStatically(shadow.getSignature().getReturnType().resolve(world))) {
      // Covariance issue...
      // The reason we didn't match is that the type pattern for the pointcut (Car) doesn't match the
      // 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

Examples of org.aspectj.weaver.World

    }
    signature = signature.resolveBindings(scope, bindings);

    if (kind == Shadow.ConstructorExecution) { // Bug fix 60936
      if (signature.getDeclaringType() != null) {
        World world = scope.getWorld();
        UnresolvedType exactType = signature.getDeclaringType().getExactType();
        if (signature.getKind() == Member.CONSTRUCTOR && !ResolvedType.isMissing(exactType)
            && exactType.resolve(world).isInterface() && !signature.getDeclaringType().isIncludeSubtypes()) {
          world.getLint().noInterfaceCtorJoinpoint.signal(exactType.toString(), getSourceLocation());
        }
      }
    }

    // no parameterized types
View Full Code Here

Examples of org.aspectj.weaver.World

      // No annotation found
      return false;
    }

    Method annotatedMethod = struct.method;
    World world = struct.enclosingType.getWorld();
    NameValuePair declareMixinPatternNameValuePair = getAnnotationElement(declareMixinAnnotation, VALUE);

    // declareMixinPattern could be of the form "Bar*" or "A || B" or "Foo+"
    String declareMixinPattern = declareMixinPatternNameValuePair.getValue().stringifyValue();
    TypePattern targetTypePattern = parseTypePattern(declareMixinPattern, struct);
View Full Code Here

Examples of org.aspectj.weaver.World

  // }
  // }

  private ResolvedMember getPointcutDeclaration(ReferencePointcut rp, MethodDeclaration declaration) {
    EclipseFactory factory = ((AjLookupEnvironment) declaration.scope.environment()).factory;
    World world = factory.getWorld();
    UnresolvedType onType = rp.onType;
    if (onType == null) {
      if (declaration.binding != null) {
        Member member = factory.makeResolvedMember(declaration.binding);
        onType = member.getDeclaringType();
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.