RFR: 8348106: Catch C++ exception in Java_sun_awt_windows_WTaskbarPeer_setOverlayIcon

Rajat Mahajan rmahajan at openjdk.org
Wed Feb 5 18:47:49 UTC 2025


**Issue:**
The JNI method `Java_sun_awt_windows_WTaskbarPeer_setOverlayIcon `calls `CreateIconFromRaster `that can throw a C++ exception.

The C++ exception must be caught and must not be allowed to escape the JNI method. The call to `CreateIconFromRaster `has to wrapped into a try-catch block.

**Solution:**

Added exception handling to make sure any exception from `CreateIconFromRaster `is handled properly.

Testing done.

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

Commit messages:
 - remove unrelated change
 - remove unrelated change
 - 8348106: Catch C++ exception in Java_sun_awt_windows_WTaskbarPeer_setOverlayIcon

Changes: https://git.openjdk.org/jdk/pull/23470/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23470&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8348106
  Stats: 9 lines in 1 file changed: 6 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/23470.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23470/head:pull/23470

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


More information about the client-libs-dev mailing list