From: aclement Date: Tue, 3 Oct 2006 14:30:21 +0000 (+0000) Subject: test and fixes for 152366: support AND in include/exclude/dump X-Git-Tag: BEFORE_133532~18 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7b831ff7356725b9872a9635d1e0eeb035f2790b;p=aspectj.git test and fixes for 152366: support AND in include/exclude/dump --- diff --git a/loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java b/loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java index 2800ebece..2e109527a 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java @@ -193,17 +193,17 @@ public class DocumentParser extends DefaultHandler { } else if (ASPECTS_ELEMENT.equals(qName)) { m_inAspects = true; } else if (INCLUDE_ELEMENT.equals(qName) && m_inWeaver) { - String typePattern = attributes.getValue(WITHIN_ATTRIBUTE); + String typePattern = getWithinAttribute(attributes); if (!isNull(typePattern)) { m_definition.getIncludePatterns().add(typePattern); } } else if (EXCLUDE_ELEMENT.equals(qName) && m_inWeaver) { - String typePattern = attributes.getValue(WITHIN_ATTRIBUTE); + String typePattern = getWithinAttribute(attributes); if (!isNull(typePattern)) { m_definition.getExcludePatterns().add(typePattern); } } else if (DUMP_ELEMENT.equals(qName) && m_inWeaver) { - String typePattern = attributes.getValue(WITHIN_ATTRIBUTE); + String typePattern = getWithinAttribute(attributes); if (!isNull(typePattern)) { m_definition.getDumpPatterns().add(typePattern); } @@ -212,12 +212,12 @@ public class DocumentParser extends DefaultHandler { m_definition.setDumpBefore(true); } } else if (EXCLUDE_ELEMENT.equals(qName) && m_inAspects) { - String typePattern = attributes.getValue(WITHIN_ATTRIBUTE); + String typePattern = getWithinAttribute(attributes); if (!isNull(typePattern)) { m_definition.getAspectExcludePatterns().add(typePattern); } } else if (INCLUDE_ELEMENT.equals(qName) && m_inAspects) { - String typePattern = attributes.getValue(WITHIN_ATTRIBUTE); + String typePattern = getWithinAttribute(attributes); if (!isNull(typePattern)) { m_definition.getAspectIncludePatterns().add(typePattern); } @@ -227,6 +227,10 @@ public class DocumentParser extends DefaultHandler { super.startElement(uri, localName, qName, attributes); } + private String getWithinAttribute(Attributes attributes) { + return replaceXmlAnd(attributes.getValue(WITHIN_ATTRIBUTE)); + } + public void endElement(String uri, String localName, String qName) throws SAXException { if (CONCRETE_ASPECT_ELEMENT.equals(qName)) { m_lastConcreteAspect = null; diff --git a/tests/ltw/inclExcl/aop-aspectinclexcl.xml b/tests/ltw/inclExcl/aop-aspectinclexcl.xml new file mode 100644 index 000000000..5f4c88d50 --- /dev/null +++ b/tests/ltw/inclExcl/aop-aspectinclexcl.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tests/ltw/inclExcl/aop-exclude.xml b/tests/ltw/inclExcl/aop-exclude.xml new file mode 100644 index 000000000..b13fcf099 --- /dev/null +++ b/tests/ltw/inclExcl/aop-exclude.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tests/ltw/inclExcl/aop-include.xml b/tests/ltw/inclExcl/aop-include.xml new file mode 100644 index 000000000..afdac0f49 --- /dev/null +++ b/tests/ltw/inclExcl/aop-include.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tests/ltw/inclExcl/pkg/Main.aj b/tests/ltw/inclExcl/pkg/Main.aj new file mode 100644 index 000000000..6cf8ae986 --- /dev/null +++ b/tests/ltw/inclExcl/pkg/Main.aj @@ -0,0 +1,46 @@ +package pkg; + +import java.io.File; + +public class Main { + public static void main(String argz[]) { + foo(); + } + + public static void foo() { + (new pkg.sub.Foo()).foo(); + + File dumpDir = new File("_ajdump"); + lsLR(dumpDir); + + // the LTW harness should clean up _ajdump files! + cleanup(dumpDir); + } + + public static void lsLR(File dir) { + String[] files = dir.list(); + if (files == null) return; + for (int i=0; i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file