diff options
author | 2023-08-25 17:24:50 +0200 | |
---|---|---|
committer | 2023-08-25 17:24:50 +0200 | |
commit | d66fae40e7246e3ac72548a3150e8b9b6d3b6a83 (patch) | |
tree | 904c7a674e4f0c9945ae68871ddad101f161efa1 /subprojects/store-dse/src/main/java | |
parent | Add missing copyright headers (diff) | |
download | refinery-d66fae40e7246e3ac72548a3150e8b9b6d3b6a83.tar.gz refinery-d66fae40e7246e3ac72548a3150e8b9b6d3b6a83.tar.zst refinery-d66fae40e7246e3ac72548a3150e8b9b6d3b6a83.zip |
SuppressWarnings for using pseudorandom number generator in non-security sensitive contexts
Diffstat (limited to 'subprojects/store-dse/src/main/java')
3 files changed, 5 insertions, 0 deletions
diff --git a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/internal/DesignSpaceExplorationAdapterImpl.java b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/internal/DesignSpaceExplorationAdapterImpl.java index 0a5cd7fc..1ae09916 100644 --- a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/internal/DesignSpaceExplorationAdapterImpl.java +++ b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/internal/DesignSpaceExplorationAdapterImpl.java | |||
@@ -46,6 +46,7 @@ public class DesignSpaceExplorationAdapterImpl implements DesignSpaceExploration | |||
46 | private Map<Version, Version> parents = new HashMap<>(); | 46 | private Map<Version, Version> parents = new HashMap<>(); |
47 | private final List<Version> solutions = new ArrayList<>(); | 47 | private final List<Version> solutions = new ArrayList<>(); |
48 | private Map<Version, List<Activation>> statesAndTraversedActivations; | 48 | private Map<Version, List<Activation>> statesAndTraversedActivations; |
49 | @SuppressWarnings("squid:S2245") | ||
49 | private Random random = new Random(); | 50 | private Random random = new Random(); |
50 | private boolean isNewState = false; | 51 | private boolean isNewState = false; |
51 | private final boolean isVisualizationEnabled; | 52 | private final boolean isVisualizationEnabled; |
@@ -182,6 +183,7 @@ public class DesignSpaceExplorationAdapterImpl implements DesignSpaceExploration | |||
182 | } | 183 | } |
183 | 184 | ||
184 | @Override | 185 | @Override |
186 | @SuppressWarnings("squid:S2245") | ||
185 | public void setRandom(long seed) { | 187 | public void setRandom(long seed) { |
186 | this.random = new Random(seed); | 188 | this.random = new Random(seed); |
187 | } | 189 | } |
diff --git a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/internal/TransformationRule.java b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/internal/TransformationRule.java index 8123c0d6..37117164 100644 --- a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/internal/TransformationRule.java +++ b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/internal/TransformationRule.java | |||
@@ -26,10 +26,12 @@ public class TransformationRule { | |||
26 | private Random random; | 26 | private Random random; |
27 | private ModelQueryAdapter queryEngine; | 27 | private ModelQueryAdapter queryEngine; |
28 | 28 | ||
29 | @SuppressWarnings("squid:S2245") | ||
29 | public TransformationRule(String name, RelationalQuery precondition, ActionFactory actionFactory) { | 30 | public TransformationRule(String name, RelationalQuery precondition, ActionFactory actionFactory) { |
30 | this(name, precondition, actionFactory, new Random()); | 31 | this(name, precondition, actionFactory, new Random()); |
31 | } | 32 | } |
32 | 33 | ||
34 | @SuppressWarnings("squid:S2245") | ||
33 | public TransformationRule(String name, RelationalQuery precondition, ActionFactory actionFactory, long seed) { | 35 | public TransformationRule(String name, RelationalQuery precondition, ActionFactory actionFactory, long seed) { |
34 | this(name, precondition, actionFactory, new Random(seed)); | 36 | this(name, precondition, actionFactory, new Random(seed)); |
35 | } | 37 | } |
diff --git a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/objectives/AlwaysSatisfiedRandomHardObjective.java b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/objectives/AlwaysSatisfiedRandomHardObjective.java index 327d5e2f..cdd1754f 100644 --- a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/objectives/AlwaysSatisfiedRandomHardObjective.java +++ b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/objectives/AlwaysSatisfiedRandomHardObjective.java | |||
@@ -22,6 +22,7 @@ import java.util.Random; | |||
22 | public class AlwaysSatisfiedRandomHardObjective extends BaseObjective { | 22 | public class AlwaysSatisfiedRandomHardObjective extends BaseObjective { |
23 | 23 | ||
24 | private static final String DEFAULT_NAME = "AlwaysSatisfiedDummyHardObjective"; | 24 | private static final String DEFAULT_NAME = "AlwaysSatisfiedDummyHardObjective"; |
25 | @SuppressWarnings("squid:S2245") | ||
25 | private static final Random random = new Random(0); | 26 | private static final Random random = new Random(0); |
26 | 27 | ||
27 | public AlwaysSatisfiedRandomHardObjective() { | 28 | public AlwaysSatisfiedRandomHardObjective() { |