Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
scordio wants to merge 2 commits into spring-projects:main from scordio:cosmetic

Conversation

Copy link
Contributor

@scordio scordio commented Apr 5, 2025
edited
Loading

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:

sbrannen reacted with thumbs up emoji lobaorn reacted with hooray emoji

This comment was marked as outdated.

@scordio scordio marked this pull request as draft April 6, 2025 08:05
@scordio scordio changed the title (削除) Favor factory methods instead of double braces initialization (削除ここまで) (追記) Introduce ErrorProne, fix compiler warnings (追記ここまで) Apr 7, 2025
@scordio scordio force-pushed the cosmetic branch 2 times, most recently from 8eb3acc to 8a6ddaf Compare April 7, 2025 22:27
Copy link
Contributor

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.

scordio reacted with thumbs up emoji

@scordio scordio deleted the cosmetic branch May 9, 2025 23:28
@scordio scordio restored the cosmetic branch May 9, 2025 23:29
@scordio scordio reopened this May 9, 2025
@scordio scordio force-pushed the cosmetic branch 2 times, most recently from 4f4dbfa to ec33b20 Compare May 28, 2025 14:33
Copy link
Contributor Author

@scordio scordio left a 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!

Comment on lines 59 to 63
@SuppressWarnings("unused")
private static final String STAR_WILDCARD = "*";

@SuppressWarnings("unused")
private static final String SQL_WILDCARD = "%";
Copy link
Contributor Author

@scordio scordio May 6, 2025
edited
Loading

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.

Comment on lines +23 to 24
@SuppressWarnings("unused") // FIXME no usage - should it be deprecated for removal?
public class ConversionException extends RuntimeException {
Copy link
Contributor Author

@scordio scordio May 6, 2025
edited
Loading

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?

Copy link
Contributor

@fmbenhassine fmbenhassine Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will take care of that separately. Thank you for adding that "FIXME" for reference 👍

scordio reacted with thumbs up emoji
pom.xml Outdated
Comment on lines 189 to 227
-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
Copy link
Contributor Author

@scordio scordio May 28, 2025
edited
Loading

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.

Copy link
Contributor

@fmbenhassine fmbenhassine Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's fine, we can address those in separate PRs.

scordio reacted with thumbs up emoji
@scordio scordio marked this pull request as ready for review May 28, 2025 18:13
@scordio scordio force-pushed the cosmetic branch 2 times, most recently from e96e01d to aaf4582 Compare June 2, 2025 16:53
Copy link
Contributor Author

scordio commented Jun 2, 2025

... and now the build is green! 😅

scordio added 2 commits June 4, 2025 00:44
Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
Copy link
Contributor

This is a huge amount of work! Thank you very much for doing that, @scordio 👍

I know you had to rebase this several times due to the latest changes in the code base, really appreciated

Rebased, squashed and merged as 74975c5.

Copy link
Contributor Author

scordio commented Jun 3, 2025

Thanks! I'll continue with #4673 in the upcoming days 🙂

fmbenhassine reacted with thumbs up emoji lobaorn reacted with rocket emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@fmbenhassine fmbenhassine fmbenhassine left review comments

Assignees
No one assigned
Projects
None yet
Milestone
6.0.0-M1
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /