Changeset 11721 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-03-13T16:59:10+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r11692 r11721 1507 1507 * @param max maximum value 1508 1508 * @return the value 1509 * @throws IllegalArgumentException if min > max 1509 1510 * @since 10805 1510 1511 */ 1511 1512 public static double clamp(double val, double min, double max) { 1512 if (val < min) { 1513 if (min > max) { 1514 throw new IllegalArgumentException(MessageFormat.format("Parameter min ({0}) cannot be greather than max ({1})", min, max)); 1515 } else if (val < min) { 1513 1516 return min; 1514 1517 } else if (val > max) { … … 1525 1528 * @param max maximum value 1526 1529 * @return the value 1530 * @throws IllegalArgumentException if min > max 1527 1531 * @since 11055 1528 1532 */ 1529 1533 public static int clamp(int val, int min, int max) { 1530 if (val < min) { 1534 if (min > max) { 1535 throw new IllegalArgumentException(MessageFormat.format("Parameter min ({0}) cannot be greather than max ({1})", min, max)); 1536 } else if (val < min) { 1531 1537 return min; 1532 1538 } else if (val > max) {
Note:
See TracChangeset
for help on using the changeset viewer.