Skip to content

Fix Switch toString to LexicalPreservingPrinter when configured#4712

Merged
jlerbsc merged 3 commits intojavaparser:masterfrom
jlerbsc:master
Apr 4, 2025
Merged

Fix Switch toString to LexicalPreservingPrinter when configured#4712
jlerbsc merged 3 commits intojavaparser:masterfrom
jlerbsc:master

Conversation

@jlerbsc
Copy link
Copy Markdown
Collaborator

@jlerbsc jlerbsc commented Apr 4, 2025

Fixes #1821 .

Make the LPP the default printer when configured with parserConfiguration.setLexicalPreservationEnabled(true).

The previous method of using the LexicalPreservingPrinter remains operational to activate the lexical preservation printer while keeping the default pretty printer.

THIS IS A BREAKING CHANGE ON LEXICAL PRESERVING PRINTER USAGE.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2025

Codecov Report

Attention: Patch coverage is 86.66667% with 4 lines in your changes missing coverage. Please review.

Project coverage is 58.205%. Comparing base (0f532cf) to head (c435ae2).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
.../src/main/java/com/github/javaparser/ast/Node.java 81.250% 1 Missing and 2 partials ⚠️
...ava/com/github/javaparser/ast/CompilationUnit.java 66.666% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##              master     #4712       +/-   ##
===============================================
+ Coverage     58.200%   58.205%   +0.004%     
  Complexity      2499      2499               
===============================================
  Files            670       671        +1     
  Lines          38721     38735       +14     
  Branches        7023      7028        +5     
===============================================
+ Hits           22536     22546       +10     
- Misses         13294     13295        +1     
- Partials        2891      2894        +3     
Flag Coverage Δ
AlsoSlowTests 58.205% <86.666%> (+0.004%) ⬆️
javaparser-core 58.205% <86.666%> (+0.004%) ⬆️
javaparser-symbol-solver 58.205% <86.666%> (+0.004%) ⬆️
jdk-10 57.756% <86.666%> (+0.004%) ⬆️
jdk-11 57.756% <86.666%> (+0.004%) ⬆️
jdk-12 57.756% <86.666%> (+0.004%) ⬆️
jdk-13 57.756% <86.666%> (+0.004%) ⬆️
jdk-14 58.004% <86.666%> (+0.004%) ⬆️
jdk-15 58.004% <86.666%> (+0.004%) ⬆️
jdk-16 57.978% <86.666%> (+0.004%) ⬆️
jdk-17 58.133% <86.666%> (+0.004%) ⬆️
jdk-18 58.133% <86.666%> (+0.004%) ⬆️
jdk-8 57.757% <86.666%> (+0.004%) ⬆️
jdk-9 57.753% <86.666%> (+0.004%) ⬆️
macos-latest 58.198% <86.666%> (+0.004%) ⬆️
ubuntu-latest 58.192% <86.666%> (+0.004%) ⬆️
windows-latest 58.187% <86.666%> (+0.004%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ava/com/github/javaparser/ParserConfiguration.java 87.074% <100.000%> (+0.269%) ⬆️
...ithub/javaparser/printer/DefaultPrettyPrinter.java 100.000% <ø> (ø)
...a/com/github/javaparser/printer/PrettyPrinter.java 56.250% <ø> (ø)
...lpreservation/DefaultLexicalPreservingPrinter.java 100.000% <100.000%> (ø)
.../lexicalpreservation/LexicalPreservingPrinter.java 79.652% <100.000%> (-0.101%) ⬇️
...ava/com/github/javaparser/ast/CompilationUnit.java 74.524% <66.666%> (-0.188%) ⬇️
.../src/main/java/com/github/javaparser/ast/Node.java 81.313% <81.250%> (-0.482%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83bc787...c435ae2. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jlerbsc jlerbsc merged commit 5f46619 into javaparser:master Apr 4, 2025
34 of 35 checks passed
@jlerbsc jlerbsc added this to the next release milestone Apr 4, 2025
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.

Switch toString to LexicalPreservingPrinter when configured

1 participant