In SText.updateMeasuredBounds(), the call getBounds().setSize(...) mutates a copy of the bounds rectangle (since getBounds() returns a defensive copy) and discards the result. This means resized dimensions are silently lost.
Impact: Cloning an SText that has been resized will produce a clone with default dimensions instead of the resized ones.
Found during: Review of PR #15 (ShapeContractTest). The contract test passes only because the factory creates SText with default bounds.
Expected fix:updateMeasuredBounds() should mutate the internal bounds field directly rather than calling getBounds().
In `SText.updateMeasuredBounds()`, the call `getBounds().setSize(...)` mutates a **copy** of the bounds rectangle (since `getBounds()` returns a defensive copy) and discards the result. This means resized dimensions are silently lost.
**Impact:** Cloning an `SText` that has been resized will produce a clone with default dimensions instead of the resized ones.
**Found during:** Review of PR #15 (ShapeContractTest). The contract test passes only because the factory creates `SText` with default bounds.
**Expected fix:** `updateMeasuredBounds()` should mutate the internal `bounds` field directly rather than calling `getBounds()`.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
In
SText.updateMeasuredBounds(), the callgetBounds().setSize(...)mutates a copy of the bounds rectangle (sincegetBounds()returns a defensive copy) and discards the result. This means resized dimensions are silently lost.Impact: Cloning an
STextthat has been resized will produce a clone with default dimensions instead of the resized ones.Found during: Review of PR #15 (ShapeContractTest). The contract test passes only because the factory creates
STextwith default bounds.Expected fix:
updateMeasuredBounds()should mutate the internalboundsfield directly rather than callinggetBounds().