summaryrefslogtreecommitdiffstats
path: root/docs
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
parentb911f2a074cd13c4072c9361336287a16351556e (diff)
downloadaspectj-c4ac88ee2890d97a8df494462b5e7b514a11bf84.tar.gz
aspectj-c4ac88ee2890d97a8df494462b5e7b514a11bf84.zip
added test for collection calls
Diffstat (limited to 'docs')
-rw-r--r--docs/sandbox/sandbox-test.xml14
-rw-r--r--docs/sandbox/testsrc/org/aspectj/langlib/PointcutsCW.java15
2 files changed, 23 insertions, 6 deletions
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 @@
<compile files="common/org/aspectj/langlib/Pointcuts.java,
testsrc/org/aspectj/langlib/PointcutsCW.java">
- <message kind="warning" line="159" text="anyConstructorExecution" file="Pointcuts.java"/>
+ <message kind="warning" line="172" text="anyConstructorExecution" file="Pointcuts.java"/>
<message kind="warning" line="20" text="anyConstructorExecution"/>
<message kind="warning" line="20" text="anyPublicConstructorExecution"/>
@@ -230,9 +230,15 @@
<message kind="warning" line="173" text="anySystemProcessSpawningCalls"/>
<message kind="warning" line="177" text="mostThrowableReadCalls"/>
<message kind="warning" line="179" text="mostThrowableReadCalls"/>
- <message kind="warning" line="190" text="anyConstructorExecution"/>
- <message kind="warning" line="190" text="anyNonPrivateConstructorExecution"/>
- </compile>
+ <message kind="warning" line="184" text="anyCollectionWriteCalls"/>
+ <message kind="warning" line="187" text="anyCollectionWriteCalls"/>
+ <message kind="warning" line="189" text="anyCollectionWriteCalls"/>
+ <message kind="warning" line="189" text="anyNonPrivateFieldGet"/>
+ <message kind="warning" line="189" text="anyPublicFieldGet"/>
+ <message kind="warning" line="191" text="anyCollectionWriteCalls"/>
+ <message kind="warning" line="201" text="anyConstructorExecution"/>
+ <message kind="warning" line="201" text="anyNonPrivateConstructorExecution"/>
+ </compile>
<run class="org.aspectj.langlib.PointcutsCW"/>
</ajc-test>
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?