@@ -223,23 +223,31 @@ protected void reportErrors() {
223223
224224 static void reportError (String rawErrorMessage ) {
225225 String value = System .getenv ("JVMCI_CONFIG_CHECK" );
226- Formatter errorMessage = new Formatter ().format (rawErrorMessage );
227- String javaHome = getProperty ("java.home" );
228- String vmName = getProperty ("java.vm.name" );
229- errorMessage .format ("%nSet the JVMCI_CONFIG_CHECK environment variable to \" ignore\" to suppress " );
230- errorMessage .format ("this error or to \" warn\" to emit a warning and continue execution.%n" );
231- errorMessage .format ("Currently used Java home directory is %s.%n" , javaHome );
232- errorMessage .format ("Currently used VM configuration is: %s%n" , vmName );
226+ if (!JVMCI && value == null ) {
227+ // We cannot control when VM config updates are made in non-JVMCI
228+ // JDKs so disable this check by default.
229+ value = "ignore" ;
230+ }
233231 if ("ignore" .equals (value )) {
234232 return ;
235- } else if ("warn" .equals (value ) || JDK_PRERELEASE ) {
236- System .err .println (errorMessage .toString ());
237- } else if (!JVMCI && Assertions .assertionsEnabled ()) {
238- // We cannot control when VM config updates are made in non JVMCI JDKs so
239- // only issue a warning and only when assertions are enabled.
240- System .err .println (errorMessage .toString ());
241- } else if (JVMCI ) {
242- throw new JVMCIError (errorMessage .toString ());
233+ }
234+ boolean warn = "warn" .equals (value ) || JDK_PRERELEASE ;
235+ Formatter message = new Formatter ().format (rawErrorMessage );
236+ String javaHome = getProperty ("java.home" );
237+ String vmName = getProperty ("java.vm.name" );
238+ if (warn ) {
239+ message .format ("%nSet the JVMCI_CONFIG_CHECK environment variable to \" ignore\" to suppress " );
240+ message .format ("this warning and continue execution.%n" );
241+ } else {
242+ message .format ("%nSet the JVMCI_CONFIG_CHECK environment variable to \" ignore\" to suppress " );
243+ message .format ("this error or to \" warn\" to emit a warning and continue execution.%n" );
244+ }
245+ message .format ("Currently used Java home directory is %s.%n" , javaHome );
246+ message .format ("Currently used VM configuration is: %s%n" , vmName );
247+ if (warn ) {
248+ System .err .println (message .toString ());
249+ } else {
250+ throw new JVMCIError (message .toString ());
243251 }
244252 }
245253
0 commit comments