1 /* |
1 /* |
2 * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2011, 2013 Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
84 } |
84 } |
85 } |
85 } |
86 |
86 |
87 template <> void DCmdArgument<jlong>::parse_value(const char* str, |
87 template <> void DCmdArgument<jlong>::parse_value(const char* str, |
88 size_t len, TRAPS) { |
88 size_t len, TRAPS) { |
89 if (str == NULL || sscanf(str, INT64_FORMAT, &_value) != 1) { |
89 if (str == NULL || sscanf(str, JLONG_FORMAT, &_value) != 1) { |
90 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), |
90 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), |
91 "Integer parsing error in diagnostic command arguments\n"); |
91 "Integer parsing error in diagnostic command arguments\n"); |
92 } |
92 } |
93 } |
93 } |
94 |
94 |
169 if (str == NULL) { |
169 if (str == NULL) { |
170 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), |
170 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), |
171 "Integer parsing error nanotime value: syntax error"); |
171 "Integer parsing error nanotime value: syntax error"); |
172 } |
172 } |
173 |
173 |
174 int argc = sscanf(str, INT64_FORMAT , &_value._time); |
174 int argc = sscanf(str, JLONG_FORMAT, &_value._time); |
175 if (argc != 1) { |
175 if (argc != 1) { |
176 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), |
176 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), |
177 "Integer parsing error nanotime value: syntax error"); |
177 "Integer parsing error nanotime value: syntax error"); |
178 } |
178 } |
179 size_t idx = 0; |
179 size_t idx = 0; |