RFR: 4200096: OffScreenImageSource.removeConsumer NullPointerException [v3]

Jeremy duke at openjdk.org
Wed Apr 12 04:00:57 UTC 2023


> This resolves a 25 year old P4 ticket: a NullPointerException is printed to System.err needlessly.
> 
> This resolution involves confirming that an ImageConsumer is still registered before every notification.
> 
> I'll understand if this is rejected as unimportant, but I stumbled across this in the real world the other day and thought this was a simple enough bug to practice on.

Jeremy has updated the pull request incrementally with one additional commit since the last revision:

  4200096: rewrite solution, add LegitimateNullPointerTest
  
  Also I'm breaking out the unit tests (now there are 4 of them) into their own directory.
  
  The new LegitimateNullPointerTest confirms that we DO want to see NullPointerExceptions printed to System.err IF they come from the ImageConsumer itself.
  
  In this ticket most of our focus has been on the NPE's that stem from removing an ImageConsumer from OSIS mid-production (so the NPE was when OSIS tried to interact with its `theConsumer` field). This test tries to add other possible NPE's to our consideration.
  
  This new test passed in the master branch before this branch. I want to preserve this existing behavior if this proposal is accepted.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/13408/files
  - new: https://git.openjdk.org/jdk/pull/13408/files/36feaad0..573bdd3a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=13408&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13408&range=01-02

  Stats: 696 lines in 6 files changed: 454 ins; 214 del; 28 mod
  Patch: https://git.openjdk.org/jdk/pull/13408.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13408/head:pull/13408

PR: https://git.openjdk.org/jdk/pull/13408



More information about the client-libs-dev mailing list