Skip to content

Commit a060d0d

Browse files
Fix SpotBugs FE_FLOATING_POINT_EQUALITY warnings
Fixed floating point equality checks by replacing `==` and `!=` with `Float.compare` and `Double.compare` or `isZero` checks across multiple files. Updated `generate-quality-report.py` to enforce this rule in CI. Fixed files: - CodenameOne/src/com/codename1/ui/geom/GeneralPath.java - CodenameOne/src/com/codename1/ui/plaf/CSSBorder.java - CodenameOne/src/com/codename1/ui/plaf/RoundRectBorder.java - CodenameOne/src/com/codename1/charts/models/XYSeries.java - CodenameOne/src/com/codename1/charts/models/XYValueSeries.java - CodenameOne/src/com/codename1/location/Location.java - CodenameOne/src/com/codename1/ui/Command.java - CodenameOne/src/com/codename1/ui/Stroke.java - CodenameOne/src/com/codename1/ui/layouts/LayeredLayout.java - CodenameOne/src/com/codename1/ui/plaf/Border.java
1 parent 90cb66e commit a060d0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CodenameOne/src/com/codename1/ui/layouts/LayeredLayout.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3256,7 +3256,7 @@ public Inset changeReference(Container parent, Component newRef, float pos) {
32563256
// // This could potentially affect the opposite inset if it is a percentage
32573257
// referenceComponent(newRef).referencePosition(pos);
32583258
//} else {
3259-
if (newRef != referenceComponent || pos != referencePosition) {
3259+
if (newRef != referenceComponent || Float.compare(pos, referencePosition) != 0) {
32603260
// This may potentially affect both this inset
32613261
// and the opposite inset if it is either flexible or
32623262
// percent.

0 commit comments

Comments
 (0)