mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-01 03:30:34 +00:00
8240532: heap inspection prints trailing @ after name of module without version
Reviewed-by: lfoltan
This commit is contained in:
parent
43e0fc04b0
commit
534331f0a1
@ -101,11 +101,12 @@ void KlassInfoEntry::print_on(outputStream* st) const {
|
||||
// simplify the formatting (ILP32 vs LP64) - always cast the numbers to 64-bit
|
||||
ModuleEntry* module = _klass->module();
|
||||
if (module->is_named()) {
|
||||
st->print_cr(INT64_FORMAT_W(13) " " UINT64_FORMAT_W(13) " %s (%s@%s)",
|
||||
st->print_cr(INT64_FORMAT_W(13) " " UINT64_FORMAT_W(13) " %s (%s%s%s)",
|
||||
(int64_t)_instance_count,
|
||||
(uint64_t)_instance_words * HeapWordSize,
|
||||
name(),
|
||||
module->name()->as_C_string(),
|
||||
module->version() != NULL ? "@" : "",
|
||||
module->version() != NULL ? module->version()->as_C_string() : "");
|
||||
} else {
|
||||
st->print_cr(INT64_FORMAT_W(13) " " UINT64_FORMAT_W(13) " %s",
|
||||
|
||||
@ -67,14 +67,16 @@ public class ClassHistogramTest {
|
||||
* ...
|
||||
*/
|
||||
|
||||
String moduleRegex = "\\(java.base(?:@\\S*)?\\)";
|
||||
|
||||
/* Require at least one java.lang.Class */
|
||||
output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.Class \\(java.base@\\S*\\)\\s*$");
|
||||
output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.Class " + moduleRegex + "\\s*$");
|
||||
|
||||
/* Require at least one java.lang.String */
|
||||
output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.String \\(java.base@\\S*\\)\\s*$");
|
||||
output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.String " + moduleRegex + "\\s*$");
|
||||
|
||||
/* Require at least one java.lang.Object */
|
||||
output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.Object \\(java.base@\\S*\\)\\s*$");
|
||||
output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.Object " + moduleRegex + "\\s*$");
|
||||
|
||||
/* Require at exactly one TestClass[] */
|
||||
output.shouldMatch("^\\s+\\d+:\\s+1\\s+\\d+\\s+" +
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user