Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
AnnotationValues.getProbableFQTypes does not work for class literals not on CP #161
I have an annotation that uses a Class parameter, so it is used like this:
In the Javac handler for this annotation, I call
However, this does not work, as the implementation calls
I am attaching a patch that fixes this problem for me - though I am not a
(It also fixes one other minor problem that the compiled source's package
Thanks for the patch, it showed me this is a bit more involve than I at first thought when I read the issue report.
The biggest problem I have with your (very nicely designed) setup of letting each concrete implementation of lombok (eclipse, and javac) set up the job of arriving at an FQN will
Thus, we must go with the first scenario, but therein lies a problem. Javac is fairly nicely designed and uses round-based compiling consistently, and will thus give you excellent
I'll make sure that when we do go there, that getProbableFQTypes is rewritten. It'll also be renamed; there's no more 'probable' about it once resolution is available to us. You won't
Thus, unfortunately, I can't accept your patch. However, I can rejigger how it works.
Separate from that there's the bugfix to "package foo;" which I did accept, and it's in the master branch on git now as 61b054d.
Instead of trying to use Class.forName, which admittedly is not a particularly good idea, how about this more complex but more powerful algorithm:
This ISNT the proper java resolution algorithm. There are edge cases where the proper resolution gives you a different class than this hack, but the only ways I can think of that this
This concept is now in the master branch (though not tested very well): 31d7d8e
It's not as good as using the true resolution, but I think it'll do until we upgrade lombok to run with full resolution support.
If eclipse just ceased to exist overnight, lombok could do a lot more than it does now. Eclipse's internal AST and