apache / arrow

Apache Arrow is the universal columnar format and multi-language toolbox for fast data interchange and in-memory analytics
https://arrow.apache.org/
Apache License 2.0
14.62k stars 3.55k forks source link

[Java] Checker Framework annotations for AutoCloseables in arrow-memory-core are incorrect #39814

Open lidavidm opened 9 months ago

lidavidm commented 9 months ago

Describe the enhancement requested

AutoCloseables.close works with nulls and collections of nulls, but isn't annotated appropriately, making downstream usage harder.

Component(s)

Java

davisusanibar commented 9 months ago

take

davisusanibar commented 9 months ago

In particular, this is due to the fact that the class org/apache/arrow/util/AutoCloseables.java is not referenced inside the memory core, which means that nullables cannot be de-referenced in those close methods.

davisusanibar commented 9 months ago

Let me add that manually.

lidavidm commented 9 months ago

Yes, I think you will run into this as you enable the checker in other modules.

lidavidm commented 9 months ago

Also, see https://github.com/apache/arrow-adbc/pull/1495 where I have added type stubs to override annotations in some Arrow Java libraries.