1635N/A// A simple class to extend an abstract class and get loaded with different
1635N/A// loaders. This class is loaded via LOADER1. A similar named class will
1635N/A// be loaded via LOADER2.
1635N/Apublic class many_loader extends bug_21227 {
1635N/A public You_Have_Been_P0wned _p0wnee;
1635N/A
1635N/A // I need to compile (hence call in a loop) a function which returns a value
1635N/A // loaded from classloader other than the system one. The point of this
1635N/A // call is to give me an abstract 'hook' into a function loaded with a
1635N/A // foreign loader.
1635N/A
1635N/A // The original 'make(boolean)' returns a bug_21227. The VM will inject a
1635N/A // synthetic method to up-cast the returned 'from_loader1' into a
1635N/A // 'bug_21227'.
1635N/A public many_loader[] make( IFace iface ) {
1635N/A // This function needs to return a value known to be loaded from LOADER2.
1635N/A // Since I need to use a yet different loader, I need to make an unknown
1635N/A // foreign call. In this case I'll be using an interface to make the
1635N/A // unknown call, with but a single implementor so the compiler can do the
1635N/A // upcast statically.
1635N/A return iface==null ? null : iface.gen();
1635N/A }
1635N/A}