diff options
author | Andy Clement <aclement@pivotal.io> | 2019-01-30 13:02:20 -0800 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2019-01-30 13:02:20 -0800 |
commit | cda73a6a5864b76e252ed0d3b69ff4b55a6def4b (patch) | |
tree | adf492da7642210404007562155c6b337f0cb1c7 /testing/figures-coverage/figures/Main.java | |
parent | b4e0f23248e09079f646bcc4f036e3c688b93f5e (diff) | |
download | aspectj-cda73a6a5864b76e252ed0d3b69ff4b55a6def4b.tar.gz aspectj-cda73a6a5864b76e252ed0d3b69ff4b55a6def4b.zip |
mavenizing testing - wip
Diffstat (limited to 'testing/figures-coverage/figures/Main.java')
-rw-r--r-- | testing/figures-coverage/figures/Main.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/testing/figures-coverage/figures/Main.java b/testing/figures-coverage/figures/Main.java new file mode 100644 index 000000000..189f05cee --- /dev/null +++ b/testing/figures-coverage/figures/Main.java @@ -0,0 +1,56 @@ + +package figures; + +import figures.primitives.planar.Point; +import figures.primitives.solid.SolidPoint; + +class Main { + + private static Point startPoint; + + public static void main(String[] args) { + try { + System.out.println("> starting..."); + + startPoint = makeStartPoint(); + //startPoint.setX(3); new Point(0, 0); +// SolidPoint sp1 = new SolidPoint(1, 3, 3); + +// sp1.setZ(1); +// p1.incrXY(3, 3); + } catch (RuntimeException re) { + re.printStackTrace(); + } + System.out.println("> finished."); + } + + /** @deprecated use something else */ + public static Point makeStartPoint() { + //return new Point(1, 2); + return null; + } + + /** This should produce a deprecation warning with JDK > 1.2 */ + static class TestGUI extends javax.swing.JFrame { + TestGUI() { + this.disable(); + } + } + + /** This should produce a porting-deprecation warning. */ + //static pointcut mainExecution(): execution(void main(*)); +} + +privileged aspect Test { + pointcut testptct(): call(* *.*(..)); + + before(Point p, int newval): target(p) && set(int Point.xx) && args(newval) { + System.err.println("> new value of x is: " + p.x + ", setting to: " + newval); + } + + before(int newValue): set(int Point.*) && args(newValue) { + if (newValue < 0) { + throw new IllegalArgumentException("too small"); + } + } +} |