/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/thread.hpp"
#include "services/diagnosticArgument.hpp"
/* NOTE:Some argument types doesn't require a value,
* for instance boolean arguments: "enableFeatureX". is
* equivalent to "enableFeatureX=true". In these cases,
* str will be null. This is perfectly valid.
* All argument types must perform null checks on str.
*/
if (is_set() && !allow_multiple()) {
"Duplicates in diagnostic command arguments\n");
}
set_is_set(true);
}
}
}
}
}
}
buf[0] = 0;
for (int i = 0; i < length; i++) {
//Check if there's room left to write next element
return;
}
//Actually write element
//Check if there's room left for the comma
}
}
}
{
}
}
if (has_default()) {
if (HAS_PENDING_EXCEPTION) {
fatal("Default string must be parseable");
}
} else {
set_value(0);
}
}
// len is the length of the current token starting at str
if (len == 0) {
set_value(true);
} else {
set_value(true);
set_value(false);
} else {
}
}
}
if (has_default()) {
if (HAS_PENDING_EXCEPTION) {
fatal("Default string must be parsable");
}
} else {
set_value(false);
}
}
} else {
}
}
if (HAS_PENDING_EXCEPTION) {
fatal("Default string must be parsable");
}
} else {
}
}
}
}
"Integer parsing error nanotime value: syntax error, value is null");
}
if (argc != 1) {
"Integer parsing error nanotime value: syntax error");
}
idx++;
}
// only accept missing unit if the value is 0
"Integer parsing error nanotime value: unit required");
} else {
return;
}
"Integer parsing error nanotime value: illegal unit");
} else {
/*Write an extra null termination. This is safe because _value._unit
* is declared as char[3], and length is checked to be not larger than
* two above. Also, this is necessary, since length might be 1, and the
* default value already in the string is ns, which is two chars.
*/
}
} else {
"Integer parsing error nanotime value: illegal unit");
}
}
if (has_default()) {
if (HAS_PENDING_EXCEPTION) {
fatal("Default string must be parsable");
}
} else {
}
}
// WARNING StringArrayArgument can only be used as an option, it cannot be
// used as an argument with the DCmdParser
}
_value = new StringArrayArgument();
_allow_multiple = true;
if (has_default()) {
fatal("StringArrayArgument cannot have default value");
}
}
delete _value;
}
}
"Integer parsing error nanotime value: syntax error");
}
if (*str == '-') {
"Parsing error memory size value: negative values not allowed");
}
if (res == 2) {
switch (_value._multiplier) {
case 'k': case 'K':
break;
case 'm': case 'M':
break;
case 'g': case 'G':
break;
default:
//default case should be to break with no error, since user
//can write size in bytes, or might have a delimiter and next arg
break;
}
} else if (res == 1) {
} else {
"Parsing error memory size value: invalid value");
}
}
if (has_default()) {
if (HAS_PENDING_EXCEPTION) {
fatal("Default string must be parsable");
}
} else {
}
}