diff options
author | wisberg <wisberg> | 2003-09-06 23:57:20 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2003-09-06 23:57:20 +0000 |
commit | a953927a44eaea7db460a144a7ecaecb9ec15a7e (patch) | |
tree | 6cf2077a60e5e4ef14f3124e9bab16515c2a393f /docs/sandbox | |
parent | d6f8ca124ba8bfd58350f1019ca3000aea0287d1 (diff) | |
download | aspectj-a953927a44eaea7db460a144a7ecaecb9ec15a7e.tar.gz aspectj-a953927a44eaea7db460a144a7ecaecb9ec15a7e.zip |
using linked list, more comments
Diffstat (limited to 'docs/sandbox')
-rw-r--r-- | docs/sandbox/api-clients/org/aspectj/samples/AffectedFilesReporter.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/docs/sandbox/api-clients/org/aspectj/samples/AffectedFilesReporter.java b/docs/sandbox/api-clients/org/aspectj/samples/AffectedFilesReporter.java index 0a0a0a4e6..26572684f 100644 --- a/docs/sandbox/api-clients/org/aspectj/samples/AffectedFilesReporter.java +++ b/docs/sandbox/api-clients/org/aspectj/samples/AffectedFilesReporter.java @@ -13,14 +13,19 @@ import java.util.*; /** - * Run ajc and write "affected.lst" file listing those files - * affected by advice or inter-type declarations. + * Run ajc and list files affected by advice or inter-type declarations. * * WARNING: Does not emit info messages for uses-pointcut dependencies. * @author Wes Isberg */ public class AffectedFilesReporter implements Runnable { + /* + * Walk down asm hierarchy, looking for source files, + * and check if any of their children has a relation of + * kind ADVICE or INTER_TYPE_DECLARATION + */ + /** * Wrapper for ajc that emits list of affected files. * @param args the String[] of args for ajc, @@ -60,8 +65,8 @@ public class AffectedFilesReporter implements Runnable { sink.println("# no structure model - use -emacssym option"); return; } - List /*IProgramElement*/ nodes = new ArrayList(); - List /*IProgramElement*/ newNodes = new ArrayList(); + List /*IProgramElement*/ nodes = new LinkedList(); + List /*IProgramElement*/ newNodes = new LinkedList(); // root could be config file or blank root - either way, use kids nodes.addAll(hierarchy.getRoot().getChildren()); while (0 < nodes.size()) { @@ -93,8 +98,8 @@ public class AffectedFilesReporter implements Runnable { private boolean isAffected(final IProgramElement fileNode) { final IRelationshipMap map = AsmManager.getDefault().getRelationshipMap(); - List /*IProgramElement*/ nodes = new ArrayList(); - List /*IProgramElement*/ newNodes = new ArrayList(); + List /*IProgramElement*/ nodes = new LinkedList(); + List /*IProgramElement*/ newNodes = new LinkedList(); nodes.add(fileNode); while (0 < nodes.size()) { for (ListIterator iter = nodes.listIterator(); @@ -121,4 +126,4 @@ public class AffectedFilesReporter implements Runnable { return false; } } -// END-SAMPLE api-asm-listAffectedFiles Walk model to list affected files +// END-SAMPLE api-asm-listAffectedFiles |