Skip to content
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

SqlRowSet accessor methods should be marked @Nullable #24042

Closed
turbanoff opened this issue Nov 20, 2019 · 2 comments
Closed

SqlRowSet accessor methods should be marked @Nullable #24042

turbanoff opened this issue Nov 20, 2019 · 2 comments
Assignees
Milestone

Comments

@turbanoff
Copy link

@turbanoff turbanoff commented Nov 20, 2019

We use org.springframework.jdbc.support.rowset.SqlRowSet in our project to extract data from PostgreSQL.
Recently I found out that IntelliJ IDEA shows warning where it shouldn't be.
image
As I understand it's because IDEA thinks that SqlRowSet.getString always return non-null value. But it's not true. It's because of @NonNullApi annotation in https://github.com/spring-projects/spring-framework/blob/master/spring-jdbc/src/main/java/org/springframework/jdbc/support/rowset/package-info.java

Need to mark all SqlRowSets methods which can return null as @Nullable to avoid static analyzer false-positive warnings.

@sbrannen

This comment has been minimized.

Copy link
Member

@sbrannen sbrannen commented Nov 20, 2019

Good catch.

@turbanoff, would you like to submit a PR to address this?

@jhoeller

This comment has been minimized.

Copy link
Contributor

@jhoeller jhoeller commented Nov 20, 2019

Actually, let me take this opportunity to generally revisit our use of the JDBC API which unfortunately comes with "unclean" nullability, so the static analyzers don't perform strict validation against it. Otherwise we would have discovered the mismatch in ResultSetWrappingSqlRowSet right away.

So from that perspective, no need for a PR... I can take this from here and backport it to 5.1.x and 5.0.x as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.