diff options
author | aclement <aclement> | 2006-03-15 12:34:48 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-03-15 12:34:48 +0000 |
commit | b3cd01d587219969e7c7b58ecda5b1aeb7722c2e (patch) | |
tree | 45f7a082c5d2fdae11f538ed46d54a4f61e6d127 /org.aspectj.ajdt.core | |
parent | 1eed8f0c3bc7ec15ea89da1cbf6802c1421be18d (diff) | |
download | aspectj-b3cd01d587219969e7c7b58ecda5b1aeb7722c2e.tar.gz aspectj-b3cd01d587219969e7c7b58ecda5b1aeb7722c2e.zip |
test and fix for 131505: keep aspectnames in the state object
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java | 17 | ||||
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java | 9 |
2 files changed, 20 insertions, 6 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index 9d6d726ec..b08298b0a 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; @@ -132,7 +131,6 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc // FIXME asc should this really be in here? private IHierarchy structureModel; public AjBuildConfig buildConfig; - private List aspectNames = new LinkedList(); AjState state = new AjState(this); @@ -535,9 +533,11 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc PrintStream ps = new PrintStream(baos); ps.println("<aspectj>"); ps.println("<aspects>"); - for (Iterator i = aspectNames.iterator(); i.hasNext();) { - String name = (String)i.next(); - ps.println("<aspect name=\"" + name + "\"/>"); + if (state.getAspectNames() != null) { + for (Iterator i = state.getAspectNames().iterator(); i.hasNext();) { + String name = (String)i.next(); + ps.println("<aspect name=\"" + name + "\"/>"); + } } ps.println("</aspects>"); ps.println("</aspectj>"); @@ -951,7 +951,12 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc ResolvedType type = world.resolve(name); // System.err.println("? writeAspectName() type=" + type); if (type.isAspect()) { - aspectNames.add(name); + if (state.getAspectNames() == null) { + state.initializeAspectNamesList(); + } + if (!state.getAspectNames().contains(name)) { + state.getAspectNames().add(name); + } } } }; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java index e437b5e03..2a9a721ec 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java @@ -161,6 +161,7 @@ public class AjState { private List/*File*/ compiledSourceFiles = new ArrayList(); private List/*String*/ resources = new ArrayList(); + private List/*String*/ aspectNames; private ArrayList/*<String>*/ qualifiedStrings; private ArrayList/*<String>*/ simpleStrings; @@ -1200,4 +1201,12 @@ public class AjState { buildManager.state = null; buildManager.setStructureModel(null); } + + public List getAspectNames() { + return aspectNames; + } + + public void initializeAspectNamesList() { + this.aspectNames = new LinkedList(); + } } |