diff --git a/src/share/classes/jdk/jfr/internal/consumer/ConstantMap.java b/src/share/classes/jdk/jfr/internal/consumer/ConstantMap.java index c45b80574746f2b2240dd26c158afa702314d41e..cd5415f44d7b71ff97ef11aa2c8030dd9971f3b2 100644 --- a/src/share/classes/jdk/jfr/internal/consumer/ConstantMap.java +++ b/src/share/classes/jdk/jfr/internal/consumer/ConstantMap.java @@ -25,6 +25,10 @@ package jdk.jfr.internal.consumer; +import jdk.jfr.internal.LogLevel; +import jdk.jfr.internal.LogTag; +import jdk.jfr.internal.Logger; + import jdk.jfr.internal.LongMap; /** @@ -90,14 +94,14 @@ final class ConstantMap { return new Reference(this, id); } - // should always have a value + // should ideally always have a value Object value = objects.get(id); if (value == null) { - // unless is 0 which is used to represent null - if (id == 0) { - return null; + // unless id is 0 which is used to represent null + if (id != 0) { + Logger.log(LogTag.JFR_SYSTEM_PARSER, LogLevel.INFO, "Missing object id=" + id + " in pool " + name + ". All ids should reference an object"); } - throw new InternalError("Missing object id=" + id + " in pool " + name + ". All ids should reference object"); + return null; } // id is resolved (but not the whole pool)