~ubuntu-branches/ubuntu/trusty/aspectj/trusty

« back to all changes in this revision

Viewing changes to org.aspectj/modules/ajde.core/testdata/figures-coverage/figures/Main.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch, Michael Koch, Thomas Girard, Mark Howard
  • Date: 2008-01-05 23:31:47 UTC
  • mfrom: (1.1.2 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080105233147-r425rd8nymruj6fk
Tags: 1.5.4-1
[ Michael Koch ]
* New upstream version. Closes: #459363
* Updated Standards-Version to 3.7.3.
* Added myself to Uploaders.

[ Thomas Girard ]
* Add Homepage: control field, and convert XS-Vcs-* to Vcs-*.

[ Mark Howard ]
* debian/watch: added.

Show diffs side-by-side

added added

removed removed

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