From 55c8948dfa93a6449e2b23caf463b6cc19b65c7b Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 18 Jun 1999 12:09:49 +0000 Subject: [PATCH] Initial revision git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@874 379699f6-c40d-0410-875b-85095c16579e --- jode/test/JavacBug.java | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 jode/test/JavacBug.java diff --git a/jode/test/JavacBug.java b/jode/test/JavacBug.java new file mode 100644 index 0000000..40a1df8 --- /dev/null +++ b/jode/test/JavacBug.java @@ -0,0 +1,34 @@ +package jode.test; + +/** + * This class shows a bug in javac 1.2-pre2 compiler. + * Decompile the generated class to see whats happening. + */ +public class JavacBug { + + class Inner { + public String toString() { + return "Inner"; + } + } + + public Inner test() { + final int a = 1; + final int b = 2; + return new Inner() { + /* jdk1.2 javac misses these initializers */ + int c = a; + int d = 3; + + public String toString() { + return "b="+b+"; c="+c+"; d="+d; + } + }; + } + + public static void main(String[] argv) { + Inner inner = new JavacBug().test(); + System.err.println(inner.toString()); + } +} +