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

jdb "eval" should allow to create a new value type instance with specified fields

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: core-svc
    • Labels:
      None

      Description

      1. Compile the sample test.
      2. Start jdb:
      $ jdb -classpath . -XX:+EnableValhalla Test
      3. Set breakpoint on the line with System.out.println()
      > stop at Test:8
      4. Run to breakpoint
      > run
      5. Create a new value type instance
      > eval new Test$MyValue(7,'f')

      Expected result:
      The output should be
      new Test$MyValue(7,'f') = "[value class Test$MyValue, 7, f]"
      Actual result:
      The printed output is
      new Test$MyValue(7,'f') = "[value class Test$MyValue, 0, ]"

      =============================================
      public class Test {

        public static void main(String[] args){

          MyValue v = new MyValue(12,'c');
          System.out.println("v == v " + (v == v));
        }

        public final __ByValue static class MyValue {
            int a;
            char b;

            public MyValue(int a, char b){
              this.a = a;
              this.b = b;
            }

        }

      }


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fparain Frederic Parain
              Reporter:
              dtitov Daniil Titov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: