From 234bea2297cc780d5bf38ebbc4087e938cc3b6e8 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 12 Oct 2004 16:24:10 +0000 Subject: 76030 - cflow optimizations. Part 2 fix - share counters and stacks when we can. --- tests/cflow/CounterTest01.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests/cflow/CounterTest01.java') diff --git a/tests/cflow/CounterTest01.java b/tests/cflow/CounterTest01.java index 1578ea0f8..0240d6056 100644 --- a/tests/cflow/CounterTest01.java +++ b/tests/cflow/CounterTest01.java @@ -4,13 +4,20 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +/** + * In this testcase we are using cflow() with a pointcut that doesn't include state - + * this should be managed by our new CflowCounter rather than a CflowStack. + * + * Because the two cflow pointcuts are identical (both are 'cflow(execution(* main(..))' it also + * means we can share a single counter for both of them ! + */ public class CounterTest01 { public static void main(String []argv) { new CounterTest01().sayMessage(); int ctrs = ReflectionHelper.howManyCflowCounterFields(Cflow1.aspectOf()); - if (ctrs!=2) { - throw new RuntimeException("Should be two cflow counters, but found: "+ctrs); + if (ctrs!=1) { + throw new RuntimeException("Should be one cflow counter, but found: "+ctrs); } int stacks = ReflectionHelper.howManyCflowStackFields(Cflow1.aspectOf()); if (stacks!=1) { -- cgit v1.2.3