-
Notifications
You must be signed in to change notification settings - Fork 29
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
Don't emit @SafeVarargs
for reifiable types
#71
base: master
Are you sure you want to change the base?
Conversation
Attempt to detect if a type is reifiable, and omit the annotation in those cases. https://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html However one problem as noted in the comments is we can't get at a ParameterizedTypeName's enclosing type. So for instance, this code will treat `Foo<X>.Bar` as reifiable, even though it isn't. One idea to get around it would be to `toString()` the type and check if it contains any type parameters, although that seems kinda messy.
Hi! Giving a look at how @SafeVarargs
@SuppressWarnings("varargs") |
|
Would using Javac with |
@danielnorberg in my case, with Java 11, Javac with |
@lepistone Indeed. I had simply failed to enable |
Although the |
Attempt to detect if a type is reifiable, and omit the annotation in
those cases.
https://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html
However one problem as noted in the comments is we can't get at a
ParameterizedTypeName's enclosing type. So for instance, this code will
treat
Foo<X>.Bar
as reifiable, even though it isn't.One idea to get around it would be to
toString()
the type and check ifit contains any type parameters, although that seems kinda messy.