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
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@turbanoff
Copy link

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 20, 2019
@sbrannen
Copy link
Member

Good catch.

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

@sbrannen sbrannen added in: data Issues in data modules (jdbc, orm, oxm, tx) status: waiting-for-feedback We need additional information before we can continue type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 20, 2019
@jhoeller
Copy link
Contributor

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.

@jhoeller jhoeller self-assigned this Nov 20, 2019
@jhoeller jhoeller added type: bug A general bug and removed status: waiting-for-feedback We need additional information before we can continue type: enhancement A general enhancement labels Nov 20, 2019
@jhoeller jhoeller added this to the 5.2.2 milestone Nov 20, 2019
@jhoeller jhoeller changed the title SqlRowSet.getString method should be marked @Nullable SqlRowSet accessor methods should be marked @Nullable Nov 20, 2019
@jhoeller jhoeller added the for: backport-to-5.1.x Marks an issue as a candidate for backport to 5.1.x label Nov 20, 2019
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.1.x Marks an issue as a candidate for backport to 5.1.x labels Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants