From 263e1db8bb066d429fd57a3e7b39f4939f4a9c95 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 18 Jun 1999 12:09:37 +0000 Subject: [PATCH] long/double tests added some more tests git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@873 379699f6-c40d-0410-875b-85095c16579e --- jode/test/AnonymousJavac.java | 90 ++++++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 6 deletions(-) diff --git a/jode/test/AnonymousJavac.java b/jode/test/AnonymousJavac.java index 11bb962..36f7f37 100644 --- a/jode/test/AnonymousJavac.java +++ b/jode/test/AnonymousJavac.java @@ -26,8 +26,10 @@ public class AnonymousJavac { int var = 3; public void test() { + final long longVar = 5; + final double dblVar = 3; class Hello { - int var = 4; + int var = (int) longVar; Hello() { System.err.println("construct"); @@ -41,7 +43,7 @@ public class AnonymousJavac { Inner.this.hashCode(); Inner.this.var = var; AnonymousJavac.this.hashCode(); - System.err.println("HelloWorld"); + System.err.println("HelloWorld: "+dblVar); } }; final Hello hi = new Hello(); @@ -69,14 +71,19 @@ public class AnonymousJavac { // }; Inner blub1 = new Inner("Inner param") { + Hello hii = hi; + public void test() { - System.err.println("overwritten"); + System.err.println("overwritten: "+hii+hi); } }; Inner blub2 = new AnonymousJavac().new Inner("Inner param") { + Hello hii = hi; + public void test() { - System.err.println("overwritten"); + System.err.println("overwritten: "+hii); + AnonymousJavac.this.hashCode(); } }; @@ -87,8 +94,9 @@ public class AnonymousJavac { } Vector v = new Vector(hi.var, var) { - public String toString() { - return super.toString(); + Hello hii = hi; + public Object clone() { + return super.clone(); } }; @@ -99,4 +107,74 @@ public class AnonymousJavac { } } + + public void test() { + class Hello { + int var = 4; + + Hello() { + System.err.println("construct"); + } + Hello(String info) { + System.err.println("construct: "+info); + } + + public void hello() { + this.hashCode(); + AnonymousJavac.this.hashCode(); + System.err.println("HelloWorld"); + } + }; + final Hello hi = new Hello(); + final Hello ho = new Hello("ho"); + final Object o = new Object() { + int blah = 5; + Hello hii = hi; + + public String toString() { + this.hii.hello(); + hi.hello(); + return Integer.toHexString(AnonymousJavac.this.hashCode() + +blah); + } + }; + Object p = new Object() { + public String toString() { + return o.toString(); + } + }; +// Hello blah = new Hello("Hello World") { +// public void hello() { +// System.err.println("overwritten"); +// } +// }; + + Inner blub1 = new Inner("Inner param") { + public void test() { + System.err.println("overwritten"); + } + }; + + Inner blub2 = new AnonymousJavac().new Inner("Inner param") { + public void test() { + System.err.println("overwritten"); + } + }; + + class Hi extends Inner { + public Hi() { + super("Hi World"); + } + } + + Vector v = new Vector(hi.var, new Inner("Hi").var) { + public Object clone() { + return super.clone(); + } + }; + + Hi hu = new Hi(); + + } + }