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

[CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework #1929

Closed
wants to merge 10 commits into from

Conversation

vlsi
Copy link
Contributor

@vlsi vlsi commented Apr 20, 2020

https://issues.apache.org/jira/browse/CALCITE-4199

CheckerFramework needs an annotated JDK (which might be slow to download), so it is not activated by default

Third-party issues:

Corner cases:

@vlsi vlsi force-pushed the checkerframework branch 2 times, most recently from a11b3dd to 7d3162d Compare April 20, 2020 09:52
@vlsi vlsi force-pushed the checkerframework branch from 7d3162d to a6678da Compare May 28, 2020 18:57
@michaelmior
Copy link
Member

Looks like this is currently failing but I assume that's expected? (Presumably because of missing annotations.)

@vlsi
Copy link
Contributor Author

vlsi commented Jun 19, 2020

You are right, there's not enough annotations.
The idea was that once all the annotations are there, we could enforce the check for all the commits.

Feel free to pick it up.
I don't have the bandwidth in the nearest future :-/

@michaelmior
Copy link
Member

@vlsi Unfortunately I'm in the same situation bandwidth-wise but I'll keep that in mind.

@zinking
Copy link
Contributor

zinking commented Jun 30, 2020

You are right, there's not enough annotations.
The idea was that once all the annotations are there, we could enforce the check for all the commits.

Feel free to pick it up.
I don't have the bandwidth in the nearest future :-/

I remember you do these things using script last time I saw ^_^

ok , after some digging, this isn't scripting task.

@vlsi
Copy link
Contributor Author

vlsi commented Jul 13, 2020

Just in case, I've added nullability annotations to pgjdbc.
Here's what it becomes: pgjdbc/pgjdbc#1814

An interesting note is that I had to add several annotations for java.sql types (e.g. ResultSet, CallableStatement, Preparedstatement, ResultSet, etc)

@michaelmior
Copy link
Member

@vlsi I was curious to take a look at this and I started to tackle some more necessary annotations on my own checkerframework branch. So far I see there are no @NonNull annotations in the codebase. Has this simply not been addressed yet or is there a reason for avoiding these?

@vlsi
Copy link
Contributor Author

vlsi commented Jul 24, 2020

So far I see there are no @nonnull annotations in the codebase

The suggested behavior is non-null by default (it is default for checkerframework), so I have not added it yet.

It should be enough to add DefaultQualifier to the topmost package as follows: https://github.com/pgjdbc/pgjdbc/blob/aa190cce2c27ac5f5d4fa33f5d156f8bf04cbe0c/pgjdbc/src/main/java/org/postgresql/package-info.java#L6-L13

@vlsi vlsi force-pushed the checkerframework branch from a6678da to 21074fd Compare August 29, 2020 22:13
@vlsi
Copy link
Contributor Author

vlsi commented Aug 29, 2020

Just in case, linq4j:compileJava says there are only 46 errors left :)

@vlsi vlsi force-pushed the checkerframework branch 3 times, most recently from 138be41 to 76d72b4 Compare August 30, 2020 14:29
@vlsi
Copy link
Contributor Author

vlsi commented Aug 30, 2020

Ok, now linq4j passes the verification.

@vlsi vlsi force-pushed the checkerframework branch 2 times, most recently from c2b751a to 62c2b54 Compare August 30, 2020 22:41
@vlsi vlsi changed the title Add CheckerFramework to GitHub Actions CI [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework Aug 30, 2020
@vlsi vlsi force-pushed the checkerframework branch 10 times, most recently from 4b3b45d to 39e3acd Compare August 31, 2020 12:24
@vlsi vlsi force-pushed the checkerframework branch from c9040cd to 2b61b9c Compare October 12, 2020 09:23
@vlsi vlsi force-pushed the checkerframework branch 6 times, most recently from ef3dddd to cc70bcd Compare October 22, 2020 23:16
@vlsi vlsi force-pushed the checkerframework branch from cc70bcd to 17efa52 Compare October 23, 2020 08:20
@vlsi vlsi force-pushed the checkerframework branch 3 times, most recently from e6121d7 to 9624c9c Compare November 1, 2020 18:24
@vlsi vlsi force-pushed the checkerframework branch from 9624c9c to e951549 Compare November 1, 2020 22:17
@vlsi
Copy link
Contributor Author

vlsi commented Nov 1, 2020

As of now, 480 errors left in :core

@vlsi vlsi force-pushed the checkerframework branch from e951549 to d591816 Compare November 2, 2020 11:02
@vlsi vlsi force-pushed the checkerframework branch from d591816 to 7cb10ba Compare November 3, 2020 20:18
@vlsi vlsi closed this Nov 14, 2020
@zinking
Copy link
Contributor

zinking commented Nov 17, 2020

@vlsi not sure why this is closed (is the code abonded ?). I think this will be useful and seems most agrees with this (JIRA).
I'd suggest break these things into small iterations and put them in gradually.

@vlsi
Copy link
Contributor Author

vlsi commented Nov 17, 2020

PR moved to #2268

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

Successfully merging this pull request may close these issues.

5 participants