From: wisberg Date: Sat, 27 Sep 2003 01:46:43 +0000 (+0000) Subject: added test for collection calls X-Git-Tag: mostlyLastEclipse2xTree_20040112~143 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c4ac88ee2890d97a8df494462b5e7b514a11bf84;p=aspectj.git added test for collection calls --- diff --git a/docs/sandbox/sandbox-test.xml b/docs/sandbox/sandbox-test.xml index 0ca083c8c..8a5d0e287 100644 --- a/docs/sandbox/sandbox-test.xml +++ b/docs/sandbox/sandbox-test.xml @@ -145,7 +145,7 @@ - + @@ -230,9 +230,15 @@ - - - + + + + + + + + + diff --git a/docs/sandbox/testsrc/org/aspectj/langlib/PointcutsCW.java b/docs/sandbox/testsrc/org/aspectj/langlib/PointcutsCW.java index bb5e2ade0..ff64fad51 100644 --- a/docs/sandbox/testsrc/org/aspectj/langlib/PointcutsCW.java +++ b/docs/sandbox/testsrc/org/aspectj/langlib/PointcutsCW.java @@ -6,7 +6,7 @@ import java.awt.event.ActionEvent; import java.beans.PropertyChangeListener; import java.io.*; import java.lang.reflect.Method; - +import java.util.*; import javax.swing.*; import javax.swing.Action; @@ -53,7 +53,7 @@ public aspect PointcutsCW { declare warning: Pointcuts.anySystemProcessSpawningCalls() : "anySystemProcessSpawningCalls"; declare warning: Pointcuts.mostThrowableReadCalls() : "mostThrowableReadCalls"; declare warning: Pointcuts.exceptionWrappingCalls() : "exceptionWrappingCalls"; - + declare warning: Pointcuts.anyCollectionWriteCalls() : "anyCollectionWriteCalls"; // CW anyMethodExecution, anyPublicMethodExecution, anyNonPrivateMethodExecution public static void main(String[] list) { new MemberTests(0).toString(); // RT cflowMainExecution @@ -180,10 +180,21 @@ class MemberTests { e.getClass(); // not mostThrowableReadCalls b/c getClass() is Object + List list = new ArrayList(); + list.add("one"); // CW anyCollectionWriteCalls + + // actually not writing, but staticly might + list.remove("two"); // CW anyCollectionWriteCalls + + list.removeAll(Collections.EMPTY_LIST); // CW anyCollectionWriteCalls, anyPublicFieldGet, anyNonPrivateFieldGet + + list.retainAll(list); // CW anyCollectionWriteCalls + } } + aspect DynamicTests { DynamicTests() { int i = 1; // CW anyConstructorExecution, anyNonPrivateConstructorExecution XXX shows as 190, not 189?