RFR: 8285690: CloneableReference subtest should not throw CloneNotSupportedException [v2]
Kim Barrett
kbarrett at openjdk.java.net
Wed Apr 27 18:23:43 UTC 2022
On Wed, 27 Apr 2022 15:57:34 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:
>>
>> update copyright, @bug list
>
> 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.
That was my initial thought, but it doesn't work - CNSE is a checked exception so must be handled.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8418
More information about the core-libs-dev
mailing list