From b167f6c0683d6834cced4de96f56f6cd07906cfc Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Fri, 26 Jun 2015 16:22:17 -0700 Subject: [PATCH] Make findbugs happy It complains about the float equality check. It's a false positive, but might as well tweak the code to make it happy; I don't think this version isn't any worse. --- library/src/com/viewpagerindicator/CirclePageIndicator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/src/com/viewpagerindicator/CirclePageIndicator.java b/library/src/com/viewpagerindicator/CirclePageIndicator.java index f441e89fd..f93c2255b 100644 --- a/library/src/com/viewpagerindicator/CirclePageIndicator.java +++ b/library/src/com/viewpagerindicator/CirclePageIndicator.java @@ -238,7 +238,8 @@ protected void onDraw(Canvas canvas) { float dY; float pageFillRadius = mRadius; - if (mPaintStroke.getStrokeWidth() > 0) { + boolean hasStroke = mPaintStroke.getStrokeWidth() > 0; + if (hasStroke) { pageFillRadius -= mPaintStroke.getStrokeWidth() / 2.0f; } @@ -258,7 +259,7 @@ protected void onDraw(Canvas canvas) { } // Only paint stroke if a stroke width was non-zero - if (pageFillRadius != mRadius) { + if (hasStroke) { canvas.drawCircle(dX, dY, mRadius, mPaintStroke); } }