8061616: HotspotDiagnosticMXBean.getVMOption() throws IllegalArgumentException for flags of type double

Mon, 03 Nov 2014 11:19:43 +0100

author
phh
date
Mon, 03 Nov 2014 11:19:43 +0100
changeset 9979
9f2b95a3c80b
parent 9978
0943ff57e154
child 9980
cbabffce5685

8061616: HotspotDiagnosticMXBean.getVMOption() throws IllegalArgumentException for flags of type double
Reviewed-by: simonis, andrew

src/share/vm/services/jmm.h file | annotate | diff | comparison | revisions
src/share/vm/services/management.cpp file | annotate | diff | comparison | revisions
test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/services/jmm.h	Thu Aug 13 08:38:55 2020 +0100
     1.2 +++ b/src/share/vm/services/jmm.h	Mon Nov 03 11:19:43 2014 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -143,7 +143,8 @@
    1.11    JMM_VMGLOBAL_TYPE_UNKNOWN  = 0,
    1.12    JMM_VMGLOBAL_TYPE_JBOOLEAN = 1,
    1.13    JMM_VMGLOBAL_TYPE_JSTRING  = 2,
    1.14 -  JMM_VMGLOBAL_TYPE_JLONG    = 3
    1.15 +  JMM_VMGLOBAL_TYPE_JLONG    = 3,
    1.16 +  JMM_VMGLOBAL_TYPE_JDOUBLE  = 4
    1.17  } jmmVMGlobalType;
    1.18  
    1.19  typedef enum {
     2.1 --- a/src/share/vm/services/management.cpp	Thu Aug 13 08:38:55 2020 +0100
     2.2 +++ b/src/share/vm/services/management.cpp	Mon Nov 03 11:19:43 2014 +0100
     2.3 @@ -1578,6 +1578,9 @@
     2.4    } else if (flag->is_uint64_t()) {
     2.5      global->value.j = (jlong)flag->get_uint64_t();
     2.6      global->type = JMM_VMGLOBAL_TYPE_JLONG;
     2.7 +  } else if (flag->is_double()) {
     2.8 +    global->value.d = (jdouble)flag->get_double();
     2.9 +    global->type = JMM_VMGLOBAL_TYPE_JDOUBLE;
    2.10    } else if (flag->is_ccstr()) {
    2.11      Handle str = java_lang_String::create_from_str(flag->get_ccstr(), CHECK_false);
    2.12      global->value.l = (jobject)JNIHandles::make_local(env, str());
     3.1 --- a/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java	Thu Aug 13 08:38:55 2020 +0100
     3.2 +++ b/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java	Mon Nov 03 11:19:43 2014 +0100
     3.3 @@ -33,7 +33,7 @@
     3.4   */
     3.5  
     3.6  public class DoubleTest {
     3.7 -    private static final String FLAG_NAME = null;
     3.8 +    private static final String FLAG_NAME = "InitialRAMPercentage";
     3.9      private static final Double[] TESTS = {0d, -0d, -1d, 1d,
    3.10              Double.MAX_VALUE, Double.MIN_VALUE, Double.NaN,
    3.11              Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY};

mercurial