Skip to content

Polish: README accuracy, Point value semantics, dead-code removal - #11

Merged
progys merged 1 commit into
masterfrom
polish-readme-point-value-semantics
Aug 16, 2026
Merged

progys merged 1 commit into
masterfrom
polish-readme-point-value-semantics

Conversation

@progys

@progys progys commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Changes

  • README example output drift fixed: the Example session block and the inline shape example now match the real program output (capital Shape, => prefix on point-query lines, actual triangle/donut toString formats, corrected area precision).
  • Point gains value semantics (equals/hashCode via Double.compare / Objects.hash) — a pure value type that now behaves correctly in collections, sets, and mock matchers.
  • Dead code removed: the default branch in ShapeEntity(Shape) is unreachable now that Shape is sealed (only Circle/Triangle/Donut plus null); the toShape() string-based default is kept as a DB safety net.
  • New PointTest (5 assertions: equality, inequality, hashCode consistency, reflexivity, null).

Verification

  • 63/63 tests green (mvn clean test).

… remove dead branch

- README: fix Example session output (capital Shape, => prefix on point-query
  lines, triangle/donut toString formats, corrected area precision) to match
  actual program output.
- Point: add equals/hashCode/value semantics for correct behavior in
  collections and mocks.
- ShapeEntity: remove unreachable default branch in the constructor switch
  (sealed Shape makes it dead code); keep the toShape default as a DB
  safety check.
@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@progys
progys merged commit 922357f into master Aug 16, 2026
4 checks passed
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