You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Main.java 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package figures;
  2. import figures.primitives.planar.Point;
  3. import figures.primitives.solid.SolidPoint;
  4. class Main {
  5. private static Point startPoint;
  6. public static void main(String[] args) {
  7. try {
  8. System.out.println("> starting...");
  9. startPoint = makeStartPoint();
  10. //startPoint.setX(3); new Point(0, 0);
  11. // SolidPoint sp1 = new SolidPoint(1, 3, 3);
  12. // sp1.setZ(1);
  13. // p1.incrXY(3, 3);
  14. } catch (RuntimeException re) {
  15. re.printStackTrace();
  16. }
  17. System.out.println("> finished.");
  18. }
  19. /** @deprecated use something else */
  20. public static Point makeStartPoint() {
  21. //return new Point(1, 2);
  22. return null;
  23. }
  24. /** This should produce a deprecation warning with JDK > 1.2 */
  25. static class TestGUI extends javax.swing.JFrame {
  26. TestGUI() {
  27. this.disable();
  28. }
  29. }
  30. /** This should produce a porting-deprecation warning. */
  31. //static pointcut mainExecution(): execution(void main(*));
  32. }
  33. privileged aspect Test {
  34. pointcut testptct(): call(* *.*(..));
  35. before(Point p, int newval): target(p) && set(int Point.xx) && args(newval) {
  36. System.err.println("> new value of x is: " + p.x + ", setting to: " + newval);
  37. }
  38. before(int newValue): set(int Point.*) && args(newValue) {
  39. if (newValue < 0) {
  40. throw new IllegalArgumentException("too small");
  41. }
  42. }
  43. }