Skip to content

Commit f3bbee7

Browse files
committed
PDFBOX-5660: Sonar fix
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1924917 13f79535-47bb-0310-9956-ffa450edef68
1 parent 122032d commit f3bbee7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactoryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,14 +483,14 @@ private void doBitmaskTransparencyTest(int imageType, String pdfFilename) throws
483483
int alpha;
484484
if ((x >= startX && x <= endX) || y >= startY && y <= endY)
485485
{
486-
alpha = 128 + (int) (random.nextFloat() * 127);
486+
alpha = 128 + random.nextInt(128);
487487
assertTrue(alpha >= 128);
488488
argbImage.setRGB(x, y, (argbImage.getRGB(x, y) & 0xFFFFFF) | (alpha << 24));
489489
assertEquals(255, argbImage.getRGB(x, y) >>> 24);
490490
}
491491
else
492492
{
493-
alpha = (int) (random.nextFloat() * 127);
493+
alpha = random.nextInt(128);
494494
assertTrue(alpha < 128);
495495
argbImage.setRGB(x, y, (argbImage.getRGB(x, y) & 0xFFFFFF) | (alpha << 24));
496496
assertEquals(0, argbImage.getRGB(x, y) >>> 24);

0 commit comments

Comments
 (0)