git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@874 379699f6-c40d-0410-875b-85095c16579estable
parent
263e1db8bb
commit
55c8948dfa
@ -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()); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue