From 08b0b1f657f4ee3fb5f810db6f0df63bd1fecdc4 Mon Sep 17 00:00:00 2001 From: jhugunin Date: Wed, 1 Jan 2003 00:07:53 +0000 Subject: [PATCH] expanded coverage --- tests/new/Counting1.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/new/Counting1.java b/tests/new/Counting1.java index d57789612..6027409e2 100644 --- a/tests/new/Counting1.java +++ b/tests/new/Counting1.java @@ -68,6 +68,8 @@ class Point implements FigureElement { } class Line implements FigureElement { + + private Point _p1, _p2; Line (Point p1, Point p2) { @@ -141,16 +143,30 @@ aspect MoveTracking { } aspect Mobility { declare dominates: Mobility, MoveTracking; + private static boolean enableMoves = true; static void enableMoves() { enableMoves = true; } static void disableMoves() { enableMoves = false; } + private int getSomething() { return 10; } + void around(): MoveTracking.moves() { - if ( enableMoves ) + int x = getSomething(); + if ( enableMoves || enableMoves ) proceed(); //!!! in versions prior to 0.7b10 runNext is a //!!! method on the join point object, so the //!!! syntax of this call is slightly different //!!! than in the paper } + + void around(int i): args(i) && call(void *gaoijbal()) { + if (enableMoves) throw new RuntimeException("bad things"); + } +} + +privileged aspect Foo { + public static boolean getEnableMoves() { + return Mobility.enableMoves; + } } -- 2.39.5