changeset 50505:50469fb301c4

8204563: UseAppCDS obsolete message confusing Reviewed-by: jiangli, mseledtsov, dholmes
author ccheung
date Mon, 11 Jun 2018 09:40:20 -0700
parents 6dfe5ae92fa8
children 54fcaffa8fac
files src/hotspot/share/runtime/arguments.cpp test/hotspot/jtreg/runtime/appcds/CommandLineFlagComboNegative.java
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/runtime/arguments.cpp	Fri Jun 08 14:14:44 2018 +0200
+++ b/src/hotspot/share/runtime/arguments.cpp	Mon Jun 11 09:40:20 2018 -0700
@@ -1266,9 +1266,13 @@
     char stripped_argname[BUFLEN+1]; // +1 for '\0'
     jio_snprintf(stripped_argname, arg_len+1, "%s", argname); // +1 for '\0'
     if (is_obsolete_flag(stripped_argname, &since)) {
-      char version[256];
-      since.to_string(version, sizeof(version));
-      warning("Ignoring option %s; support was removed in %s", stripped_argname, version);
+      if (strcmp(stripped_argname, "UseAppCDS") != 0) {
+        char version[256];
+        since.to_string(version, sizeof(version));
+        warning("Ignoring option %s; support was removed in %s", stripped_argname, version);
+      } else {
+        warning("Ignoring obsolete option UseAppCDS; AppCDS is automatically enabled");
+      }
       return true;
     }
 #ifndef PRODUCT
--- a/test/hotspot/jtreg/runtime/appcds/CommandLineFlagComboNegative.java	Fri Jun 08 14:14:44 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/CommandLineFlagComboNegative.java	Mon Jun 11 09:40:20 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -71,6 +71,8 @@
                 "Class data sharing is inconsistent with other specified options", 1) );
             testTable.add( new TestVector("-XX:+UseCompressedClassPointers", "-XX:-UseCompressedClassPointers",
                 "Class data sharing is inconsistent with other specified options", 1) );
+            testTable.add( new TestVector("-XX:-UseAppCDS", "-XX:+UseAppCDS",
+                "Ignoring obsolete option UseAppCDS; AppCDS is automatically enabled", 0) );
         }
     }