Package org.aspectj.org.eclipse.jdt.internal.compiler.lookup

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope


      if (packageBinding != null) return packageBinding;
    }
    if (this.innerTypeBinding != null && this.dimensions > 0) {
      return null;
    }
    CompilationUnitScope scope = this.resolver.scope();
    if (scope != null) {
      return this.resolver.getPackageBinding(scope.getCurrentPackage());
    }
    return null;
  }
View Full Code Here


        addClassAndParentsToPrefixes(((ClassScope) currentScope).referenceType().binding, importedPrefixesList);
      }
      currentScope = currentScope.parent;
    }

    CompilationUnitScope cuScope = (CompilationUnitScope) currentScope;

    String packageName = new String(CharOperation.concatWith(cuScope.currentPackageName, '.'));
    // System.err.println("package: " + packageName);
    if (packageName.length() > 0) {
      importedPrefixesList.add(packageName + ".");
View Full Code Here

  DefaultBindingResolver(LookupEnvironment lookupEnvironment, WorkingCopyOwner workingCopyOwner, BindingTables bindingTables, boolean isRecoveredBinding) {
    this.newAstToOldAst = new HashMap();
    this.astNodesToBlockScope = new HashMap();
    this.bindingsToAstNodes = new HashMap();
    this.bindingTables = bindingTables;
    this.scope = new CompilationUnitScope(new CompilationUnitDeclaration(null, null, -1), lookupEnvironment);
    this.workingCopyOwner = workingCopyOwner;
    this.isRecoveredBinding = isRecoveredBinding;
  }
View Full Code Here

    // this point
    // this MUST be done in order from super-types to subtypes
    List<SourceTypeBinding> typesToProcess = new ArrayList<SourceTypeBinding>();
    List<SourceTypeBinding> aspectsToProcess = new ArrayList<SourceTypeBinding>();
    for (int i = lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
      CompilationUnitScope cus = units[i].scope;
      SourceTypeBinding[] stbs = cus.topLevelTypes;
      for (int j = 0; j < stbs.length; j++) {
        SourceTypeBinding stb = stbs[j];
        typesToProcess.add(stb);
        TypeDeclaration typeDeclaration = stb.scope.referenceContext;
        if (typeDeclaration instanceof AspectDeclaration) {
          aspectsToProcess.add(stb);
        }
      }
    }
    factory.getWorld().getCrosscuttingMembersSet().reset();

    // Need to do these before the other ITDs
    for (SourceTypeBinding aspectToProcess : aspectsToProcess) {
      processInterTypeMemberTypes(aspectToProcess.scope);
    }

    while (typesToProcess.size() > 0) {
      // removes types from the list as they are processed...
      collectAllITDsAndDeclares(typesToProcess.get(0), typesToProcess);
    }

    factory.finishTypeMungers();

    // now do weaving
    List<ConcreteTypeMunger> typeMungers = factory.getTypeMungers();

    List<DeclareParents> declareParents = factory.getDeclareParents();
    List<DeclareAnnotation> declareAnnotationOnTypes = factory.getDeclareAnnotationOnTypes();

    doPendingWeaves();

    // We now have some list of types to process, and we are about to apply
    // the type mungers.
    // There can be situations where the order of types passed to the
    // compiler causes the
    // output from the compiler to vary - THIS IS BAD. For example, if we
    // have class A
    // and class B extends A. Also, an aspect that 'declare parents: A+
    // implements Serializable'
    // then depending on whether we see A first, we may or may not make B
    // serializable.

    // The fix is to process them in the right order, ensuring that for a
    // type we process its
    // supertypes and superinterfaces first. This algorithm may have
    // problems with:
    // - partial hierarchies (e.g. suppose types A,B,C are in a hierarchy
    // and A and C are to be woven but not B)
    // - weaving that brings new types in for processing (see
    // pendingTypesToWeave.add() calls) after we thought
    // we had the full list.
    //
    // but these aren't common cases (he bravely said...)
    boolean typeProcessingOrderIsImportant = declareParents.size() > 0 || declareAnnotationOnTypes.size() > 0; // DECAT

    if (typeProcessingOrderIsImportant) {
      typesToProcess = new ArrayList<SourceTypeBinding>();
      for (int i = lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
        CompilationUnitScope cus = units[i].scope;
        SourceTypeBinding[] stbs = cus.topLevelTypes;
        for (int j = 0; j < stbs.length; j++) {
          SourceTypeBinding stb = stbs[j];
          typesToProcess.add(stb);
        }
View Full Code Here

        addClassAndParentsToPrefixes(((ClassScope)currentScope).referenceType().binding, importedPrefixesList);
      }
      currentScope = currentScope.parent;
    }
   
    CompilationUnitScope cuScope = (CompilationUnitScope)currentScope;

    String packageName =
      new String(CharOperation.concatWith(cuScope.currentPackageName, '.'));
    //System.err.println("package: " + packageName);
    if (packageName.length() > 0) {
View Full Code Here

   
    // need to build inter-type declarations for all AspectDeclarations at this point
    // this MUST be done in order from super-types to subtypes
    List typesToProcess = new ArrayList();
    for (int i=lastCompletedUnitIndex+1; i<=lastUnitIndex; i++) {
      CompilationUnitScope cus = units[i].scope;
      SourceTypeBinding[] stbs = cus.topLevelTypes;
      for (int j=0; j<stbs.length; j++) {
        SourceTypeBinding stb = stbs[j];
        typesToProcess.add(stb);
      }
    }

    while (typesToProcess.size()>0) {
      // removes types from the list as they are processed...
      collectAllITDsAndDeclares((SourceTypeBinding)typesToProcess.get(0),typesToProcess);
    }   
       
    factory.finishTypeMungers();
 
    // now do weaving
    Collection typeMungers = factory.getTypeMungers();
   
    Collection declareParents = factory.getDeclareParents();
    Collection declareAnnotationOnTypes = factory.getDeclareAnnotationOnTypes();

    doPendingWeaves();
   
    // We now have some list of types to process, and we are about to apply the type mungers.
    // There can be situations where the order of types passed to the compiler causes the
    // output from the compiler to vary - THIS IS BAD.  For example, if we have class A
    // and class B extends A.  Also, an aspect that 'declare parents: A+ implements Serializable'
    // then depending on whether we see A first, we may or may not make B serializable.
   
    // The fix is to process them in the right order, ensuring that for a type we process its
    // supertypes and superinterfaces first.  This algorithm may have problems with:
    // - partial hierarchies (e.g. suppose types A,B,C are in a hierarchy and A and C are to be woven but not B)
    // - weaving that brings new types in for processing (see pendingTypesToWeave.add() calls) after we thought
    //   we had the full list.
    //
    // but these aren't common cases (he bravely said...)
    boolean typeProcessingOrderIsImportant = declareParents.size()>0 || declareAnnotationOnTypes.size()>0; //DECAT
   
    if (typeProcessingOrderIsImportant) {
      typesToProcess = new ArrayList();
      for (int i=lastCompletedUnitIndex+1; i<=lastUnitIndex; i++) {
        CompilationUnitScope cus = units[i].scope;
        SourceTypeBinding[] stbs = cus.topLevelTypes;
        for (int j=0; j<stbs.length; j++) {
          SourceTypeBinding stb = stbs[j];
          typesToProcess.add(stb);
        }
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope

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.