Assertion When the inner class accesses private members of the outer class, the compiler generates synthetic methods that are package private. The assertion is that these synthetic methods are available to any class from the same package, not just the inner classes of the class. Proof Create the following files. File synthetic/A.java public class A [...]
Assertion The Virtual Machine bluntly ignores the inner class statute of a class. The binary class file does not distinguish between usages of the inner class and usages of the non-inner class. Proof Create the following files. File inner/A.java public class A { public static class B { public static String name() { return “Inner [...]
Assertion Sun’s Java Virtual Machine ignores inner class access modifiers. All Sun’s virtual machine versions are affected. Proof Create the following files. File public/A.java public class A { public static class B { public static String name() { return “Public inner class”; } } } File private/A.java public class A { private static class B [...]
It’s a universal goal — to attempt to make the most of your software. Backward compatibility is one tool that helps, and it is not at all foreign to the Java Platform development effort. A JDK 1.5 compiler is able to produce classes meant to run in a Java 1.4 Virtual Machine, as part of [...]
As explained in my previous post on the subject of my Java class file parasitic infector, I had to tackle three important problems: loading the virus code, locating hosts to infect and infecting a host. The latter required extensive knowledge of the class file format, and I already gave a quick rundown of the solutions [...]