Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.5.14
-
None
-
None
Description
I have a class
class JsonListAdapter implements List { private final List<Object> adaptee; private final JsonNode node; public JsonListAdapter(List<Object> adaptee, JsonNode node) { this.adaptee = adaptee; this.node = node; } // methods here @Override public String toString() { return node.toString(); } }
I'm expecting that it will work like
var json = "[\"v1\",\"v2\"]"; var node = parseJson(json); var list = toList(node); var result = gStringTemplateService.render("${variable}", Map.of("variable", new JsonListAdapter(list, node))); // both assertions fail for now Assertions.assertNotEquals("[v1, v2]", result); Assertions.assertEquals(json, result);
Attachments
Issue Links
- relates to
-
GROOVY-2599 unable to overwrite toString() via MOP in some cases
- Open