Ok, using the #Z() method didn't work out and caused a NoSuchMethodError exception. This seems to indicate that IDEA has trouble with the opinio.jar or I am just using the wrong one. Will try again with a fresh copy.
Ok, I have to come to the conclusion that Plugin.JAR#getClassLoader can and in my case will throw a NullPointerException. See following block that will throw the NPE:
if (plugin == null) thrownew Exception("Plugin is null"); if (plugin.getJAR() == null) thrownew Exception("JAR is null"); ClassLoader cl = plugin.getJAR().getClassLoader(); if (cl == null) thow new Exception("ClassLoader is null");
Unfortunately this is taking too many resources from my development effort so I will stop investigating now. Any input would still be welcome but I will have to try and work around this.