Package org.aspectj.weaver

Examples of org.aspectj.weaver.UnresolvedType


    }

    List<FormalBinding> bindings = new ArrayList<FormalBinding>();
    for (int i = 0; i < argumentNames.length; i++) {
      String argumentName = argumentNames[i];
      UnresolvedType argumentType = UnresolvedType.forSignature(method.getArgumentTypes()[i].getSignature());

      // do not bind JoinPoint / StaticJoinPoint /
      // EnclosingStaticJoinPoint
      // TODO solve me : this means that the JP/SJP/ESJP cannot appear as
      // binding
View Full Code Here


  protected boolean couldEverMatchSameTypesAs(TypePattern other) {
    if (super.couldEverMatchSameTypesAs(other)) {
      return true;
    }
    // false is necessary but not sufficient
    UnresolvedType otherType = other.getExactType();
    if (!ResolvedType.isMissing(otherType)) {
      if (namePatterns.length > 0) {
        if (!namePatterns[0].matches(otherType.getName())) {
          return false;
        }
      }
    }
    if (other instanceof WildTypePattern) {
View Full Code Here

  private TypePattern resolveBindingsFromFullyQualifiedTypeName(String fullyQualifiedName, IScope scope, Bindings bindings,
      boolean allowBinding, boolean requireExactType) {
    String originalName = fullyQualifiedName;
    ResolvedType resolvedTypeInTheWorld = null;
    UnresolvedType type;

    // System.out.println("resolve: " + cleanName);
    // ??? this loop has too many inefficiencies to count
    resolvedTypeInTheWorld = lookupTypeInWorldIncludingPrefixes(scope.getWorld(), fullyQualifiedName, scope
        .getImportedPrefixes());
View Full Code Here

      return resolveBindingsForExactType(scope, type, fullyQualifiedName, requireExactType);
    }
  }

  private UnresolvedType lookupTypeInScope(IScope scope, String typeName, IHasPosition location) {
    UnresolvedType type = null;
    while (ResolvedType.isMissing(type = scope.lookupType(typeName, location))) {
      int lastDot = typeName.lastIndexOf('.');
      if (lastDot == -1) {
        break;
      }
View Full Code Here

    }
    return ret;
  }

  private ResolvedType lookupTypeInWorld(World world, String typeName) {
    UnresolvedType ut = UnresolvedType.forName(typeName);
    ResolvedType ret = world.resolve(ut, true);
    while (ret.isMissing()) {
      int lastDot = typeName.lastIndexOf('.');
      if (lastDot == -1) {
        break;
View Full Code Here

    public void verify() {
      TypeVariable[] tvs = genericType.getTypeVariables();
      TypePattern[] typeParamPatterns = typeParameters.getTypePatterns();
      if (typeParameters.areAllExactWithNoSubtypesAllowed()) {
        for (int i = 0; i < tvs.length; i++) {
          UnresolvedType ut = typeParamPatterns[i].getExactType();
          boolean continueCheck = true;
          // FIXME asc dont like this but ok temporary measure. If the type parameter
          // is itself a type variable (from the generic aspect) then assume it'll be
          // ok... (see pr112105) Want to break this? Run GenericAspectK test.
          if (ut.isTypeVariableReference()) {
            continueCheck = false;
          }

          // System.err.println("Verifying "+ut.getName()+" meets bounds for "+tvs[i]);
          if (continueCheck && !tvs[i].canBeBoundTo(ut.resolve(scope.getWorld()))) {
            // issue message that type parameter does not meet specification
            String parameterName = ut.getName();
            if (ut.isTypeVariableReference()) {
              parameterName = ((TypeVariableReference) ut).getTypeVariable().getDisplayName();
            }
            String msg = WeaverMessages.format(WeaverMessages.VIOLATES_TYPE_VARIABLE_BOUNDS, parameterName,
                new Integer(i + 1), tvs[i].getDisplayName(), genericType.getName());
            if (requireExactType) {
View Full Code Here

   */
  @Override
  protected Test findResidueInternal(Shadow shadow, ExposedState state) {
    if (annotationTypePattern instanceof BindingAnnotationTypePattern) {
      BindingAnnotationTypePattern btp = (BindingAnnotationTypePattern) annotationTypePattern;
      UnresolvedType annotationType = btp.annotationType;
      Var var = shadow.getWithinAnnotationVar(annotationType);

      // This should not happen, we shouldn't have gotten this far
      // if we weren't going to find the annotation
      if (var == null) {
View Full Code Here

  @Override
  protected FuzzyBoolean matchInternal(Shadow shadow) {
    if (!couldMatch(shadow)) {
      return FuzzyBoolean.NO;
    }
    UnresolvedType typeToMatch = isThis ? shadow.getThisType() : shadow.getTargetType();
    // optimization for case of this(Object) or target(Object)
    // works for an ExactTypePattern (and we know there are no annotations to match here of course)
    if (typePattern.getExactType().equals(ResolvedType.OBJECT)) {
      return FuzzyBoolean.YES;
    }
    return typePattern.matches(typeToMatch.resolve(shadow.getIWorld()), TypePattern.DYNAMIC);
  }
View Full Code Here

      return match;
    }
    // are we dealing with array funkyness - pattern might be jlObject[]+ and type jlString[]
    if (type.isArray() && this.type.isArray()) {
      ResolvedType componentType = type.getComponentType().resolve(type.getWorld());
      UnresolvedType newPatternType = this.type.getComponentType();
      ExactTypePattern etp = new ExactTypePattern(newPatternType, includeSubtypes, false);
      return etp.matchesSubtypes(componentType, type);
    }
    return match;
  }
View Full Code Here

  protected boolean couldEverMatchSameTypesAs(TypePattern other) {
    if (super.couldEverMatchSameTypesAs(other)) {
      return true;
    }
    // false is necessary but not sufficient
    UnresolvedType otherType = other.getExactType();
    if (!ResolvedType.isMissing(otherType)) {
      return type.equals(otherType);
    }
    if (other instanceof WildTypePattern) {
      WildTypePattern owtp = (WildTypePattern) other;
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.UnresolvedType

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.