Skip to content

GROOVY-12153: Fix AstNodeToScriptAdapter decompiler rendering fidelit…#2696

Merged
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12153
Jul 12, 2026
Merged

GROOVY-12153: Fix AstNodeToScriptAdapter decompiler rendering fidelit…#2696
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12153

Conversation

@paulk-asert

Copy link
Copy Markdown
Contributor

…y for strings

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.38776% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.1044%. Comparing base (c9363db) to head (e14af7c).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...vy/groovy/console/ui/AstNodeToScriptAdapter.groovy 69.3878% 2 Missing and 13 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2696        +/-   ##
==================================================
- Coverage     69.1083%   69.1044%   -0.0039%     
+ Complexity      34235      34234         -1     
==================================================
  Files            1537       1537                
  Lines          129310     129355        +45     
  Branches        23478      23502        +24     
==================================================
+ Hits            89364      89390        +26     
- Misses          31936      31942         +6     
- Partials         8010       8023        +13     
Files with missing lines Coverage Δ
...vy/groovy/console/ui/AstNodeToScriptAdapter.groovy 70.5718% <69.3878%> (-0.2615%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@testlens-app

testlens-app Bot commented Jul 12, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: e14af7c
▶️ Tests: 103692 executed
⚪️ Checks: 31/31 completed


Learn more about TestLens at testlens.app.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves AstNodeToScriptAdapter’s “decompiler” output so reconstructed source is parseable and round-trips string/GString values more faithfully, addressing GROOVY-12153’s string rendering issues in the Groovy Console AST-to-script view.

Changes:

  • Replace naive string literal escaping with a dedicated single-quoted escaping routine that handles backslashes, quotes, and control characters.
  • Rework GString rendering to rebuild from GStringExpression segments/values, properly escaping text segments and emitting safer interpolation forms.
  • Add/expand tests to validate string escaping and GString round-tripping, plus update an existing regex assertion expectation to match the corrected escaping.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstNodeToScriptAdapter.groovy Fix string and GString rendering by adding correct escaping and reconstructing GStrings from parts instead of decoded text.
subprojects/groovy-console/src/test/groovy/groovy/console/ui/AstNodeToScriptAdapterTest.groovy Add regression tests for string escaping and GString evaluation round-trips; update regex escaping expectation.

@paulk-asert paulk-asert merged commit 97d68bb into apache:master Jul 12, 2026
32 checks passed
@paulk-asert paulk-asert deleted the groovy12153 branch July 12, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants