Skip to content

Conversation

@jdconrad
Copy link
Contributor

@jdconrad jdconrad commented Apr 9, 2025

This change prevents a delegate map from giving an inconsistent toString or an empty toString.

Closes #70262

@jdconrad jdconrad added >bug :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache v9.1.0 labels Apr 9, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Apr 9, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @jdconrad, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

int count = 0;
for (Map.Entry<String, Object> entry : entrySet()) {
sb.append(entry.getKey());
sb.append(": ");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should the same format as other Map's (eg HashMap, Map.of, etc) in Java use, which I believe is with curly braces and = between key/values. Also I wonder if we need the DynamicMap prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed to match AbstractMap

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jdconrad jdconrad merged commit 8563235 into elastic:main Apr 11, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache Team:Core/Infra Meta label for core/infra team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add useful toString() to Scripting's DynamicMap

3 participants