1 Clazz.declarePackage ("swingjs.test");
2 Clazz.load (["java.util.HashMap"], ["swingjs.test.BugTest", "$.A", "$.B"], null, function () {
3 c$ = Clazz.decorateAsClass (function () {
6 Clazz.instantialize (this, arguments);
7 }, swingjs.test, "BugTest", java.util.HashMap);
8 Clazz.makeConstructor (c$,
10 Clazz.superConstructor (this, swingjs.test.BugTest, []);
11 System.out.println ("this is BugTest()" + this.me);
13 Clazz.makeConstructor (c$,
15 Clazz.superConstructor (this, swingjs.test.BugTest, []);
16 System.out.println ("this is BugTest(String):" + s + this.me);
18 Clazz.makeConstructor (c$,
20 Clazz.superConstructor (this, swingjs.test.BugTest, []);
21 System.out.println ("this is BugTest(Object[]):" + o + this.me);
23 Clazz.makeConstructor (c$,
25 Clazz.superConstructor (this, swingjs.test.BugTest, []);
26 System.out.println ("this is BugTest(String,String):" + s + t + this.me);
28 Clazz.defineMethod (c$, "test",
30 System.out.println (a + " is an AbstractMap");
31 }, "java.util.AbstractMap");
32 Clazz.defineMethod (c$, "test",
34 System.out.println (ja + " is an Object");
36 Clazz.defineMethod (c$, "test1",
38 System.out.println (ja + " is a Number");
40 Clazz.defineMethod (c$, "test1",
42 System.out.println (ja + " is an int");
44 c$.getFont = Clazz.defineMethod (c$, "getFont",
48 c$.getFont = Clazz.defineMethod (c$, "getFont",
52 c$.main = Clazz.defineMethod (c$, "main",
54 new swingjs.test.B ().init ();
57 cl = Clazz._4Name ("swingjs.test.BugTest");
58 cl.getConstructor ([String, String]).newInstance ( Clazz.newArray (-1, ["test1", "test2"]));
59 cl.getConstructor ([Array]).newInstance ( Clazz.newArray (-1, [ Clazz.newArray (-1, ["test1", "test2"])]));
60 cl.getConstructor ([String, String]).newInstance (["test1", "test2"]);
61 cl.getConstructor ([]).newInstance ([]);
64 if (Clazz.exceptionOf (e, Exception)) {
70 System.out.println (swingjs.test.BugTest.getFont ("f"));
71 System.out.println (swingjs.test.BugTest.getFont ("f", "y"));
72 var t = new swingjs.test.BugTest ();
74 t.test1 (Integer.$valueOf (33));
78 var a2 = Clazz.newIntArray (2, 0);
79 var a20 = Clazz.newIntArray (2, 0);
80 var a23 = Clazz.newIntArray (2, 3, 0);
81 swingjs.test.BugTest.printit ([2, 3, 4, 5]);
82 System.out.println (args);
83 var test = Clazz.newCharArray (-1, ['1', '2', '3', '4', '5']);
84 var s = String.instantialize (test, 2, 3);
85 System.out.println ("char test: 345 = " + s);
87 c$.printit = Clazz.defineMethod (c$, "printit",
89 for (var i = 0; i < t.length; i++) System.out.println (t[i]);
92 c$ = Clazz.declareType (swingjs.test, "A");
93 Clazz.defineMethod (c$, "init",
95 System.out.println ("class A init");
97 Clazz.defineMethod (c$, "init",
99 System.out.println ("class A init String a");
101 Clazz.defineMethod (c$, "init2",
103 System.out.println ("class A init2");
106 c$ = Clazz.declareType (swingjs.test, "B", swingjs.test.A);
107 Clazz.defineMethod (c$, "init",
109 var $private = Clazz.checkPrivateMethod (arguments);
110 if ($private != null) {
111 return $private.apply (this, arguments);
113 System.out.println ("class B init");
114 Clazz.superCall (this, swingjs.test.B, "init2", []);
116 Clazz.defineMethod (c$, "init",
118 var $private = Clazz.checkPrivateMethod (arguments);
119 if ($private != null) {
120 return $private.apply (this, arguments);
122 System.out.println ("class B init String b");