Platform.getClassForName fails to load a class if the code calling it is not compiled with the -optimize flag. It looks like a different classloader is used if the call occurs within the Platform object than when it is inlined. You can see difference if you compile the attached code w/o -optimize and compare the two stack traces.