Skip to content

Commit

Permalink
[Backport] 8234059: Stress test fails with "Unexpected Exception in t…
Browse files Browse the repository at this point in the history
…hread JFR Event Stream"

Summary:

Test Plan: jdk/jfr

Reviewed-by: yuleil

Issue: dragonwell-project/dragonwell8#112
  • Loading branch information
D-D-H committed Jul 31, 2020
1 parent 986e181 commit d4a636f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/share/classes/jdk/jfr/internal/consumer/ConstantMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -90,14 +94,14 @@ Object get(long id) {
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)
Expand Down

0 comments on commit d4a636f

Please sign in to comment.