Sunday, April 27, 2008

xdoclet gotcha

if you have a doclet used like below, you will face a bug which creeps without throwing errors during code generation:

/**
* @hibernate... some doclet
*/
//some innocent looking comment block
public getSomething() {
}

you would expect some code generated relating the hibernate doclet with the target method. but it won't. that innocent looking comment block(one line or multi line) has done the damage. the worst part is that xdoclet won't fail while "compiling".

however, if the doclet and the target method are separated by empty lines then xdoclet behaves intelligently.

No comments: