]> source.dussan.org Git - aspectj.git/commitdiff
removed hard-wired dependency on AjBuildConfig
authoracolyer <acolyer>
Tue, 8 Jun 2004 15:15:30 +0000 (15:15 +0000)
committeracolyer <acolyer>
Tue, 8 Jun 2004 15:15:30 +0000 (15:15 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java

index 36d270870686faea3bd0ad5e2ec45f68002ff7e6..e78ac25f8ad65f54171abfd2f271b7b0704fb4ad 100644 (file)
@@ -127,7 +127,7 @@ public class AspectDeclaration extends TypeDeclaration {
                ResolvedTypeX superType = myType.getSuperclass();               
                
                // can't be Serializable/Cloneable unless -XserializableAspects
-               if (!world.buildManager.buildConfig.isXserializableAspects()) {
+               if (!world.isXSerializableAspects()) {
                        if (world.getWorld().resolve(TypeX.SERIALIZABLE).isAssignableFrom(myType)) {
                                scope.problemReporter().signalError(sourceStart, sourceEnd,
                                                                "aspects may not implement Serializable");
index 848b4db6d6ebca7d3f9d1adffed3d1eed98d0a61..c5ce71bb61b20cb21cf716e23e1c3b7950f59edd 100644 (file)
@@ -32,8 +32,10 @@ import org.eclipse.jdt.internal.compiler.lookup.*;
 public class EclipseFactory {
        public static boolean DEBUG = false;
        
-       public AjBuildManager buildManager;
+       private AjBuildManager buildManager;
        private LookupEnvironment lookupEnvironment;
+       private boolean xSerializableAspects;
+       private World world;
        
        private Map/*TypeX, TypeBinding*/ typexToBinding = new HashMap();
        //XXX currently unused
@@ -49,12 +51,22 @@ public class EclipseFactory {
        }
        
        
-       public EclipseFactory(LookupEnvironment lookupEnvironment) {
+       public EclipseFactory(LookupEnvironment lookupEnvironment,AjBuildManager buildManager) {
                this.lookupEnvironment = lookupEnvironment;
+               this.buildManager = buildManager;
+               this.world = buildManager.getWorld();
+               this.xSerializableAspects = buildManager.buildConfig.isXserializableAspects();
+       }
+       
+       public EclipseFactory(LookupEnvironment lookupEnvironment, World world, boolean xSer) {
+               this.lookupEnvironment = lookupEnvironment;
+               this.world = world;
+               this.xSerializableAspects = xSer;
+               this.buildManager = null;
        }
        
        public World getWorld() {
-               return buildManager.getWorld();
+               return world;
        }
        
        public void showMessage(
@@ -304,7 +316,7 @@ public class EclipseFactory {
        }
 
        public void finishedCompilationUnit(CompilationUnitDeclaration unit) {
-               if (buildManager.doGenerateModel()) {
+               if ((buildManager != null) && buildManager.doGenerateModel()) {
                        AsmHierarchyBuilder.build(unit, buildManager.getStructureModel(), buildManager.buildConfig);
                }
        }
@@ -338,4 +350,10 @@ public class EclipseFactory {
                        addSourceTypeBinding((SourceTypeBinding) memberTypes[i]);
                }
        }
+       
+       // XXX this doesn't feel like it belongs here, but it breaks a hard dependency on
+       // exposing AjBuildManager (needed by AspectDeclaration).
+       public boolean isXSerializableAspects() {
+               return xSerializableAspects;
+       }
 }