JDK-8247789 : Remove use of reflection from test/jdk/java/io/Serializable/records/StreamRefTest.java
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io:serialization
  • Affected Version: 15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-06-17
  • Updated: 2024-10-17
  • Resolved: 2020-06-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15 JDK 16
15 b29Fixed 16Fixed
Related Reports
Relates :  
Description
Final fields on records are not modifiable via reflection.  StreamRefTest.java needs to be updated to remove its dependency on Field::set.  The two test cases in StreamRefTest.java are disabled by JDK-8247444.

diff --git a/test/jdk/java/io/Serializable/records/StreamRefTest.java b/test/jdk/java/io/Serializable/records/StreamRefTest.java
--- a/test/jdk/java/io/Serializable/records/StreamRefTest.java
+++ b/test/jdk/java/io/Serializable/records/StreamRefTest.java
@@ -112,7 +112,7 @@
 
     static final Class<InvalidObjectException> IOE = InvalidObjectException.class;
 
-    @Test
+    @Test(enabled=false)
     public void basicRefWithInvalidA() throws Exception {
         out.println("\n---");
         var a = new A(3);
@@ -134,7 +134,7 @@
         assertEquals(b1.a, null);
     }
 
-    @Test
+    @Test(enabled=false)
     public void reverseBasicRefWithInvalidA() throws Exception {
         out.println("\n---");
         var a = new A(3);

Comments
Changeset: 56048d04 Author: Chris Hegarty <chegar@openjdk.org> Date: 2020-06-18 17:46:15 +0000 URL: https://git.openjdk.java.net/lanai/commit/56048d04
02-07-2020

Changeset: 56048d04 Author: Chris Hegarty <chegar@openjdk.org> Date: 2020-06-18 17:46:15 +0000 URL: https://git.openjdk.java.net/panama-foreign/commit/56048d04
02-07-2020

Changeset: 56048d04 Author: Chris Hegarty <chegar@openjdk.org> Date: 2020-06-18 17:46:15 +0000 URL: https://git.openjdk.java.net/amber/commit/56048d04
02-07-2020

Changeset: 56048d04 Author: Chris Hegarty <chegar@openjdk.org> Date: 2020-06-18 17:46:15 +0000 URL: https://git.openjdk.java.net/mobile/commit/56048d04
02-07-2020

URL: https://hg.openjdk.java.net/jdk/jdk15/rev/fcefe78af1f5 User: chegar Date: 2020-06-18 16:47:07 +0000
18-06-2020