summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-06-08 15:15:30 +0000
committeracolyer <acolyer>2004-06-08 15:15:30 +0000
commit9c0a95f7c55f55c14ab57c418e4a55ef234c67c9 (patch)
tree0b92afdb0baaec3679bd4ea0f4d82f0334c2f087
parent3120e45482a24a197ae2153238e104af8b2c6862 (diff)
downloadaspectj-9c0a95f7c55f55c14ab57c418e4a55ef234c67c9.tar.gz
aspectj-9c0a95f7c55f55c14ab57c418e4a55ef234c67c9.zip
removed hard-wired dependency on AjBuildConfig
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java2
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java26
2 files changed, 23 insertions, 5 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
index 36d270870..e78ac25f8 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
@@ -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");
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
index 848b4db6d..c5ce71bb6 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
@@ -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;
+ }
}