changeset 48785:4d1970962ee9

8195107: CDS broken due to 8194741 Reviewed-by: coleenp
author eosterlund
date Mon, 15 Jan 2018 15:18:27 +0100
parents 899b522ed65c
children cc231bd80c8b
files src/hotspot/share/oops/constantPool.cpp
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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
     {