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

Reviewed-by: mchung, sla
This commit is contained in:
Jaroslav Bachorik 2014-11-03 11:19:43 +01:00
parent c6b9495b55
commit f52a43892a
3 changed files with 7 additions and 3 deletions
hotspot
src/share/vm/services
test/testlibrary_tests/whitebox/vm_flags

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -143,7 +143,8 @@ typedef enum {
JMM_VMGLOBAL_TYPE_UNKNOWN = 0,
JMM_VMGLOBAL_TYPE_JBOOLEAN = 1,
JMM_VMGLOBAL_TYPE_JSTRING = 2,
JMM_VMGLOBAL_TYPE_JLONG = 3
JMM_VMGLOBAL_TYPE_JLONG = 3,
JMM_VMGLOBAL_TYPE_JDOUBLE = 4
} jmmVMGlobalType;
typedef enum {

@ -1572,6 +1572,9 @@ bool add_global_entry(JNIEnv* env, Handle name, jmmVMGlobal *global, Flag *flag,
} else if (flag->is_uint64_t()) {
global->value.j = (jlong)flag->get_uint64_t();
global->type = JMM_VMGLOBAL_TYPE_JLONG;
} else if (flag->is_double()) {
global->value.d = (jdouble)flag->get_double();
global->type = JMM_VMGLOBAL_TYPE_JDOUBLE;
} else if (flag->is_size_t()) {
global->value.j = (jlong)flag->get_size_t();
global->type = JMM_VMGLOBAL_TYPE_JLONG;

@ -34,7 +34,7 @@
*/
public class DoubleTest {
private static final String FLAG_NAME = null;
private static final String FLAG_NAME = "CompileThresholdScaling";
private static final Double[] TESTS = {0d, -0d, -1d, 1d,
Double.MAX_VALUE, Double.MIN_VALUE, Double.NaN,
Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY};