RFR: 4825182: DefaultBoundedRangeModel.setMinimum() changes extent unnecessarily

Prasanta Sadhukhan psadhukhan at openjdk.org
Thu Apr 6 14:22:17 UTC 2023


[DefaultBoundedRangeModel spec](https://docs.oracle.com/en/java/javase/19/docs/api/java.desktop/javax/swing/DefaultBoundedRangeModel.html#%3Cinit%3E(int,int,int,int))
set maximum, minimun., extent as per the constraint "min <= value <= value+extent <= max"
Now, when DefaultBoundedRangeModel.setMinimum() is called with same "value" then because of the integer overflow in `setMinimum` method, it causes the `extent `to become 0.

Fix the integer overflow and make sure the extent is not changed unncessarily

-------------

Commit messages:
 - 4825182: DefaultBoundedRangeModel.setMinimum() changes extent unnecessarily

Changes: https://git.openjdk.org/jdk/pull/13374/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13374&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-4825182
  Stats: 72 lines in 2 files changed: 71 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/13374.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13374/head:pull/13374

PR: https://git.openjdk.org/jdk/pull/13374



More information about the client-libs-dev mailing list