Just a few months ago we had to conclude that we could no longer
sustain onMethod, a feature introduced in 0.10.0 betas which let you
specify annotations on @Getter and @Setter and such, which would be
moved to the generated methods. The reason for why we dropped this
feature had to do with javac7, and is explained here:
http://groups.google.com/group/project-lombok/browse_thread/thread/dd566ff0691ba111/
In short, Java7 would simply abort without even calling lombok, and
thus we had no way of fixing the bug before compilation.
But... Reinier and I just discovered a way to re-introduce onMethod!
While hacking out a syntax for a new feature, we discovered that
annotation processors would run, as long as the field that we used
within an annotation was not valid. @Getter(onMethod=@Deprecated) will
not work, but @Getter(randomNoise=@Deprecated) will work. So, as long
as we make the situation *worse* we can make annotation processors
(i.e. lombok) run and we can do our magic.
Taking this, the fix for onMethod is pretty simple: We add the
functionality, but we never actually add the field to the @Getter and
@Setter annotations. This does have a big downside, as you will *not*
get as-you-type completion on 'onMethod', but you will get completion
on the actual annotations itself, fortunately.
So, should we re-introduce this slightly less nice onMethod
construction? We'll definitely mark it as a 'beta' feature because we
don't know if javac updates will break this hack again; it's
definitely more hacky than the usual things we do with lombok.
love to hear your opinion!