RFR: 7027: Avoid NPE for callers of TransformRegistry#getTransformData [v2]

Gunnar Morling github.com+28612+gunnarmorling at openjdk.java.net
Wed Dec 2 22:18:02 UTC 2020


> …) 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!

Gunnar Morling has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit:

  7027: avoiding NPE for callers of TransformRegistry#getTransformData() if no transform data exists

-------------

Changes: https://git.openjdk.java.net/jmc/pull/169/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jmc&pr=169&range=01
  Stats: 42 lines in 3 files changed: 11 ins; 2 del; 29 mod
  Patch: https://git.openjdk.java.net/jmc/pull/169.diff
  Fetch: git fetch https://git.openjdk.java.net/jmc pull/169/head:pull/169

PR: https://git.openjdk.java.net/jmc/pull/169


More information about the jmc-dev mailing list