Skip to content

Commit

Permalink
8280743: HSDB "Monitor Cache Dump" command might throw NPE
Browse files Browse the repository at this point in the history
Reviewed-by: kevinw, sspitsyn
  • Loading branch information
plummercj committed Aug 23, 2023
1 parent 9435cd1 commit 2c60cad
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, 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
Expand Down Expand Up @@ -67,8 +67,12 @@ private static void dumpMonitor(PrintStream tty, ObjectMonitor mon, boolean raw)
tty.println();
tty.println(" _header: 0x" + Long.toHexString(mon.header().value()));
OopHandle obj = mon.object();
Oop oop = heap.newOop(obj);
tty.println(" _object: " + obj + ", a " + oop.getKlass().getName().asString());
if (obj == null) {
tty.println(" _object: null");
} else {
Oop oop = heap.newOop(obj);
tty.println(" _object: " + obj + ", a " + oop.getKlass().getName().asString());
}
Address owner = mon.owner();
tty.println(" _owner: " + owner);
if (!raw && owner != null) {
Expand Down

1 comment on commit 2c60cad

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.