8195107: CDS broken due to 8194741
authoreosterlund
Mon, 15 Jan 2018 15:18:27 +0100
changeset 48785 4d1970962ee9
parent 48784 899b522ed65c
child 48786 cc231bd80c8b
8195107: CDS broken due to 8194741 Reviewed-by: coleenp
src/hotspot/share/oops/constantPool.cpp
--- a/src/hotspot/share/oops/constantPool.cpp	Wed Jan 10 22:43:42 2018 +0100
+++ b/src/hotspot/share/oops/constantPool.cpp	Mon Jan 15 15:18:27 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -327,13 +327,12 @@
   if (SystemDictionary::Object_klass_loaded()) {
     ClassLoaderData* loader_data = pool_holder()->class_loader_data();
 #if INCLUDE_CDS_JAVA_HEAP
-    if (MetaspaceShared::open_archive_heap_region_mapped()) {
+    if (MetaspaceShared::open_archive_heap_region_mapped() &&
+        _cache->archived_references() != NULL) {
       oop archived = _cache->archived_references();
-      if (archived != NULL) {
-        // Create handle for the archived resolved reference array object
-        Handle refs_handle(THREAD, archived);
-        set_resolved_references(loader_data->add_handle(refs_handle));
-      }
+      // Create handle for the archived resolved reference array object
+      Handle refs_handle(THREAD, archived);
+      set_resolved_references(loader_data->add_handle(refs_handle));
     } else
 #endif
     {