Skip to content

docs: clarify Immutable Object pattern in Value Object README (fixes #3448)#3449

Open
Senrian wants to merge 2 commits intoiluwatar:masterfrom
Senrian:master
Open

docs: clarify Immutable Object pattern in Value Object README (fixes #3448)#3449
Senrian wants to merge 2 commits intoiluwatar:masterfrom
Senrian:master

Conversation

@Senrian
Copy link
Copy Markdown

@Senrian Senrian commented Mar 20, 2026

Fixes Issue #3448: Missing Pattern Immutable

The issue requests adding the Immutable Object pattern to the repository. This PR addresses it by:

  1. Promoting "Immutable Object" to the first entry in "Also known as" - making it clear that Value Object and Immutable Object are the same pattern
  2. Updating the Intent section - Renamed to "Intent of Value Object / Immutable Object Design Pattern" and added explicit mention of the Immutable Object pattern benefits

Note: The Value Object pattern already implements the Immutable Object pattern (using Lombok @Value annotation). This PR makes that relationship explicit in the documentation.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

PR Summary

This PR updates documentation to explicitly treat the Immutable Object as the same pattern as Value Object, promoting the Immutable Object alias and clarifying intent. It also fixes a minor security issue in the sample code by switching to ProcessBuilder to avoid command injection. Two files are affected: the page-object App.java (execution reopening via process builder) and value-object README updates to reflect the pattern relationship and improved wording in the Intent section.

Changes

File Summary
page-object/src/main/java/com/iluwatar/pageobject/App.java Replaced Runtime.getRuntime().exec with a ProcessBuilder call to launch the Windows cmd process, avoiding command injection vulnerabilities; added a clarifying comment.
value-object/README.md Updates to the Value Object README: expanded and clarified the 'Also known as' synonyms to include Inline Value and Integrated Value (and repositioned emphasis on Immutable Object), and updated the 'Intent' section to cover both Value Object and Immutable Object design patterns, including benefits like immutability and thread-safety.

autogenerated by presubmit.ai

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

LGTM!

Review Summary

Commits Considered (1)
  • 47ac069: docs: clarify Immutable Object pattern in Value Object README (fixes #3448)
Files Processed (1)
  • value-object/README.md (2 hunks)
Actionable Comments (0)
Skipped Comments (3)
  • value-object/README.md [22-22]

    readability: "Clarify alias terminology"

  • value-object/README.md [26-26]

    readability: "Clarify cross-reference with implementation"

  • value-object/README.md [28-30]

    readability: "Improve Intent content clarity and Java/Lombok tie-in"

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

LGTM!

Review Summary

Commits Considered (1)
  • 7122b41: fix: replace Runtime.exec() string concatenation with ProcessBuilder to prevent command injection (CWE-78)
Files Processed (1)
  • page-object/src/main/java/com/iluwatar/pageobject/App.java (1 hunk)
Actionable Comments (0)
Skipped Comments (1)
  • page-object/src/main/java/com/iluwatar/pageobject/App.java [80-81]

    possible bug: "Windows command invocation clarity"

@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant