Skip to content

Conversation

@HeikoKlare
Copy link
Contributor

@HeikoKlare HeikoKlare commented Nov 3, 2025

When initializing a Point.OfFloat with integer values, the rounding mode is currently set to null. This can lead to NPEs when cloning such points, as clone() uses the rounding mode to initialize a new instance, which expects the rounding mode to not be null. Setting values on the point with setX() and setY() will fail likewise.

This change ensures that the rounding mode will never be initialized
with null.

When initializing a Point.OfFloat with integer values, the rounding mode
is currently set to null. This can lead to NPEs when cloning such
points, as clone() uses the rounding mode to initialize a new instance,
which expects the rounding mode to not be null. Setting values on the
point with setX() and setY() will fail likewise.

This change ensures that the rounding mode will never be initialized
with null.
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

Test Results

  118 files  ±0    118 suites  ±0   16m 58s ⏱️ + 1m 34s
4 651 tests +1  4 634 ✅ +1  17 💤 ±0  0 ❌ ±0 
  330 runs  ±0    326 ✅ ±0   4 💤 ±0  0 ❌ ±0 

Results for commit 9d0405c. ± Comparison against base commit ce03c39.

@akoch-yatta akoch-yatta linked an issue Nov 3, 2025 that may be closed by this pull request
Copy link
Contributor

@akoch-yatta akoch-yatta left a comment

Choose a reason for hiding this comment

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

Fix makes sense and added regression tests looks good as well

@akoch-yatta akoch-yatta merged commit 9119357 into eclipse-platform:master Nov 3, 2025
17 checks passed
@akoch-yatta akoch-yatta deleted the npe-pointoffloat-clone branch November 3, 2025 11:55
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.

Point.OfFloat may throw unexpected NPE

2 participants