-
Bug
-
Resolution: Fixed
-
P5
-
21
-
b10
There is a suspicious call to the Math.round method with integer argument.Calling Math.round with integer argument is useless - it will just return the same passed value.
https://github.com/openjdk/jdk/blob/d10afa26e5c59475e49b353ed34e8e85d0615d92/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java#L259
com.apple.laf.AquaProgressBarUI#getStringPlacement
return new Point(x + Math.round(width / 2 - stringWidth / 2), y + ((height + fontSizer.getAscent() - fontSizer.getLeading() - fontSizer.getDescent()) / 2) - 1);
'width' and 'stringWidth' are 'int'
Seems we should remove it.
https://github.com/openjdk/jdk/blob/d10afa26e5c59475e49b353ed34e8e85d0615d92/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java#L259
com.apple.laf.AquaProgressBarUI#getStringPlacement
return new Point(x + Math.round(width / 2 - stringWidth / 2), y + ((height + fontSizer.getAscent() - fontSizer.getLeading() - fontSizer.getDescent()) / 2) - 1);
'width' and 'stringWidth' are 'int'
Seems we should remove it.
- relates to
-
JDK-8205535 Useless (or buggy) call to Math.round on int input
- Resolved
- links to
-
Commit(master) openjdk/jdk/65646b5f
-
Review(master) openjdk/jdk/20400