comparison src/share/vm/graal/graalRuntime.cpp @ 16274:60c3f610183e

separate error messages for missing versus invalid non-String option values
author Doug Simon <doug.simon@oracle.com>
date Fri, 27 Jun 2014 22:58:54 +0200
parents d6ffc6164830
children 7af7db0bbfe9
comparison
equal deleted inserted replaced
16273:d6ffc6164830 16274:60c3f610183e
866 default: 866 default:
867 ShouldNotReachHere(); 867 ShouldNotReachHere();
868 } 868 }
869 ResourceMark rm(THREAD); 869 ResourceMark rm(THREAD);
870 char buf[200]; 870 char buf[200];
871 jio_snprintf(buf, sizeof(buf), "Invalid %s value for Graal option %.*s: %s", (spec == 'i' ? "numeric" : "float/double"), name, name_len, value); 871 bool missing = strlen(value) == 0;
872 if (missing) {
873 jio_snprintf(buf, sizeof(buf), "Missing %s value for Graal option %.*s", (spec == 'i' ? "numeric" : "float/double"), name_len, name);
874 } else {
875 jio_snprintf(buf, sizeof(buf), "Invalid %s value for Graal option %.*s: %s", (spec == 'i' ? "numeric" : "float/double"), name_len, name, value);
876 }
872 THROW_MSG_(vmSymbols::java_lang_InternalError(), buf, 0L); 877 THROW_MSG_(vmSymbols::java_lang_InternalError(), buf, 0L);
873 } 878 }
874 879
875 void GraalRuntime::set_option_helper(KlassHandle hotSpotOptionsClass, char* name, int name_len, Handle option, jchar spec, Handle stringValue, jlong primitiveValue) { 880 void GraalRuntime::set_option_helper(KlassHandle hotSpotOptionsClass, char* name, int name_len, Handle option, jchar spec, Handle stringValue, jlong primitiveValue) {
876 Thread* THREAD = Thread::current(); 881 Thread* THREAD = Thread::current();