-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Introduce ErrorProne, fix compiler warnings #4807
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
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
8eb3acc
to
8a6ddaf
Compare
This is fantastic! Thank you for doing that, @scordio ! I have a plan to re-work/optimise the project's build/release process for the next major release (see #4319 as well), and this goes in that same direction. When this is not a draft PR anymore, please let me know and it should be welcome to merge. |
f0efc64
to
459933c
Compare
6349088
to
48ae732
Compare
Signed-off-by: Stefano Cordio <[email protected]>
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.
Hi @fmbenhassine, I am finally ready with the changes!
I think there are a few flaky tests like:
SimpleStepFactoryBeanTests.testSimpleConcurrentJob
JdbcPagingItemReaderCommonTests
I couldn't figure out the root cause, but the failing ones are green with single executions in the IDE or when retrying a complete Maven build... if you have any hints, please let me know!
@SuppressWarnings("unused") | ||
private static final String STAR_WILDCARD = "*"; | ||
|
||
@SuppressWarnings("unused") | ||
private static final String SQL_WILDCARD = "%"; |
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 suppressed the warnings here, but it might make sense to delete them instead.
@SuppressWarnings("unused") // FIXME no usage - should it be deprecated for removal? | ||
public class ConversionException extends RuntimeException { |
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.
As the comment mentions, ConversionException
is currently unused in the codebase.
Should this be deprecated for removal?
-Xep:AlmostJavadoc:OFF | ||
-Xep:BadInstanceof:OFF <!-- FIXME gh-4839 --> | ||
-Xep:ByteBufferBackingArray:OFF | ||
-Xep:ClassCanBeStatic:OFF | ||
-Xep:CollectionUndefinedEquality:OFF | ||
-Xep:DefaultCharset:OFF | ||
-Xep:DirectInvocationOnMock:OFF | ||
-Xep:DoNotCallSuggester:OFF | ||
-Xep:EmptyCatch:OFF | ||
-Xep:EqualsGetClass:OFF | ||
-Xep:Finally:OFF | ||
-Xep:FutureReturnValueIgnored:OFF | ||
-Xep:HidingField:OFF | ||
-Xep:ImmutableEnumChecker:OFF | ||
-Xep:InlineMeSuggester:OFF | ||
-Xep:InputStreamSlowMultibyteRead:OFF | ||
-Xep:JavaTimeDefaultTimeZone:OFF | ||
-Xep:JavaUtilDate:OFF | ||
-Xep:JdkObsolete:OFF | ||
-Xep:MissingSummary:OFF | ||
-Xep:MixedMutabilityReturnType:OFF | ||
-Xep:MutablePublicArray:OFF | ||
-Xep:NonAtomicVolatileUpdate:OFF | ||
-Xep:RedundantControlFlow:OFF | ||
-Xep:ReferenceEquality:OFF | ||
-Xep:StaticAssignmentInConstructor:OFF | ||
-Xep:StaticAssignmentOfThrowable:OFF | ||
-Xep:StaticMockMember:OFF | ||
-Xep:StreamResourceLeak:OFF | ||
-Xep:StringCaseLocaleUsage:OFF | ||
-Xep:StringSplitter:OFF | ||
-Xep:SynchronizeOnNonFinalField:OFF | ||
-Xep:ThreadLocalUsage:OFF | ||
-Xep:ThreadPriorityCheck:OFF | ||
-Xep:TypeParameterUnusedInFormals:OFF | ||
-Xep:UndefinedEquals:OFF | ||
-Xep:UnnecessaryStringBuilder:OFF | ||
-Xep:UnusedMethod:OFF | ||
-Xep:UnusedVariable:OFF | ||
-Xep:WaitNotInLoop:OFF |
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 excluded all the ErrorProne warnings that didn't have a straightforward solution.
I would suggest addressing them in separate PRs.
<compilerArg> | ||
-Xplugin:ErrorProne | ||
-Xep:AlmostJavadoc:OFF | ||
-Xep:BadInstanceof:OFF <!-- FIXME gh-4839 --> |
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.
BadInstanceof
is addressed in #4839
This PR introduces ErrorProne, sets the
maven-compiler-plugin
to fail in case of compiler warnings, and fixes all the warnings.This is a preparation for: