Skip to content
This repository was archived by the owner on May 9, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2759,8 +2759,7 @@ private JCExpression mapEntry(int pos) {
String key = token.stringVal();
accept(STRINGLITERAL);
accept(COLON);
String value = token.stringVal();
accept(STRINGLITERAL);
JCExpression value = parseExpression();
return F.at(pos).StringMapEntry(key, value);
} else {
return illegal(pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,12 @@ public JCExpression NewMap(List<JCExpression> entries) {
return invocation;
}

public JCExpression StringMapEntry(String key, String value) {
public JCExpression StringMapEntry(String key, JCExpression value) {
JCFieldAccess util = new JCFieldAccess(Ident(names.fromString("java")), names.fromString("util"), null);
JCFieldAccess map = new JCFieldAccess(util, names.fromString("Map"), null);
JCFieldAccess entry = new JCFieldAccess(map, names.fromString("entry"), null);

JCMethodInvocation invocation = new JCMethodInvocation(List.nil(), entry, List.of(Literal(key), Literal(value)));
JCMethodInvocation invocation = new JCMethodInvocation(List.nil(), entry, List.of(Literal(key), value));
invocation.pos = pos;

return invocation;
Expand Down