Skip to content

Refactor CDL row serialization for readability#1062

Open
Fahmida-Hossain-Charu wants to merge 2 commits into
stleary:masterfrom
Fahmida-Hossain-Charu:pr/refactor-cdl-row-serialization
Open

Refactor CDL row serialization for readability#1062
Fahmida-Hossain-Charu wants to merge 2 commits into
stleary:masterfrom
Fahmida-Hossain-Charu:pr/refactor-cdl-row-serialization

Conversation

@Fahmida-Hossain-Charu

Copy link
Copy Markdown

Summary

This PR refactors CDL.rowToString(JSONArray, char) to improve readability while preserving existing behavior.

Changes

  • Extracted row value appending into a private helper method.
  • Extracted quote-decision logic into a private helper method.
  • Extracted quoted value writing into a private helper method.
  • Kept the change localized to CDL.

Compatibility

  • No public API changes.
  • No dependency changes.
  • No behavior changes intended.
  • No new Java language features introduced.

Validation

Ran the full test suite successfully:

mvn test

Risk

The change is limited to private helper extraction and preserves the existing row serialization logic.

Comment thread src/main/java/org/json/CDL.java
Comment thread src/main/java/org/json/CDL.java Outdated
Comment thread src/main/java/org/json/CDL.java Outdated
@sonarqubecloud

Copy link
Copy Markdown

@stleary

stleary commented Jun 17, 2026

Copy link
Copy Markdown
Owner

What problem does this code solve?
Refactors CDL.rowToString() for readability

Does the code still compile with Java6?
Yes

Risks
Low

Changes to the API?
No

Will this require a new release?
No

Should the documentation be updated?
No

Does it break the unit tests?
No. No unit tests were added because coverage was already sufficient.

Was any code refactored in this commit?
This PR was a refactor

Review status
APPROVED

Starting 3-day comment window

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants