You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/04/20 09:39:30 UTC
[GitHub] [calcite] vlsi opened a new pull request #1929: Add CheckerFramework to GitHub Actions CI
vlsi opened a new pull request #1929:
URL: https://github.com/apache/calcite/pull/1929
CheckerFramework needs an annotated JDK (which might be slow to download), so it is not activated by default
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] uschindler commented on a change in pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#discussion_r482059339
##########
File path: core/src/main/java/org/apache/calcite/runtime/ResultSetEnumerable.java
##########
@@ -434,20 +437,23 @@ public void close() {
};
}
//noinspection unchecked
Review comment:
same here
##########
File path: core/src/main/java/org/apache/calcite/runtime/ResultSetEnumerable.java
##########
@@ -95,29 +95,32 @@
};
} else {
//noinspection unchecked
Review comment:
is this comment not also obsolete? In my patch I removed it; reason: unchecked cast is gone
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] vlsi commented on pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
vlsi commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-729276019
PR moved to https://github.com/apache/calcite/pull/2268
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] michaelmior commented on pull request #1929: Add CheckerFramework to GitHub Actions CI
Posted by GitBox <gi...@apache.org>.
michaelmior commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-646701923
Looks like this is currently failing but I assume that's expected? (Presumably because of missing annotations.)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] vlsi closed pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
vlsi closed pull request #1929:
URL: https://github.com/apache/calcite/pull/1929
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] uschindler commented on pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-685704487
Hi,
If your're interested here is a patch to fix the issue. The good thing: it also rmeove the stupid cast, because Javac can't guess the lambda's types:
[javacbug.patch.txt](https://github.com/apache/calcite/files/5162279/javacbug.patch.txt)
If this also fixes checkerframework, go for it! Actually this seems another bug, because moving the type outside of the try...catch (see my code, does not help), but moving to a method helps.
To me this looks like a problem with javac and type parameters in combination with lambdas inside other lambdas. :-)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] uschindler edited a comment on pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
uschindler edited a comment on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-685704487
Hi,
If your're interested here is a patch to fix the issue. The good thing: it also rmeove the stupid cast, because Javac can't guess the lambda's types:
[javacbug.patch.txt](https://github.com/apache/calcite/files/5162279/javacbug.patch.txt)
If this also fixes checkerframework, go for it! Actually this seems another bug, because moving the type outside of the try...catch (see my code, does not help), but moving to a method helps.
To me this looks like a (new?) problem with javac and type parameters in combination with lambdas inside other lambdas. :-) This may be the reason why also Java 11 fails (see JDK 11 builds).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] vlsi commented on pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
vlsi commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-685681553
@uschindler , thank you so much for the explanation. No need to sorry, and I need to say many thanks for the maintenance of forbidden-apis.
As you see, I am still in progress of annotating the code to verify nullness (there are 3000 errors to be fixed), and then I would have the full set of ill classes, and I could either refactor them or do something.
I do not think it is worth excluding ResultSetEnumerable from the verification. The reason for other classes are excluded is they have known forbidden calls which can't be avoided (e.g. the code is generated). By the way, if we could use "suppresswarnings" to suppress a single violation, we would go with that rather than excluding the full file.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] zinking edited a comment on pull request #1929: Add CheckerFramework to GitHub Actions CI
Posted by GitBox <gi...@apache.org>.
zinking edited a comment on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-651777735
> 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.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] uschindler commented on pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-685665703
Hi,
sorry for not producing a useful error message with forbidenapis. The problem here is that forbiddenapis catches a bug (indirectly) that is making Oracle's Javac produce bad class files.
After applying the forbiddenapis pull request https://github.com/policeman-tools/forbidden-apis/pull/174 I was able to find the problem:
- https://github.com/apache/calcite/blob/29bf6aff96325106756a989297e907daa9e2438d/core/src/main/java/org/apache/calcite/runtime/ResultSetEnumerable.java#L100
- https://github.com/apache/calcite/blob/29bf6aff96325106756a989297e907daa9e2438d/core/src/main/java/org/apache/calcite/runtime/ResultSetEnumerable.java#L439
In both cases javac creates buggy class files which may break downstream consumers of ResultSetEnumerable.
My recommendation is to remove the `@Nullable` here.
If you want to just work around the issue, you can exclude the file using "exclude" in the forbiddenapis configuration:
```
configureEach<CheckForbiddenApis> {
excludeJavaCcGenerated()
exclude(
"**/org/apache/calcite/adapter/os/Processes${'$'}ProcessFactory.class",
"**/org/apache/calcite/adapter/os/OsAdapterTest.class",
"**/org/apache/calcite/runtime/Resources${'$'}Inst.class",
"**/org/apache/calcite/test/concurrent/ConcurrentTestCommandScript.class",
"**/org/apache/calcite/test/concurrent/ConcurrentTestCommandScript${'$'}ShellCommand.class",
"**/org/apache/calcite/util/Unsafe.class",
"**/org/apache/calcite/runtime/ResultSetEnumerable.class"
)
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] vlsi commented on pull request #1929: Add CheckerFramework to GitHub Actions CI
Posted by GitBox <gi...@apache.org>.
vlsi commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-683349305
Just in case, `linq4j:compileJava` says there are only 46 errors left :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] vlsi commented on a change in pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
vlsi commented on a change in pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#discussion_r510634360
##########
File path: core/src/main/java/org/apache/calcite/DataContext.java
##########
@@ -42,17 +44,17 @@
/**
* Returns a sub-schema with a given name, or null.
*/
- SchemaPlus getRootSchema();
+ @Nullable SchemaPlus getRootSchema();
/**
Review comment:
`javax.annotation.Nullable` does not support cases like `List<javax.annotation.Nullable String>`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] vlsi commented on pull request #1929: Add CheckerFramework to GitHub Actions CI
Posted by GitBox <gi...@apache.org>.
vlsi commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-646750826
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 :-/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] vlsi commented on pull request #1929: Add CheckerFramework to GitHub Actions CI
Posted by GitBox <gi...@apache.org>.
vlsi commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-683428235
Ok, now `linq4j` passes the verification.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] michaelmior commented on pull request #1929: Add CheckerFramework to GitHub Actions CI
Posted by GitBox <gi...@apache.org>.
michaelmior commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-663594557
@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?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] uschindler commented on pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-685706436
Sorry the patch file still contains my quick hack to let forbiddenapis run from a local JAR file.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] uschindler edited a comment on pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
uschindler edited a comment on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-685704487
Hi,
If your're interested here is a patch to fix the issue. The good thing: it also rmeove the stupid cast, because Javac can't guess the lambda's types:
[javacbug.patch.txt](https://github.com/apache/calcite/files/5162279/javacbug.patch.txt)
If this also fixes checkerframework, go for it! Actually this seems another bug in javac, because moving the type outside of the try...catch (see my code) does not help, but moving to a separate method helps.
To me this looks like a (new?) problem with javac and type parameters in combination with lambdas inside other lambdas. :-) This may be the reason why also Java 11 fails (see JDK 11 builds).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] zinking edited a comment on pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
zinking edited a comment on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-728694673
@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.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] vlsi commented on pull request #1929: Add CheckerFramework to GitHub Actions CI
Posted by GitBox <gi...@apache.org>.
vlsi commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-663597315
> So far I see there are no @NonNull annotations in the codebase
The suggested behavior is `non-null` by default, 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
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] danny0405 commented on a change in pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#discussion_r510551467
##########
File path: core/src/main/java/org/apache/calcite/DataContext.java
##########
@@ -42,17 +44,17 @@
/**
* Returns a sub-schema with a given name, or null.
*/
- SchemaPlus getRootSchema();
+ @Nullable SchemaPlus getRootSchema();
/**
Review comment:
Can we use `javax.annotation.Nullable` instead.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] vlsi edited a comment on pull request #1929: Add CheckerFramework to GitHub Actions CI
Posted by GitBox <gi...@apache.org>.
vlsi edited a comment on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-663597315
> 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
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] zinking commented on pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
zinking commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-728694673
@vlsi not sure why this is closed. 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.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] danny0405 commented on a change in pull request #1929: [CALCITE-4199] Add nullability annotations to the methods and fields, ensure consistency with checkerframework
Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#discussion_r510551467
##########
File path: core/src/main/java/org/apache/calcite/DataContext.java
##########
@@ -42,17 +44,17 @@
/**
* Returns a sub-schema with a given name, or null.
*/
- SchemaPlus getRootSchema();
+ @Nullable SchemaPlus getRootSchema();
/**
Review comment:
What's the difference is this `Nullable` between `javax.annotation.Nullable`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] michaelmior commented on pull request #1929: Add CheckerFramework to GitHub Actions CI
Posted by GitBox <gi...@apache.org>.
michaelmior commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-646812477
@vlsi Unfortunately I'm in the same situation bandwidth-wise but I'll keep that in mind.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] vlsi commented on pull request #1929: Add CheckerFramework to GitHub Actions CI
Posted by GitBox <gi...@apache.org>.
vlsi commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-657549239
Just in case, I've added `nullability` annotations to `pgjdbc`.
Here's what it becomes: https://github.com/pgjdbc/pgjdbc/pull/1814
An interesting note is that I had to add several annotations for `java.sql` types (e.g. ResultSet, CallableStatement, Preparedstatement, ResultSet, etc)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [calcite] zinking commented on pull request #1929: Add CheckerFramework to GitHub Actions CI
Posted by GitBox <gi...@apache.org>.
zinking commented on pull request #1929:
URL: https://github.com/apache/calcite/pull/1929#issuecomment-651777735
> 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 ^_^
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org