comparison src/share/vm/runtime/arguments.cpp @ 3250:9c4f56ff88e9

7034133: cleanup obsolete option handling Reviewed-by: ysr, johnc, poonam
author jcoomes
date Thu, 07 Apr 2011 16:52:15 -0700
parents 924777755fad
children eda9eb483d29
comparison
equal deleted inserted replaced
3249:e1162778c1c8 3250:9c4f56ff88e9
797 bool Arguments::process_argument(const char* arg, 797 bool Arguments::process_argument(const char* arg,
798 jboolean ignore_unrecognized, FlagValueOrigin origin) { 798 jboolean ignore_unrecognized, FlagValueOrigin origin) {
799 799
800 JDK_Version since = JDK_Version(); 800 JDK_Version since = JDK_Version();
801 801
802 if (parse_argument(arg, origin)) { 802 if (parse_argument(arg, origin) || ignore_unrecognized) {
803 // do nothing 803 return true;
804 } else if (is_newly_obsolete(arg, &since)) { 804 }
805 enum { bufsize = 256 }; 805
806 char buffer[bufsize]; 806 const char * const argname = *arg == '+' || *arg == '-' ? arg + 1 : arg;
807 since.to_string(buffer, bufsize); 807 if (is_newly_obsolete(arg, &since)) {
808 jio_fprintf(defaultStream::error_stream(), 808 char version[256];
809 "Warning: The flag %s has been EOL'd as of %s and will" 809 since.to_string(version, sizeof(version));
810 " be ignored\n", arg, buffer); 810 warning("ignoring option %s; support was removed in %s", argname, version);
811 } else { 811 return true;
812 if (!ignore_unrecognized) { 812 }
813 jio_fprintf(defaultStream::error_stream(), 813
814 "Unrecognized VM option '%s'\n", arg); 814 jio_fprintf(defaultStream::error_stream(),
815 // allow for commandline "commenting out" options like -XX:#+Verbose 815 "Unrecognized VM option '%s'\n", argname);
816 if (strlen(arg) == 0 || arg[0] != '#') { 816 // allow for commandline "commenting out" options like -XX:#+Verbose
817 return false; 817 return arg[0] == '#';
818 }
819 }
820 }
821 return true;
822 } 818 }
823 819
824 bool Arguments::process_settings_file(const char* file_name, bool should_exist, jboolean ignore_unrecognized) { 820 bool Arguments::process_settings_file(const char* file_name, bool should_exist, jboolean ignore_unrecognized) {
825 FILE* stream = fopen(file_name, "rb"); 821 FILE* stream = fopen(file_name, "rb");
826 if (stream == NULL) { 822 if (stream == NULL) {