aboutsummaryrefslogtreecommitdiffstats
path: root/docs/sandbox/testsrc
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-09-27 01:46:43 +0000
committerwisberg <wisberg>2003-09-27 01:46:43 +0000
commitc4ac88ee2890d97a8df494462b5e7b514a11bf84 (patch)
tree0a59a8818ee25e6f79d5f23f47823b74ca5e0280 /docs/sandbox/testsrc
parentb911f2a074cd13c4072c9361336287a16351556e (diff)
downloadaspectj-c4ac88ee2890d97a8df494462b5e7b514a11bf84.tar.gz
aspectj-c4ac88ee2890d97a8df494462b5e7b514a11bf84.zip
added test for collection calls
Diffstat (limited to 'docs/sandbox/testsrc')
-rw-r--r--docs/sandbox/testsrc/org/aspectj/langlib/PointcutsCW.java15
1 files changed, 13 insertions, 2 deletions
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?