-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
8
Original code (1) that caused findbugs complaint RT-24375 is still in the repo. There was an attempt to fix it (2) which caused regression RT-27731.
(1) return new Double(value*255).intValue();
(2) return (int)value * 255;
The fix was not correct as (int)value evaluates first to 0 or 1 which results in 0 or 255 instead of any number from 0 to 255.
Also both formulas doesn't use rounding which seems to be appropriate for this conversion.
(1) return new Double(value*255).intValue();
(2) return (int)value * 255;
The fix was not correct as (int)value evaluates first to 0 or 1 which results in 0 or 255 instead of any number from 0 to 255.
Also both formulas doesn't use rounding which seems to be appropriate for this conversion.
- relates to
-
JDK-8115197 ColorPicker Save and Use buttons result in Black
-
- Closed
-