Package org.aspectj.asm

Examples of org.aspectj.asm.AsmManager$CanonicalFilePathMap


      for (int i = 0; i < filenames.size(); i++) {
        inputFiles[i] = new File((String) filenames.elementAt(i));
      }

      // PHASE 0: call ajc
      AsmManager model = callAjc(inputFiles);
      if (CompilerWrapper.hasErrors()) {
        System.out.println(FAIL_MESSAGE);
        aborted = true;
        errors = CompilerWrapper.getErrors();
        return;
View Full Code Here


    if (world.getModel() != null && world.isMinimalModel()) {
      candidatesForRemoval = new HashSet<IProgramElement>();
    }
    if (world.getModel() != null && !isBatchWeave) {
      AsmManager manager = world.getModelAsAsmManager();
      for (Iterator<UnwovenClassFile> i = input.getClassFileIterator(); i.hasNext();) {
        UnwovenClassFile classFile = i.next();
        // remove all relationships where this file being woven is
        // the target of the relationship
        manager.removeRelationshipsTargettingThisType(classFile.getClassName());
      }
    }

    // Go through the types and ensure any 'damaged' during compile time are
    // repaired prior to weaving
View Full Code Here

        checkDeclareTypeErrorOrWarning(world, classType);
      }
      // this is very odd return behavior trying to keep everyone happy

      // can we remove it from the model now? we know it contains no relationship endpoints...
      AsmManager model = world.getModelAsAsmManager();
      if (world.isMinimalModel() && model != null && !classType.isAspect()) {
        AspectJElementHierarchy hierarchy = (AspectJElementHierarchy) model.getHierarchy();
        String pkgname = classType.getResolvedTypeX().getPackageName();
        String tname = classType.getResolvedTypeX().getSimpleBaseName();
        IProgramElement typeElement = hierarchy.findElementForType(pkgname, tname);
        if (typeElement != null && hasInnerType(typeElement)) {
          // Cannot remove it right now (has inner type), schedule it
View Full Code Here

    IStructureViewNode svNode = createDeclaration(node, icon, children);
    String nodeHandle = node.getHandleIdentifier();
    // Don't put relationships on fields as they can then appear twice when building the outline -
    // once under clinit field-set nodes and once under the field declaration.
    if (nodeHandle != null && !node.getKind().equals(IProgramElement.Kind.FIELD)) {
      AsmManager manager = Ajde.getDefault().getModel();
      IRelationshipMap relMap = (manager == null ? null : manager.getRelationshipMap());
      List relationships = (relMap == null ? null : relMap.get(nodeHandle));
      if (relationships != null) {
        for (Iterator it = relationships.iterator(); it.hasNext();) {
          IRelationship rel = (IRelationship) it.next();
          if (rel != null && rel.getTargets().size() > 0) {
View Full Code Here

   * (List<BcelTypeMunger>. It will iterate over the fields repeatedly until everything has been applied.
   */
  private boolean weaveAtMethodOnITDSRepeatedly(List<DeclareAnnotation> decaMCs,
      List<ConcreteTypeMunger> itdsForMethodAndConstructor, List<Integer> reportedErrors) {
    boolean isChanged = false;
    AsmManager asmManager = world.getModelAsAsmManager();
    for (ConcreteTypeMunger methodctorMunger : itdsForMethodAndConstructor) {
      // for (Iterator iter = itdsForMethodAndConstructor.iterator(); iter.hasNext();) {
      // BcelTypeMunger methodctorMunger = (BcelTypeMunger) iter.next();
      ResolvedMember unMangledInterMethod = methodctorMunger.getSignature();
      List<DeclareAnnotation> worthRetrying = new ArrayList<DeclareAnnotation>();
View Full Code Here

    // AsmManager.setCreatingModel(config.isEmacsSymMode() || config.isGenerateModelMode());
    // if (!AsmManager.isCreatingModel())
    // return;

    CompilationResultDestinationManager crdm = config.getCompilationResultDestinationManager();
    AsmManager structureModel = AsmManager.createNewStructureModel(crdm == null ? Collections.EMPTY_MAP : crdm.getInpathMap());
    // AsmManager.getDefault().getRelationshipMap().clear();
    IHierarchy model = structureModel.getHierarchy();
    String rootLabel = "<root>";

    IProgramElement.Kind kind = IProgramElement.Kind.FILE_JAVA;
    if (buildConfig.getConfigFile() != null) {
      rootLabel = buildConfig.getConfigFile().getName();
View Full Code Here

      info.addConcreteMunger(this);
    }

    if (changed && worthReporting) {
      ResolvedType declaringAspect = null;
      AsmManager model = ((BcelWorld) getWorld()).getModelAsAsmManager();
      if (model != null) {
        if (munger instanceof NewParentTypeMunger) {
          NewParentTypeMunger nptMunger = (NewParentTypeMunger) munger;
          declaringAspect = nptMunger.getDeclaringType();
          if (declaringAspect.isParameterizedOrGenericType()) {
            declaringAspect = declaringAspect.getRawType();
          }
          ResolvedType thisAspect = getAspectType();
          AsmRelationshipProvider.addRelationship(model, weaver.getLazyClassGen().getType(), munger, thisAspect);

          // Add a relationship on the actual declaring aspect too
          if (!thisAspect.equals(declaringAspect)) {
            // Might be the case the declaring aspect is generic and thisAspect is parameterizing it. In that case
            // record the actual parameterizations

            ResolvedType target = weaver.getLazyClassGen().getType();
            ResolvedType newParent = nptMunger.getNewParent();
            IProgramElement thisAspectNode = model.getHierarchy().findElementForType(thisAspect.getPackageName(),
                thisAspect.getClassName());
            Map<String, List<String>> declareParentsMap = thisAspectNode.getDeclareParentsMap();
            if (declareParentsMap == null) {
              declareParentsMap = new HashMap<String, List<String>>();
              thisAspectNode.setDeclareParentsMap(declareParentsMap);
View Full Code Here

   * (List<BcelTypeMunger>. It will iterate over the fields repeatedly until everything has been applied.
   */
  private boolean weaveAtMethodOnITDSRepeatedly(List<DeclareAnnotation> decaMCs,
      List<ConcreteTypeMunger> itdsForMethodAndConstructor, List<Integer> reportedErrors) {
    boolean isChanged = false;
    AsmManager asmManager = world.getModelAsAsmManager();
    for (ConcreteTypeMunger methodctorMunger : itdsForMethodAndConstructor) {
      // for (Iterator iter = itdsForMethodAndConstructor.iterator(); iter.hasNext();) {
      // BcelTypeMunger methodctorMunger = (BcelTypeMunger) iter.next();
      ResolvedMember unMangledInterMethod = methodctorMunger.getSignature();
      List<DeclareAnnotation> worthRetrying = new ArrayList<DeclareAnnotation>();
View Full Code Here

    List<ResolvedPointcutDefinition> pointcuts = new ArrayList<ResolvedPointcutDefinition>();
    typeMungers = new ArrayList<ConcreteTypeMunger>();
    declares = new ArrayList<Declare>();
    processAttributes(l, pointcuts, false);
    ReferenceType type = getResolvedTypeX();
    AsmManager asmManager = ((BcelWorld) type.getWorld()).getModelAsAsmManager();
    l = AtAjAttributes.readAj5ClassAttributes(asmManager, javaClass, type, type.getSourceContext(), msgHandler,
        isCodeStyleAspect);
    AjAttribute.Aspect deferredAspectAttribute = processAttributes(l, pointcuts, true);

    if (pointcuts.size() == 0) {
View Full Code Here

      info.addConcreteMunger(this);
    }

    if (changed && worthReporting) {
      ResolvedType declaringAspect = null;
      AsmManager model = ((BcelWorld) getWorld()).getModelAsAsmManager();
      if (model != null) {
        if (munger instanceof NewParentTypeMunger) {
          NewParentTypeMunger nptMunger = (NewParentTypeMunger) munger;
          declaringAspect = nptMunger.getDeclaringType();
          if (declaringAspect.isParameterizedOrGenericType()) {
            declaringAspect = declaringAspect.getRawType();
          }
          ResolvedType thisAspect = getAspectType();
          AsmRelationshipProvider.addRelationship(model, weaver.getLazyClassGen().getType(), munger, thisAspect);

          // Add a relationship on the actual declaring aspect too
          if (!thisAspect.equals(declaringAspect)) {
            // Might be the case the declaring aspect is generic and thisAspect is parameterizing it. In that case
            // record the actual parameterizations

            ResolvedType target = weaver.getLazyClassGen().getType();
            ResolvedType newParent = nptMunger.getNewParent();
            IProgramElement thisAspectNode = model.getHierarchy().findElementForType(thisAspect.getPackageName(),
                thisAspect.getClassName());
            Map<String, List<String>> declareParentsMap = thisAspectNode.getDeclareParentsMap();
            if (declareParentsMap == null) {
              declareParentsMap = new HashMap<String, List<String>>();
              thisAspectNode.setDeclareParentsMap(declareParentsMap);
View Full Code Here

TOP

Related Classes of org.aspectj.asm.AsmManager$CanonicalFilePathMap

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.