hotspot/src/share/vm/classfile/stringTable.cpp
changeset 36187 1d61b06a3ae1
parent 35898 ddc274f0052f
child 37172 ff4d69314a4c
--- a/hotspot/src/share/vm/classfile/stringTable.cpp	Thu Feb 18 17:10:48 2016 -0500
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp	Wed Feb 17 18:02:03 2016 -0500
@@ -200,7 +200,6 @@
   return string;
 }
 
-
 oop StringTable::intern(Handle string_or_null, jchar* name,
                         int len, TRAPS) {
   oop found_string = lookup_shared(name, len);
@@ -214,7 +213,9 @@
 
   // Found
   if (found_string != NULL) {
-    ensure_string_alive(found_string);
+    if (found_string != string_or_null()) {
+      ensure_string_alive(found_string);
+    }
     return found_string;
   }
 
@@ -249,7 +250,9 @@
                                   hashValue, CHECK_NULL);
   }
 
-  ensure_string_alive(added_or_found);
+  if (added_or_found != string()) {
+    ensure_string_alive(added_or_found);
+  }
 
   return added_or_found;
 }