Skip to content

Commit 2d8d140

Browse files
author
Kim Barrett
committed
8285690: CloneableReference subtest should not throw CloneNotSupportedException
Reviewed-by: rriggs, mchung
1 parent ea83b44 commit 2d8d140

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/jdk/java/lang/ref/ReferenceClone.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @bug 8201793
26+
* @bug 8201793 8285690
2727
* @summary Test Reference::clone to throw CloneNotSupportedException
2828
*/
2929

@@ -47,7 +47,9 @@ public void test() {
4747
CloneableReference ref = new CloneableReference(o);
4848
try {
4949
ref.clone();
50-
} catch (CloneNotSupportedException e) {}
50+
} catch (CloneNotSupportedException e) {
51+
throw new RuntimeException("CloneableReference::clone should not throw CloneNotSupportedException");
52+
}
5153
}
5254

5355
private void assertCloneNotSupported(CloneableRef ref) {

0 commit comments

Comments
 (0)