Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8247789

Remove use of reflection from test/jdk/java/io/Serializable/records/StreamRefTest.java

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 15
    • Fix Version/s: 15
    • Component/s: core-libs
    • Labels:

      Backports

        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);

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  chegar Chris Hegarty
                  Reporter:
                  mchung Mandy Chung
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: