diff src/hotspot/share/oops/metadata.cpp @ 51314:82adcc8ad853

8208604: Metadata::print_value_string() compares 'this' to NULL Summary: Remove the comparison and add asserts to check for NULL Reviewed-by: coleenp, gziemski
author hseigel
date Mon, 06 Aug 2018 14:20:58 -0400
parents 71c04702a3d5
children 33fe50b6d707
line wrap: on
line diff
--- a/src/hotspot/share/oops/metadata.cpp	Mon Aug 06 13:57:26 2018 -0400
+++ b/src/hotspot/share/oops/metadata.cpp	Mon Aug 06 14:20:58 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -44,10 +44,6 @@
 char* Metadata::print_value_string() const {
   char buf[256];
   stringStream st(buf, sizeof(buf));
-  if (this == NULL) {
-    st.print("NULL");
-  } else {
-    print_value_on(&st);
-  }
+  print_value_on(&st);
   return st.as_string();
 }