RFR: 8352109: java/awt/Desktop/MailTest.java fails in platforms where Action.MAIL is not supported [v3]

Manukumar V S mvs at openjdk.org
Wed Mar 19 02:41:48 UTC 2025


> **Issue**
> java/awt/Desktop/MailTest.java fails in platforms where Action.MAIL is not supported
> 
> **Reason**
> In `MailTest.java`, there is a condition check(`if (!desktop.isSupported(Desktop.Action.MAIL))`) which will force pass the test if the corresponding 'Action' is not supported by the platform. But, apparently, this is not working good and the code flow went past this and fails in desktop.mail() method with an UnsupportedOperationException. 
> 
> **Fix**
> Even though we are calling `PassFailJFrame.forcePass()` if the 'Action.MAIL' is unsupported, the PassFailJFrame just count downs a latch and the actual action will be taken later only(in `awaitAndCheck()`). But at the meantime, the desktop.mail() call gets executed in the constructor of MailTest() and it will result in an UnsupportedOperationException. So, the fix is to return from the constructor immediately if the operation is 'unsupported'.
> 
> **Testing**
> This is a manual test, so it is tested locally and found to be working fine.

Manukumar V S has updated the pull request incrementally with one additional commit since the last revision:

  Review comments fixed : Removed unwanted variable, made the error message inline

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/24072/files
  - new: https://git.openjdk.org/jdk/pull/24072/files/502d659b..650f5885

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

  Stats: 7 lines in 1 file changed: 0 ins; 3 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/24072.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24072/head:pull/24072

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


More information about the client-libs-dev mailing list