On Mon, 23 Nov 2020 15:11:49 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> wrote:
> 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. This pull request has now been integrated. Changeset: 9aeadbb0 Author: Maurizio Cimadamore <mcimadam...@openjdk.org> URL: https://git.openjdk.java.net/jdk/commit/9aeadbb0 Stats: 1021 lines in 36 files changed: 826 ins; 164 del; 31 mod 8256865: Foreign Memory Access and Linker API are missing NPE checks Reviewed-by: jvernee, sundar, chegar ------------- PR: https://git.openjdk.java.net/jdk/pull/1388