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");
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
}
- 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(
}
public void finishedCompilationUnit(CompilationUnitDeclaration unit) {
- if (buildManager.doGenerateModel()) {
+ if ((buildManager != null) && buildManager.doGenerateModel()) {
AsmHierarchyBuilder.build(unit, buildManager.getStructureModel(), buildManager.buildConfig);
}
}
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;
+ }
}