Thanks David. I'll get some info up on the Wiki about this. I could probably make an inspection for IntelliJ that does this as well, if anyone would find that helpful.

Jon

David Blevins wrote:

On Sep 8, 2008, at 1:50 PM, Jonathan Gallimore wrote:

I've managed to hack something up around this - basically it uses JDT to parse the necessary Singletons, and then walks through the PreDestroy and PostContruct methods looking for method invocations. Its pretty basic at the moment, it does a complete search on every build, rather than building incrementally. It does work recursively, and will visit other classes (if you make a call like new MyOtherClass().someMethod() in the PreDestroy/PostConstruct method for example), so its potentially a long running operation. It will mark incorrect / missing uses of @DependsOn as errors.

I've checked it in, but left it to be switched off by default. I'm planning to add quick fix and incremental build support soon too.

This is completely awesome!

-David


Reply via email to