Re: [Clirr-devel] about to commit changes to support a SPI
Status: Alpha
Brought to you by:
lkuehne
From: Simon K. <ski...@ap...> - 2005-08-24 10:13:20
|
On Mon, 2005-08-22 at 21:05 +0200, Lars Kühne wrote: > Hi, > > if nobody objects within the next few days, I will commit changes to > clirr-core that introduce an SPI for providing the Java code structure. > I think I discussed the idea with Simon a while ago, the basic idea is > to let the checks work against a the interfaces /JavaType,/ /Field/ and > /Method/ instead of working directly against the BCEL classes. > > This change has three major objectives: > > * decouple our core logic from external dependencies (in this case BCEL) > * allow replacing BCEL with a faster/smaller/more-full-featured > (think Java5) byte code lib. ASM would be one of the candidates > * allow Clirr IDE plugins to use their IDE's internal code > representation, so compilation to class files is not required. It > should be possible to write a plugin that lets users detect > incompatible changes while they are typing the code. > > All existing tests still pass, but this change could cause problems for > some corner cases that are currently untested. > > Let me know what you think. Sounds fine - though I would also be happy with just swapping to use ASM directly. I've been wondering whether we should look at restructuring the code to work more like an asm "visitor" or how checkstyle works than the current layout, because last I looked the method tests were getting rather complex. But of course last time I looked was quite a while ago! I presume your new code will still essentially encapsulate an in-memory "model" of classes that the checks then inspect rather that try to be more ASM-ish?? Cheers, Simon |