lordlamer / jspf

Automatically exported from code.google.com/p/jspf
0 stars 0 forks source link

@PluginImplementation seems not to work on inner classes #27

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Take any plugin (f.i. CoolPlugin) and move all its contents into an inner class:
public class MyPlugin {
   @PluginImplementation
   public static class MyInnerPlugin implements Plugin {
    // everything goes here
   }
}

I expected this inner class to be discovered/loaded, but it is not.

I am using RC4 on Ubuntu 9.10/java "1.6.0_24"

Reason for doing this:
My plugin is a trivial factory for a specific type of object Thingy. Here, 
Thingy is the important class containing the relevant coed. ThingyFactory is 
trivial and I would like to keep these trivial classes 'stuffed away' in Thingy 
to reduce the number of files.

Thanks for the nice framework!

Original issue reported on code.google.com by hartmut....@gmail.com on 9 Mar 2011 at 9:33

GoogleCodeExporter commented 8 years ago
Fixed in Mercurial repository. However, this only works for *STATIC* inner 
classes, as non-static inner classes cannot be constructed without a link to 
their enclosing object. 

Original comment by r.biedert on 16 Mar 2011 at 3:06