On Wed, 27 Apr 2022 10:11:15 GMT, Kim Barrett <kbarr...@openjdk.org> wrote:
>> Please review this fix to test/jdk/java/lang/ref/ReferenceClone.java. It was >> passing if CloneableReference::clone were to throw >> CloneNotSupportedException. >> That should be a failure. >> >> Testing: >> Locally (linux-x64) verified test still passes. Temporarily changed >> CloneableReference::clone to throw and verified the expected failure gets >> reported, unlike before. > > Kim Barrett has updated the pull request incrementally with one additional > commit since the last revision: > > update copyright, @bug list Marked as reviewed by mchung (Reviewer). test/jdk/java/lang/ref/ReferenceClone.java line 52: > 50: } catch (CloneNotSupportedException e) { > 51: throw new RuntimeException("CloneableReference::clone should > not throw CloneNotSupportedException"); > 52: } Alternatively, it could simply let CNSE propagate. CloneableReference ref = new CloneableReference(o); ref.clone(); `test()` and `main` will need to declare this checked exception. ------------- PR: https://git.openjdk.java.net/jdk/pull/8418