Skip to content

Commit 3cfad01

Browse files
jbachorikclaude
andcommitted
Fix DecoratedEventMap to handle split $decorator path navigation
Values.get() splits "$decorator.field" into ["$decorator", "field"] segments, but DecoratedEventMap.get() only matched the "$decorator." prefix. Return the first decorator map for the bare "$decorator" key. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 27e4d12 commit 3cfad01

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

jfr-shell-core/src/main/java/io/jafar/shell/jfrpath/JfrPathEvaluator.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,6 +2459,12 @@ private static class DecoratedEventMap extends java.util.AbstractMap<String, Obj
24592459
public Object get(Object key) {
24602460
String keyStr = String.valueOf(key);
24612461

2462+
// Handle bare "$decorator" key (from path navigation: "$decorator" / "field")
2463+
if ("$decorator".equals(keyStr)) {
2464+
if (decorators.isEmpty()) return null;
2465+
return decorators.get(0);
2466+
}
2467+
24622468
// Check if accessing decorator field
24632469
if (keyStr.startsWith(DECORATOR_PREFIX)) {
24642470
String decoratorField = keyStr.substring(DECORATOR_PREFIX.length());

0 commit comments

Comments
 (0)