diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-11-14 10:18:40 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-11-14 10:18:40 +0000 |
commit | 8365ee1611c87346277854f3333d3c5f3668e7b9 (patch) | |
tree | 68e624e50f3bed91e6622207708452ae8de96a80 /poi-scratchpad | |
parent | 20c0ac1637acb8069b656452ff39eb0dbf9baef1 (diff) | |
download | poi-8365ee1611c87346277854f3333d3c5f3668e7b9.tar.gz poi-8365ee1611c87346277854f3333d3c5f3668e7b9.zip |
[github-278] Resolve all SpotBugs P1 issues in Main and Test. Thanks to Andreas Reichel. This closes #278
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895016 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad')
-rw-r--r-- | poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestPictures.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestPictures.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestPictures.java index 918d844ec8..ebda0b8afa 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestPictures.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestPictures.java @@ -34,7 +34,6 @@ import java.net.URL; import java.util.Arrays; import java.util.Collections; import java.util.List; -import java.util.Random; import javax.imageio.ImageIO; @@ -53,6 +52,7 @@ import org.apache.poi.sl.image.ImageHeaderEMF; import org.apache.poi.sl.image.ImageHeaderPICT; import org.apache.poi.sl.image.ImageHeaderWMF; import org.apache.poi.sl.usermodel.PictureData.PictureType; +import org.apache.poi.util.RandomSingleton; import org.apache.poi.util.Units; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -497,10 +497,9 @@ public final class TestPictures { originalOffsets = ppt1.getPictureData().stream().mapToInt(HSLFPictureData::getOffset).toArray(); originalNumberOfRecords = ppt1.getPictureData().get(0).bStore.getChildCount(); - Random random = new Random(); for (HSLFPictureData picture : ppt1.getPictureData()) { // Bound is arbitrary and irrelevant to the test. - picture.bse.setOffset(random.nextInt(500_000)); + picture.bse.setOffset(RandomSingleton.getInstance().nextInt(500_000)); } try (HSLFSlideShow ppt2 = writeOutAndReadBack(ppt1)) { |