A
Alessio Stalla
I believe my simple example is
// source foo.java
public class foo { foo() { bar x = null; } }
// source bar.java
public class bar { bar() {} }
I just double checked with javap, (though I didn't run my own hand-
written class file parser), and it appears that in foo.class, there is
not a single reference to "bar". If bar were to be moved so that it
could no longer be found, then foo's compilation would fail. I don't
know if there are more cases like this, but I imagine that javac could
do other optimizations which would remove references to used classes
from the compiled classfile.
Hmm. This is indeed a case I hadn't thought about, and as you say,
there are maybe other cases like this. So I was being too optimistic...