-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fail Maven build on compiler warnings; remove some warning suppressions #2183
Fail Maven build on compiler warnings; remove some warning suppressions #2183
Conversation
Yes, that can be seen with the failed CIFuzz run:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with this if you can fix the CIFuzz problem. I suspect we may find that failOnWarning
is more trouble than it's worth but it won't be hard to back just that part out if so.
@@ -126,10 +126,10 @@ private ReflectiveTypeAdapterFactory.BoundField createBoundField( | |||
final TypeToken<?> fieldType, boolean serialize, boolean deserialize, | |||
final boolean blockInaccessible) { | |||
final boolean isPrimitive = Primitives.isPrimitive(fieldType.getRawType()); | |||
// special casing primitives here saves ~5% on Android... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have removed this comment because it is a bit misleading (at least at the current line where this is placed). It appears this was added in 2011 after experiments with Field.setInt
and similar. Though I am not sure if that code is part of the Git history. Additionally since currently Gson only supports Object
values, primitives would always be boxed. It would also have to be verified if these 5% difference still applies after now 11 years.
Have excluded the Though I agree, if |
This is great, thanks! |
Currently this enables all compiler warnings (
-Xlint:all
); I am not sure if that is a good idea. If you want we can also restrict it to specific warnings instead. For example warnings forserial
seem to be redundant here andvarargs
seems to not be very helpful. I am also a bit afraid that the supported and detected warnings depend on the JDK version being used (instead of the--release
version being specified).It also looks like
javac
and Eclipse IDE disagree regarding when a warning needs to be suppressed. For some of the required suppressions here Eclipse is telling me "Unnecessary @ SuppressWarnings".Supersedes #1374
Please let me know what you think.