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

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

    XMLWordPrintable

Details

    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

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

                Dates

                  Created:
                  Updated:
                  Resolved: