+2000-01-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * libjava.lang/anon.java, libjava.lang/anon2.java,
+ libjava.lang/anon3.java, libjava.lang/anon4.java,
+ libjava.lang/direct_read.java, libjava.lang/direct_write.java,
+ libjava.lang/indirect.java, libjava.lang/indirect_read.java,
+ libjava.lang/indirect_write.java, libjava.lang/inner1.java,
+ libjava.lang/inner2.java, libjava.lang/inner3.java,
+ libjava.lang/inner4.java, libjava.lang/inner_array.java,
+ libjava.lang/multiple_finit.java,
+ libjava.lang/private_direct_read.java,
+ libjava.lang/private_direct_write.java,
+ libjava.lang/private_indirect_read.java,
+ libjava.lang/private_indirect_write.java,
+ libjava.lang/search_outer.java, libjava.lang/tmi.java,
+ libjava.lang/tp.java, libjava.lang/update_outer.java: New files.
+
2000-01-18 Tom Tromey <tromey@cygnus.com>
* libjava.compile/inner_pub.java: New file.
--- /dev/null
+// Class anon
+// Generated on Wed Dec 29 10:07:09 PST 1999
+//
+
+
+interface itf {int count = 0;void setCount (int i);int getCount ();}
+
+class anon {
+
+ int count = 34;
+
+ class x implements itf {
+ int count = 3;
+ public void setCount (int j) { }
+ public int getCount () { return count*3; }
+ }
+
+
+ itf foo () {
+ class y implements itf {
+ int count = 3;
+ public void setCount (int j) { count = j; }
+ public int getCount () { return count+1; }
+ }
+ return new y ();
+ }
+
+ itf bar () {
+ return new itf () {
+ // The class defined right here will implement `itf'
+ int count = 5;
+ public void setCount (int j) { count = j; }
+ public int getCount () { return count+1; }
+ } ;
+ }
+
+ void test () {
+ itf a = foo ();
+ itf b = bar ();
+ x c = this.new x ();
+ System.out.println (a.getCount ());
+ System.out.println (b.getCount ());
+ System.out.println (c.getCount ());
+ System.out.println (this.count);
+ }
+
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `anon'...");
+ new anon ().test ();
+ }
+}
--- /dev/null
+Testing class `anon'...
+4
+6
+9
+34
--- /dev/null
+// Class anon2
+// Generated on Wed Dec 29 10:07:09 PST 1999
+//
+
+
+class anon2 {
+
+ int count = 34;
+ int field;
+
+ anon2 () { System.out.println ("anon2()"); }
+
+ anon2 (foobar x) {
+ System.out.println ("Yikes!"+x.zoink());
+ }
+
+ anon2 foo () {
+ class y extends anon2 {
+ int count = 3;
+ public void setCount (int j) { count = j; }
+ public int getCount () { return count+1; }
+ y (int i) { System.out.println ("y(int)"); }
+ }
+ return new y (3);
+ }
+
+ anon2 bar () {
+ foobar xyz = new foobar ();
+ return new anon2 (xyz) {
+ int count = 5;
+ public void setCount (int j) { field = 3; count = j; }
+ public int getCount () { return count+1; }
+ } ;
+ }
+
+ void test () {
+ anon2 b = bar ();
+ anon2 c = foo ();
+ }
+
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `anon2'...");
+ new anon2 ().test ();
+ }
+}
+
+class foobar {
+ public String zoink() { return " zoinked"; }
+}
--- /dev/null
+Testing class `anon2'...
+anon2()
+Yikes! zoinked
+anon2()
+y(int)
--- /dev/null
+// Class anon3
+// Generated on Wed Dec 29 10:07:09 PST 1999
+//
+
+
+class anon3 {
+
+ itf bar () {
+ return new itf () {
+ int count = 5;
+ public void setCount (int j) { count = 3; }
+ public int getCount () { return count; }
+ } ;
+ }
+
+ void test () {
+ itf x = bar ();
+ System.out.println (x.getCount ());
+ }
+
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `anon3'...");
+ new anon3 ().test ();
+ }
+}
+
+interface itf { void setCount (int j); int getCount(); int count = 0; }
--- /dev/null
+Testing class `annon3'...
+5
--- /dev/null
+// Class anon4
+// Generated on Wed Dec 29 10:07:09 PST 1999
+//
+
+
+class anon4 {
+
+ private int field = 3;
+
+ itf bar () {
+ return new itf () {
+ int count = 5;
+ public void setCount (int j) { count = 3+field; }
+ public int getCount () { return count+field; }
+ } ;
+ }
+
+ void test () {
+ itf x = bar ();
+ System.out.println (x.getCount ());
+ }
+
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `anon4'...");
+ new anon4 ().test ();
+ }
+}
+
+interface itf { void setCount (int j); int getCount(); int count = 0; }
--- /dev/null
+Testing class `anon4'...
+8
--- /dev/null
+// Class direct_read
+// Generated on Sat Nov 13 23:26:34 UTC 1999
+//
+
+class direct_read {
+
+ int foo;
+
+ class direct_read_inner {
+ void test () {
+ int x = foo;
+ System.out.println ("x="+x);
+ }
+ }
+
+ void foo ()
+ {
+ foo = 670;
+ direct_read_inner inn = this.new direct_read_inner ();
+ inn.test ();
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `direct_read'...");
+ new direct_read().foo ();
+ }
+}
--- /dev/null
+Testing class `direct_read'...
+x=670
--- /dev/null
+// Class direct_write
+// Generated on Mon Nov 15 17:10:56 UTC 1999
+//
+
+class direct_write {
+
+ int foo;
+
+ class direct_write_inner {
+ void test () {
+ foo = 670;
+ }
+ }
+
+ void foo ()
+ {
+ foo = 650;
+ direct_write_inner inn = this.new direct_write_inner ();
+ inn.test ();
+ System.out.println ("foo="+foo);
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `direct_write'...");
+ new direct_write().foo ();
+ }
+}
--- /dev/null
+Testing class `direct_write'...
+foo=670
--- /dev/null
+// Class indirect
+// Generated on Tue Nov 16 15:53:14 UTC 1999
+// Several indirection to enclosing class
+
+class indirect {
+
+ private int foo;
+
+ class indirect_inner {
+ class other {
+ class inner {
+ void test () {
+ int x = foo;
+ System.out.println ("x="+foo);
+ foo = 671;
+ }
+ }
+ }
+
+ }
+ void foo ()
+ {
+ foo = 670;
+ indirect_inner inn = this.new indirect_inner ();
+ this.new indirect_inner().new other().new inner ().test ();
+ System.out.println ("foo="+foo);
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `indirect'...");
+ new indirect().foo ();
+ }
+}
--- /dev/null
+Testing class `indirect'...
+x=670
+foo=671
--- /dev/null
+// Class indirect_read
+// Generated on Mon Nov 15 17:20:40 UTC 1999
+//
+
+class indirect_read {
+
+ int foo;
+
+ class indirect_read_inner {
+ void test () {
+ }
+
+ class other {
+ void testx () {
+ int x = foo;
+ System.out.println ("x="+x);
+ }
+ }
+
+ }
+ void foo ()
+ {
+ foo = 670;
+ indirect_read_inner inn = this.new indirect_read_inner ();
+ indirect_read_inner.other o = inn.new other ();
+ o.testx ();
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `indirect_read'...");
+ new indirect_read().foo ();
+ }
+}
--- /dev/null
+Testing class `indirect_read'...
+x=670
--- /dev/null
+// Class indirect_write
+// Generated on Tue Nov 16 15:01:24 UTC 1999
+//
+
+class indirect_write {
+
+ int foo;
+
+ class indirect_write_inner {
+ void test () {
+ }
+
+ class other {
+ void testx () {
+ foo = 670;
+ }
+ }
+
+ }
+ void foo ()
+ {
+ indirect_write_inner inn = this.new indirect_write_inner ();
+ indirect_write_inner.other x = inn.new other ();
+ x.testx();
+ System.out.println ("foo="+foo);
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `indirect_write'...");
+ new indirect_write().foo ();
+ }
+}
--- /dev/null
+Testing class `indirect_write'...
+foo=670
--- /dev/null
+// Class inner1
+// Generated on Thu Nov 4 16:35:03 PST 1999
+//
+
+class inner1 {
+ int i;
+ void foo () {
+ inner1.z x1 = new z();
+ inner1.z.y x = x1.new y();
+ x.bar ();
+ x.print();
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `inner1'...");
+ new inner1 ().foo();
+ }
+ class z {
+ int j;
+ void foo () {
+ inner1.this.i = 3;
+ }
+ class y {
+ int k;
+ void bar () {
+ inner1.this.i = 3;
+ z.this.j = 4;
+ y.this.k = 34;
+ }
+ void print () {
+ System.out.println ("i="+i+", j="+j+", k="+k);
+ }
+ }
+ }
+}
+
--- /dev/null
+Testing class `inner1'...
+i=3, j=4, k=34
--- /dev/null
+// Class inner2
+// Generated on Mon Dec 6 14:32:34 PST 1999
+//
+
+class inner2 {
+ int foo = 1999;
+ void foo ()
+ {
+ inner2.this.foo = 666;
+ System.out.println (inner2.this.foo);
+ }
+ void print () {System.out.println (foo);}
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `inner2'...");
+ new inner2().foo ();
+ }
+}
--- /dev/null
+Testing class `inner2'...
+666
--- /dev/null
+// Class inner3
+// Generated on Tue Dec 7 11:37:43 PST 1999
+//
+
+class inner3 {
+ int bar;
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `inner3'...");
+ new inner3().bar ();
+ }
+ void bar () {
+ t xx = this.new t ();
+ xx.bar ();
+ }
+ void foo () { bar = 3; }
+ class t {
+ void bar () {
+ inner3.this.foo ();
+ System.out.println (inner3.this.bar);
+ }
+ }
+}
--- /dev/null
+Testing class `inner3'...
+3
--- /dev/null
+// Class inner4
+// Generated on Tue Dec 7 11:43:48 PST 1999
+//
+
+class inner4 {
+ static private int xyz () { return 3; }
+ private String f;
+
+ String p () {
+ return "public String p()";
+ }
+
+ private String pp (int x, byte y, char c) {
+ return "private String pp("+x+", "+y+", "+c+")";
+ }
+
+ void foo () {
+ t xxx = this.new t();
+ xxx.bar ();
+ pp (3, (byte)34, 'C');
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `inner4'...");
+ new inner4().foo();
+ }
+ class t {
+ void bar () {
+ System.out.println (p ());
+ System.out.println (pp (3, (byte)34, 'C'));
+ System.out.println (xyz ());
+ }
+ }
+}
--- /dev/null
+Testing class `inner4'...
+public String p()
+private String pp(3, 34, C)
+3
--- /dev/null
+// Class inner_array
+// Generated on Fri Nov 19 13:19:47 PST 1999
+//
+
+class inner_array {
+
+ private int[] foo;
+
+ class array_inner {
+ void test () {
+ int x = foo[2];
+ System.out.println ("x="+x);
+ foo [1] = 34;
+ foo [1]++;
+ }
+ }
+ void foo ()
+ {
+ foo = new int [3];
+ foo[2]=670;
+ array_inner inn = this.new array_inner ();
+ inn.test ();
+ System.out.println ("foo[1]="+foo[1]);
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `inner_array'...");
+ new inner_array().foo ();
+ }
+}
--- /dev/null
+Testing class `inner_array'...
+x=670
+foo[1]=35
--- /dev/null
+// Class multiple_finit
+// Generated on Mon Jan 3 20:07:18 PST 2000
+//
+
+class multiple_finit {
+
+ int foo = 99;
+
+ class multiple_finit_inner {
+ int inner = 34;
+ void test () {
+ System.out.println (inner);
+ System.out.println (foo);
+ }
+ }
+ void foo (String s)
+ {
+ multiple_finit_inner inn = this.new multiple_finit_inner ();
+ inn.test ();
+ System.out.println (foo);
+ }
+ void testx () { }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `multiple_finit'...");
+ new multiple_finit().foo ("");
+ }
+}
--- /dev/null
+Testing class `multiple_finit'...
+34
+99
+99
--- /dev/null
+// Class private_direct_read
+// Generated on Tue Nov 16 15:04:13 UTC 1999
+//
+
+class private_direct_read {
+
+ private int foo;
+
+ class private_direct_read_inner {
+ void test () {
+ int x = foo;
+ System.out.println ("x="+x);
+ }
+ }
+ void foo ()
+ {
+ foo = 670;
+ private_direct_read_inner inn = this.new private_direct_read_inner ();
+ inn.test ();
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `private_direct_read'...");
+ new private_direct_read().foo ();
+ }
+}
--- /dev/null
+Testing class `private_direct_read'...
+x=670
--- /dev/null
+// Class private_direct_write
+// Generated on Tue Nov 16 15:05:54 UTC 1999
+//
+
+class private_direct_write {
+
+ private int foo;
+
+ class private_direct_write_inner {
+ void test () {
+ foo = 670;
+ }
+ }
+ void foo ()
+ {
+ private_direct_write_inner inn = this.new private_direct_write_inner ();
+ inn.test ();
+ System.out.println ("foo="+foo);
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `private_direct_write'...");
+ new private_direct_write().foo ();
+ }
+}
--- /dev/null
+// Class private_indirect_read
+// Generated on Tue Nov 16 15:34:56 UTC 1999
+//
+
+class private_indirect_read {
+
+ private int foo;
+
+ class private_indirect_read_inner {
+ void test () {
+ }
+ class other {
+ void testx () {
+ int x = foo;
+ System.out.println ("x="+x);
+ }
+ }
+
+ }
+ void foo ()
+ {
+ foo=670;
+ private_indirect_read_inner inn = this.new private_indirect_read_inner ();
+ private_indirect_read_inner.other o = inn.new other ();
+ o.testx();
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `private_indirect_read'...");
+ new private_indirect_read().foo ();
+ }
+}
--- /dev/null
+// Class private_indirect_write
+// Generated on Tue Nov 16 15:44:49 UTC 1999
+//
+
+class private_indirect_write {
+
+ private int foo;
+
+ class private_indirect_write_inner {
+ void test () {
+ }
+
+ class other {
+ void test () {
+ foo = 670;
+ }
+ }
+
+ }
+ void foo ()
+ {
+ private_indirect_write_inner inn = this.new private_indirect_write_inner ();
+ private_indirect_write_inner.other x = inn.new other ();
+ x.test ();
+ System.out.println ("foo="+foo);
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `private_indirect_write'...");
+ new private_indirect_write().foo ();
+ }
+}
--- /dev/null
+// Class search_outer.java
+// Generated on Thu Nov 18 18:40:43 UTC 1999
+//
+
+class search_outer {
+
+ private int foo;
+
+ class search_outer_inner {
+ void test () {
+ foo++;
+ System.out.println ("foo="+foo);
+ foo += 3;
+ System.out.println ("foo="+foo);
+ }
+ }
+ void foo ()
+ {
+ foo = 3;
+ search_outer_inner inn = this.new search_outer_inner ();
+ inn.test ();
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `search_outer'...");
+ new search_outer().foo ();
+ }
+}
--- /dev/null
+Testing class `search_outer'...
+foo=4
+foo=7
--- /dev/null
+// Class t
+// Generated on Thu Nov 4 16:35:03 PST 1999
+//
+
+class tmi {
+ int i;
+ void foo () {
+ tmi.z x1 = new z();
+ tmi.z.y x = x1.new y();
+ x.bar ();
+ x.print();
+ tmi.this.i = 666;
+ x.print();
+ tmi.this.print();
+ }
+ void print () {
+ System.out.println ("tmi.print()");
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `tmi'...");
+ new tmi ().foo();
+ }
+ class z {
+ int j;
+ void foo () {
+ tmi.this.i = 3;
+ }
+ class y {
+ int k;
+ void bar () {
+ tmi.this.i = 3;
+ tmi.this.print ();
+ z.this.j = 4;
+ y.this.k = 34;
+ }
+ void print () {
+ System.out.println ("i="+i+", j="+j+", k="+k);
+ }
+ }
+ }
+}
+
--- /dev/null
+Testing class `tmi'...
+tmi.print()
+i=3, j=4, k=34
+i=666, j=4, k=34
+tmi.print()
--- /dev/null
+// Class tp
+// Generated on Thu Nov 4 16:35:03 PST 1999
+//
+
+class tp {
+ private int i;
+ void foo () {
+ tp.z x1 = new z();
+ tp.z.y x = x1.new y();
+ x.bar ();
+ x.print();
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `tp'...");
+ new tp ().foo();
+ }
+ class z {
+ private int j;
+ void foo () {
+ tp.this.i = 3;
+ }
+ class y {
+ private int k;
+ void bar () {
+ tp.this.i = 3;
+ z.this.j = 4;
+ y.this.k = 34;
+ }
+ void print () {
+ System.out.println ("i="+i+", j="+j+", k="+k);
+ }
+ }
+ }
+}
+
--- /dev/null
+Testing class `tp'...
+i=3, j=4, k=34
--- /dev/null
+// Class update_outer
+// Generated on Thu Nov 18 21:37:21 UTC 1999
+//
+
+class update_outer {
+
+ private String foo;
+
+ class update_outer_inner {
+ void test () {
+ foo += " M$";
+ System.out.println ("foo=`"+foo+"'");
+ }
+
+
+ }
+ void foo ()
+ {
+ foo = "780";
+ update_outer_inner inn = this.new update_outer_inner ();
+ inn.test ();
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `update_outer'...");
+ new update_outer().foo ();
+ }
+}
--- /dev/null
+Testing class `update_outer'...
+foo=`780 M$'