-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AnnotationValues.getProbableFQTypes does not work for class literals not on CP #161
Comments
👤 petr.jiricka 🕗 Dec 16, 2009 at 19:57 UTC 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 |
👤 petr.jiricka 🕗 Dec 16, 2009 at 19:57 UTC |
👤 reinierz 🕗 Dec 17, 2009 at 11:59 UTC 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. How's this: 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. |
👤 petr.jiricka 🕗 Dec 17, 2009 at 13:07 UTC Thanks for a quick fix - I will test it. I did not look into the Eclipse support area at all, and I did not know type |
👤 reinierz 🕗 Dec 17, 2009 at 16:33 UTC If eclipse just ceased to exist overnight, lombok could do a lot more than it does now. Eclipse's internal AST and |
👤 reinierz 🕗 Dec 21, 2009 at 13:33 UTC You can download a direct binary of this fix in the edge build: https://projectlombok.org/download-edge.html |
End of migration |
Migrated from Google Code (issue 88)
The text was updated successfully, but these errors were encountered: