comparison 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
comparison
equal deleted inserted replaced
0:44c622bc787f 1:4f2c8c518f17
1 /* 1 /*
2 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
42 } 42 }
43 43
44 char* Metadata::print_value_string() const { 44 char* Metadata::print_value_string() const {
45 char buf[256]; 45 char buf[256];
46 stringStream st(buf, sizeof(buf)); 46 stringStream st(buf, sizeof(buf));
47 if (this == NULL) { 47 print_value_on(&st);
48 st.print("NULL");
49 } else {
50 print_value_on(&st);
51 }
52 return st.as_string(); 48 return st.as_string();
53 } 49 }