Skip to content

Commit

Permalink
7473: Unable to view constants in constant pool page.
Browse files Browse the repository at this point in the history
Reviewed-by: jpbempel, hirt
  • Loading branch information
aptmac committed Jan 12, 2022
1 parent b6bf40f commit dbb3e76
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, Datadog, Inc. All rights reserved.
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2022, Datadog, Inc. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -290,10 +290,14 @@ public <M> IMemberAccessor<M, IItem> getAccessor(IAccessorKey<M> attribute) {
}
if ("constant".equals(attribute.getIdentifier())) {
if (constant instanceof IMCStackTrace) {
IMCFrame imcFrame = ((IMCStackTrace) constant).getFrames().get(0);
String str = StacktraceFormatToolkit.formatFrame(imcFrame,
new FrameSeparator(FrameCategorization.METHOD, false));
return ((IMemberAccessor<M, IItem>) MemberAccessorToolkit.<IItem, Object, Object> constant(str));
IMCStackTrace stackTrace = ((IMCStackTrace) constant);
if (!stackTrace.getFrames().isEmpty()) {
IMCFrame imcFrame = (stackTrace).getFrames().get(0);
String str = StacktraceFormatToolkit.formatFrame(imcFrame,
new FrameSeparator(FrameCategorization.METHOD, false));
return ((IMemberAccessor<M, IItem>) MemberAccessorToolkit
.<IItem, Object, Object> constant(str));
}
}
return ((IMemberAccessor<M, IItem>) MemberAccessorToolkit.<IItem, Object, Object> constant(constant));
}
Expand Down

0 comments on commit dbb3e76

Please sign in to comment.