Package org.aspectj.weaver

Examples of org.aspectj.weaver.UnresolvedType$TypeKind


      int memberLineNumber) {
    if (!getWorld().getMessageHandler().isIgnoring(IMessage.WEAVEINFO)) {
      StringBuffer parmString = new StringBuffer("(");
      UnresolvedType[] paramTypes = member.getParameterTypes();
      for (int i = 0; i < paramTypes.length; i++) {
        UnresolvedType type = paramTypes[i];
        String s = org.aspectj.apache.bcel.classfile.Utility.signatureToString(type.getSignature());
        if (s.lastIndexOf('.') != -1) {
          s = s.substring(s.lastIndexOf('.') + 1);
        }
        parmString.append(s);
        if ((i + 1) < paramTypes.length) {
View Full Code Here


   * @param rm the sig we want it to pretend to be 'int A.m()' or somesuch ITD like thing
   * @param declaredSig the real sig 'blah.ajc$xxx'
   */
  private void fixParameterNamesForResolvedMember(ResolvedMember rm, ResolvedMember declaredSig) {

    UnresolvedType memberHostType = declaredSig.getDeclaringType();
    String methodName = declaredSig.getName();
    String[] pnames = null;
    if (rm.getKind() == Member.METHOD && !rm.isAbstract()) {
      if (methodName.startsWith("ajc$inlineAccessMethod") || methodName.startsWith("ajc$superDispatch")) {
        ResolvedMember resolvedDooberry = world.resolve(declaredSig);
        pnames = resolvedDooberry.getParameterNames();
      } else {
        ResolvedMember realthing = AjcMemberMaker.interMethodDispatcher(rm.resolve(world), memberHostType).resolve(world);
        ResolvedMember theRealMember = findResolvedMemberNamed(memberHostType.resolve(world), realthing.getName());
        if (theRealMember != null) {
          pnames = theRealMember.getParameterNames();
          // static ITDs don't need any parameter shifting
          if (pnames.length > 0 && pnames[0].equals("ajc$this_")) {
            String[] pnames2 = new String[pnames.length - 1];
View Full Code Here

   * @param rm the sig we want it to pretend to be 'int A.m()' or somesuch ITD like thing
   * @param declaredSig the real sig 'blah.ajc$xxx'
   */
  private void fixAnnotationsForResolvedMember(ResolvedMember rm, ResolvedMember declaredSig) {
    try {
      UnresolvedType memberHostType = declaredSig.getDeclaringType();
      ResolvedType[] annotations = mapToAnnotations.get(rm);
      String methodName = declaredSig.getName();
      // FIXME asc shouldnt really rely on string names !
      if (annotations == null) {
        if (rm.getKind() == Member.FIELD) {
          if (methodName.startsWith("ajc$inlineAccessField")) {
            ResolvedMember resolvedDooberry = world.resolve(rm);
            annotations = resolvedDooberry.getAnnotationTypes();
          } else {
            ResolvedMember realthing = AjcMemberMaker.interFieldInitializer(rm, memberHostType);
            ResolvedMember resolvedDooberry = world.resolve(realthing);
            annotations = resolvedDooberry.getAnnotationTypes();
          }
        } else if (rm.getKind() == Member.METHOD && !rm.isAbstract()) {
          if (methodName.startsWith("ajc$inlineAccessMethod") || methodName.startsWith("ajc$superDispatch")) {
            ResolvedMember resolvedDooberry = world.resolve(declaredSig);
            annotations = resolvedDooberry.getAnnotationTypes();
          } else {
            ResolvedMember realthing = AjcMemberMaker.interMethodDispatcher(rm.resolve(world), memberHostType).resolve(
                world);
            ResolvedMember theRealMember = findResolvedMemberNamed(memberHostType.resolve(world), realthing.getName(),
                realthing.getParameterTypes());
            if (theRealMember == null) {
              throw new UnsupportedOperationException(
                  "Known limitation in M4 - can't find ITD members when type variable is used as an argument and has upper bound specified");
            }
            annotations = theRealMember.getAnnotationTypes();
          }
        } else if (rm.getKind() == Member.CONSTRUCTOR) {
          ResolvedMember realThing = AjcMemberMaker.postIntroducedConstructor(memberHostType.resolve(world),
              rm.getDeclaringType(), rm.getParameterTypes());
          ResolvedMember resolvedDooberry = world.resolve(realThing);
          // AMC temp guard for M4
          if (resolvedDooberry == null) {
            throw new UnsupportedOperationException(
View Full Code Here

    return defineClass(name, b, 0, b.length, cs);
  }

  protected byte[] getBytes(String name) throws IOException {
    byte[] b = null;
    UnresolvedType unresolvedType = null;
    try {
      unresolvedType = UnresolvedType.forName(name);
    } catch (BCException bce) {
      if (bce.getMessage().indexOf("nameToSignature") == -1) {
        bce.printStackTrace(System.err);
View Full Code Here

    }
    // out.println("classPath: " + classPath);

    BcelWorld world = new BcelWorld(path);

    UnresolvedType ut = UnresolvedType.forName(name);
    ut.setNeedsModifiableDelegate(true);
    LazyClassGen clazz = new LazyClassGen(BcelWorld.getBcelObjectType(world.resolve(ut)));
    clazz.print(out);
    out.println();
  }
View Full Code Here

    } else if (sig.getKind().equals(Member.FIELD)) {
      BcelWorld w = shadow.getWorld();
      list.append(InstructionFactory.PUSH(cp, makeString(sig.getModifiers(w))));
      list.append(InstructionFactory.PUSH(cp, sig.getName()));
      // see pr227401
      UnresolvedType dType = sig.getDeclaringType();
      if (dType.getTypekind() == TypeKind.PARAMETERIZED || dType.getTypekind() == TypeKind.GENERIC) {
        dType = sig.getDeclaringType().resolve(world).getGenericType();
      }
      list.append(InstructionFactory.PUSH(cp, makeString(dType)));
      list.append(InstructionFactory.PUSH(cp, makeString(sig.getReturnType())));
      list.append(fact.createInvoke(factoryType.getClassName(), signatureMakerName, signatureType, Type.STRINGARRAY4,
View Full Code Here

      kind = Constants.INVOKESPECIAL;
    } else {
      kind = Constants.INVOKEVIRTUAL;
    }

    UnresolvedType targetType = signature.getDeclaringType();
    if (targetType.isParameterizedType()) {
      targetType = targetType.resolve(world).getGenericType();
    }
    return fact.createInvoke(targetType.getName(), signature.getName(), BcelWorld.makeBcelType(signature.getReturnType()),
        BcelWorld.makeBcelTypes(signature.getParameterTypes()), kind);
  }
View Full Code Here

  public static boolean isSuppressing(Member member, String lintkey) {
    boolean isSuppressing = Utils.isSuppressing(member.getAnnotations(), lintkey);
    if (isSuppressing) {
      return true;
    }
    UnresolvedType type = member.getDeclaringType();
    if (type instanceof ResolvedType) {
      return Utils.isSuppressing(((ResolvedType) type).getAnnotations(), lintkey);
    }
    return false;
  }
View Full Code Here

        return false;
      }
      if (parent.isParameterizedType()) {
        UnresolvedType[] typeParameters = parent.getTypeParameters();
        for (int i = 0; i < typeParameters.length; i++) {
          UnresolvedType typeParameter = typeParameters[i];
          if (typeParameter instanceof ResolvedType && ((ResolvedType) typeParameter).isMissing()) {
            reportError("Unablet to resolve type parameter '" + typeParameter.getName() + "' from " + stringify());
            return false;
          }
        }
      }
    } else {
View Full Code Here

          } else if (nextChunk.equals("JoinPoint.StaticPart")) {
            nextChunk = "org.aspectj.lang.JoinPoint$StaticPart";
          } else if (nextChunk.equals("ProceedingJoinPoint")) {
            nextChunk = "org.aspectj.lang.ProceedingJoinPoint";
          }
          UnresolvedType unresolvedParamType = UnresolvedType.forName(nextChunk);
          resolvedParamType = world.resolve(unresolvedParamType);
        } else {
          String typename = nextChunk.substring(0, space);
          if (typename.equals("JoinPoint")) {
            typename = "org.aspectj.lang.JoinPoint";
          } else if (typename.equals("JoinPoint.StaticPart")) {
            typename = "org.aspectj.lang.JoinPoint$StaticPart";
          } else if (typename.equals("ProceedingJoinPoint")) {
            typename = "org.aspectj.lang.ProceedingJoinPoint";
          }
          UnresolvedType unresolvedParamType = UnresolvedType.forName(typename);
          resolvedParamType = world.resolve(unresolvedParamType);
          String paramname = nextChunk.substring(space).trim();
          paramNames.add(paramname);
        }
        if (resolvedParamType.isMissing()) {
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.UnresolvedType$TypeKind

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.