summaryrefslogtreecommitdiffstats
path: root/tests/new/InitializationOrder.java
diff options
context:
space:
mode:
authorwisberg <wisberg>2002-12-16 18:51:06 +0000
committerwisberg <wisberg>2002-12-16 18:51:06 +0000
commit144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch)
treeb12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/InitializationOrder.java
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/new/InitializationOrder.java')
-rw-r--r--tests/new/InitializationOrder.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/new/InitializationOrder.java b/tests/new/InitializationOrder.java
new file mode 100644
index 000000000..d4bd9bf0d
--- /dev/null
+++ b/tests/new/InitializationOrder.java
@@ -0,0 +1,33 @@
+
+import org.aspectj.testing.Tester;
+
+public class InitializationOrder {
+ public static void main (String[] args) {
+ C c = new C();
+ Tester.check(null != c.s, "null == c.s");
+ Sub s = new Sub();
+ Tester.check("ok" == s.o, "\"ok\" == s.o");
+ Tester.check(null == s.p, "null == s.p");
+ }
+
+}
+
+class C {
+ public String s = null;
+ C(String s) { this.s = s; }
+ C() { this("uh oh"); }
+}
+
+class S {
+ public Object p;
+ S(Object p) {this.p = p;}
+}
+
+class Sub extends S {
+ Sub() {
+ super(null); // if (o), then C E illegal use of uninitialized value
+ o = "ok";
+ }
+ Object o;
+}
+