Integrated: 7027: Avoid NPE for callers of TransformRegistry#getTransformData
Gunnar Morling
github.com+28612+gunnarmorling at openjdk.java.net
Fri Dec 4 16:25:11 UTC 2020
On Sun, 29 Nov 2020 19:27:48 GMT, Gunnar Morling <github.com+28612+gunnarmorling at openjdk.org> wrote:
> …) of no transform data exists
>
> @thegreystone, @Josh-Matsuoka, et al., this fixes an NPE in the `Transformer` class if there is no metadata for the given class (we unconditionally try to iterate over the returned list). I noticed this while debugging something else, it seems this NPE gets swallowed elsewhere, but creating it over and over is costly of course.
>
> I think never returning null from a collection method is a good practice anyways, so I've changed it accordingly. Could someone log an issue for this, so I can reference it? Thanks!
This pull request has now been integrated.
Changeset: 65187e94
Author: Gunnar Morling <gunnar.morling at googlemail.com>
Committer: Guru Hb <ghb at openjdk.org>
URL: https://git.openjdk.java.net/jmc/commit/65187e94
Stats: 42 lines in 3 files changed: 11 ins; 2 del; 29 mod
7027: Avoid NPE for callers of TransformRegistry#getTransformData
Reviewed-by: hirt
-------------
PR: https://git.openjdk.java.net/jmc/pull/169
More information about the jmc-dev
mailing list