-
Notifications
You must be signed in to change notification settings - Fork 114
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
Allow custom @SuppressWarnings in JFlex 1.8.2 #762
Comments
Thanks for reporting this. Would it make sense to make this part of the lexer spec, e.g. something like adding a |
Any solution would be welcome, I leave it to your appreciation :) |
Thanks for filing the issue. I also realised the problem it causes on the compilation in #453 (comment) We have a few options
In the meantime, can you move the @SuppressWarnings on the methods that violate "nls" or "unused" (or are those also on generated code)? |
Yes, sure, we do that, it's the cleanest solution, we have (luckily) very few places were we need @SuppressWarnings annotations.
or for the ZZ_*_PACKED_* strings. A workaround would be to adapt our own skeleton files by adding
but the general idea for us (by upgrading to JFlex 1.8.2) is to refactor our code to completely remove the need of custom skeletons ;) NB: in Eclipse @SuppressWarnings("FallThrough") is marked as "Unsupported", so anyway we will never get rid of all warnings everywhere lol |
That'd be cool. Let us know if you hit any other issues!
I used Eclipse for JFlex development a while ago and still have quite a few of these
Good to know, so if we do something like |
To resume all we discussed, the only "true" problem I see is that there should be some option to remove/disable @SuppressWarnings automatically added by JFlex. Forget about the "nls" stuff, I don't know if it's worth the headaches. On the other side, you are totally right, the user should only add its own @SuppressWarnings on user methods that really need them, it's globally a better coding practice, I'll do this way ;) Anyway, thanx for taking so many time on this minor issue :) |
We hit this issue too with apache lucene :) One practical problem with the current So we had to use find-replace and change it to |
Thanks for that, it's good to know that case sensitivity might be an issue as well. |
Hi,
I'm from eclipse PDT team, and we recently switched from JFlex 1.6.1 to JFlex 1.8.2, it works great, thank you for your hard work, it's much appreciated!
We just noticed a minor issue (if we can call this an issue) while using our lexical specification files.
Long time ago, we've added our own "@SuppressWarnings" annotations, so our lexical files start with:
that will now be generated as:
The fact that JFlex 1.8.2 adds its own '@SuppressWarnings("FallThrough")' annotation will now result in java compilation errors (Duplicate annotation of non-repeatable type @SuppressWarnings.).
For now we simply removed our "@SuppressWarnings" annotations to workaround the issue.
This brings me to following question:
would it be possible to add in future releases a new JFlex run option (for example
--annotations
) to add our own annotations again?Thank you!
The text was updated successfully, but these errors were encountered: