Package org.aspectj.weaver

Examples of org.aspectj.weaver.ReferenceTypeDelegate


    }
    ResolvedType toResolve = ret;
    if (ret.isParameterizedType() || ret.isGenericType()) {
      toResolve = toResolve.getGenericType();
    }
    ReferenceTypeDelegate rtd = resolveReflectionTypeDelegate((ReferenceType) toResolve, getClassLoader());
    ((ReferenceType) ret).setDelegate(rtd);
    return ret;
  }
View Full Code Here


          // a previous compiler run. In this case I assert the
          // delegate will still be an EclipseSourceType
          // and we can ignore the problem here (the original compile
          // error will be reported again from
          // the eclipse source type) - pr113531
          ReferenceTypeDelegate theDelegate = ((ReferenceType) theType).getDelegate();
          if (theDelegate.getClass().getName().endsWith("EclipseSourceType")) {
            continue;
          }

          throw new BCException("Can't find bcel delegate for " + className + " type=" + theType.getClass());
        }
        weaveAndNotify(classFile, classType, requestor);
        wovenClassNames.add(className);
      }
    }

    CompilationAndWeavingContext.leavingPhase(aspectToken);

    requestor.weavingClasses();
    ContextToken classToken = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.WEAVING_CLASSES, "");
    // then weave into non-aspects
    for (Iterator<UnwovenClassFile> i = input.getClassFileIterator(); i.hasNext();) {
      UnwovenClassFile classFile = i.next();
      String className = classFile.getClassName();
      ResolvedType theType = world.resolve(className);
      if (!theType.isAspect()) {
        BcelObjectType classType = BcelWorld.getBcelObjectType(theType);
        if (classType == null) {

          // bug 119882 - see above comment for bug 113531
          ReferenceTypeDelegate theDelegate = ((ReferenceType) theType).getDelegate();

          // TODO urgh - put a method on the interface to check this,
          // string compare is hideous
          if (theDelegate.getClass().getName().endsWith("EclipseSourceType")) {
            continue;
          }

          throw new BCException("Can't find bcel delegate for " + className + " type=" + theType.getClass());
        }
View Full Code Here

      return null;
    }
    if (!(concreteAspect instanceof ReferenceType)) { // Might be Missing
      return null;
    }
    ReferenceTypeDelegate rtDelegate = ((ReferenceType) concreteAspect).getDelegate();
    if (rtDelegate instanceof BcelObjectType) {
      return (BcelObjectType) rtDelegate;
    } else {
      return null;
    }
View Full Code Here

  }
 
  private Signature.FormalTypeParameter[] getFormalTypeParametersFromOuterClass() {
    List typeParameters = new ArrayList();
    ReferenceType outer = getOuterClass();
    ReferenceTypeDelegate outerDelegate = outer.getDelegate();
    if (!(outerDelegate instanceof BcelObjectType)) {
      throw new IllegalStateException("How come we're in BcelObjectType resolving an inner type of something that is NOT a BcelObjectType??");
    }
    BcelObjectType outerObjectType = (BcelObjectType) outerDelegate;
    if (outerObjectType.isNestedClass()) {
View Full Code Here

     * Retrieve a bcel delegate for an aspect - this will return NULL if the
     * delegate is an EclipseSourceType and not a BcelObjectType - this happens
     * quite often when incrementally compiling.
     */
  public static BcelObjectType getBcelObjectType(ResolvedType concreteAspect) {
    ReferenceTypeDelegate rtDelegate = ((ReferenceType)concreteAspect).getDelegate();
    if (rtDelegate instanceof BcelObjectType) {
      return (BcelObjectType)rtDelegate;
    } else {
      return null;
    }
View Full Code Here

         
          // Sometimes.. if the Bcel Delegate couldn't be found then a problem occurred at compile time - on
          // a previous compiler run.  In this case I assert the delegate will still be an EclipseSourceType
          // and we can ignore the problem here (the original compile error will be reported again from
          // the eclipse source type) - pr113531
          ReferenceTypeDelegate theDelegate = ((ReferenceType)theType).getDelegate();
          if (theDelegate.getClass().getName().endsWith("EclipseSourceType")) continue;

          throw new BCException("Can't find bcel delegate for "+className+" type="+theType.getClass());
        }
            weaveAndNotify(classFile, classType,requestor);
            wovenClassNames.add(className);
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.ReferenceTypeDelegate

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.