return false;
}
}
- boolean fastAccept = false;//defaults to false if no fast include
- for (int i = 0; i < m_includeStartsWith.size(); i++) {
- fastAccept = fastClassName.startsWith((String)m_includeStartsWith.get(i));
- if (fastAccept) {
- break;
+
+ /*
+ * Bug 120363
+ * If we have an exclude pattern that cannot be matched using "starts with"
+ * then we cannot fast accept
+ */
+ if (m_excludeTypePattern.isEmpty()) {
+ boolean fastAccept = false;//defaults to false if no fast include
+ for (int i = 0; i < m_includeStartsWith.size(); i++) {
+ fastAccept = fastClassName.startsWith((String)m_includeStartsWith.get(i));
+ if (fastAccept) {
+ break;
+ }
}
}
- if (fastAccept) {
- return true;
- }
// needs further analysis
// TODO AV - needs refactoring
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Matthew Webster - initial implementation
- *******************************************************************************/
-package ataspectj;
-
-public class Test$$EnhancerByCGLIB$$12345 {
-
- public static void main(String[] args) {
- System.out.println("Test$$EnhancerByCGLIB$$12345.main()");
- }
-
-}
<?xml version="1.0"?>
<aspectj>
- <weaver options="-verbose">
- <dump within="ataspectj..*" beforeandafter="true"/>
- </weaver>
+ <weaver options="-XlazyTjp -verbose">
+ <dump within="com.foo.bar..*" beforeandafter="true"/>
+ <include within="com.foo..*"/>
+ <exclude within="com.foo.bar..*CGLIB*"/>
+ </weaver>
</aspectj>
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Matthew Webster - initial implementation
+ *******************************************************************************/
+package com.foo.bar;
+
+public class Test$$EnhancerByCGLIB$$12345 {
+
+ public static void main(String[] args) {
+ System.out.println("Test$$EnhancerByCGLIB$$12345.main()");
+ Test.main(args);
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Matthew Webster - initial implementation
+ *******************************************************************************/
+package com.foo.bar;
+
+public class Test {
+
+ public static void main(String[] args) {
+ System.out.println("Test.main()");
+ }
+
+}
public void testLTWDumpBeforeAndAfter() {
runTest("LTW DumpTest before and after");
+
+ // before
+ File f = new File("_ajdump/_before/com/foo/bar");
+ CountingFilenameFilter cff = new CountingFilenameFilter();
+ f.listFiles(cff);
+ assertEquals("Expected dump file in " + f.getAbsolutePath(),1,cff.getCount());
- File f = new File("_ajdump/_before/ataspectj/Test$$EnhancerByCGLIB$$12345.class");
- assertTrue(f.exists());
- f = new File("_ajdump/ataspectj/Test$$EnhancerByCGLIB$$12345.class");
- assertTrue(f.exists());
+ // after
+ f = new File("_ajdump/com/foo/bar");
+ cff = new CountingFilenameFilter();
+ f.listFiles(cff);
+ assertEquals("Expected dump file in " + f.getAbsolutePath(),1,cff.getCount());
// tidy up...
f = new File("_ajdump");
// The working directory is different because this test must be forked
File dir = new File("../tests/java5/ataspectj");
File f = new File(dir,"_ajdump/_before");
- System.out.println("AtAjLTWTests.testLTWDumpProxy() f=" + f.getAbsolutePath());
CountingFilenameFilter cff = new CountingFilenameFilter();
f.listFiles(cff);
assertEquals("Expected dump file in " + f.getAbsolutePath(),1,cff.getCount());
f = new File(dir,"_ajdump");
- System.out.println("AtAjLTWTests.testLTWDumpProxy() f=" + f.getAbsolutePath());
cff = new CountingFilenameFilter();
f.listFiles(cff);
assertEquals(1,cff.getCount());
options="-1.5"/>
<run class="ataspectj.DumpTest" ltw="ataspectj/aop-dump.xml"/>
</ajc-test>
-
+
<ajc-test dir="java5/ataspectj" title="LTW DumpTest before and after">
<compile
- files="ataspectj/Test$$EnhancerByCGLIB$$12345.java"
+ files="com/foo/bar/Test.java, com/foo/bar/Test$$EnhancerByCGLIB$$12345.java"
options="-1.5"/>
- <run class="ataspectj.Test$$EnhancerByCGLIB$$12345" ltw="ataspectj/aop-dumpbeforeandafter.xml"/>
+ <run class="com.foo.bar.Test$$EnhancerByCGLIB$$12345" ltw="ataspectj/aop-dumpbeforeandafter.xml">
+ <stdout>
+ <line text="Test$$EnhancerByCGLIB$$12345.main()"/>
+ <line text="Test.main()"/>
+ </stdout>
+ <stderr>
+ <line text="info weaving 'com.foo.bar.Test'"/>
+ </stderr>
+ </run>
</ajc-test>
<ajc-test dir="java5/ataspectj" title="LTW DumpTest closure">