RFR: 8256865: Foreign Memory Access and Linker API are missing NPE checks [v6]
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Tue Nov 24 15:54:11 UTC 2020
> Both the Foreign Memory Access and the Foreign Linker APIs leave something to be desired when it comes to handling NPEs - first, most of the API javadoc is oblivious to NPEs being thrown. Secondly, not all API method implementations add expicit NPE checks - with the result of NPE often being thrown very deep in the call chain - if at all. Third, test for API coverage of nulls is ad-hoc.
>
> This patch rectifies all these issues. To increase coverage for null injected into APIs, this patch introduces a new framework for testing an API in bulk, so that all methods are reflectively called with some values replaced with nulls, so that all combinations are tried.
>
> I've also added, as part of this patch, a test to cover the statics in MemoryAccess which were not covered throughly.
Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
Fix use of star import in LibrariesHelper
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/1388/files
- new: https://git.openjdk.java.net/jdk/pull/1388/files/19a77d9f..6c25c739
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1388&range=05
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1388&range=04-05
Stats: 5 lines in 1 file changed: 4 ins; 0 del; 1 mod
Patch: https://git.openjdk.java.net/jdk/pull/1388.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/1388/head:pull/1388
PR: https://git.openjdk.java.net/jdk/pull/1388
More information about the core-libs-dev
mailing list