Skip to content

Commit

Permalink
Replace SimpleImmutableEntry constructor with Map.entry() factory met…
Browse files Browse the repository at this point in the history
…hod.
  • Loading branch information
rgiulietti committed May 14, 2024
1 parent e8432cc commit 4bc5bf9
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.AbstractMap.SimpleImmutableEntry;
import java.util.Objects;
import java.util.Map;
import java.util.Random;
Expand Down Expand Up @@ -195,11 +194,11 @@ private static Map<String, RandomGeneratorProperties> createFactoryMap() {
);
}

private static SimpleImmutableEntry<String, RandomGeneratorProperties>
private static Map.Entry<String, RandomGeneratorProperties>
entry(Class<? extends RandomGenerator> rgClass, String name, String group,
int i, int j, int k, int equidistribution,
int flags) {
return new SimpleImmutableEntry<>(name,
return Map.entry(name,
new RandomGeneratorProperties(rgClass, name, group,
i, j, k, equidistribution,
flags | (rgClass.isAnnotationPresent(Deprecated.class) ? DEPRECATED : 0)));
Expand Down Expand Up @@ -624,7 +623,7 @@ public T create() {
* <a href="package-summary.html#algorithms">algorithm</a> chosen,
* and providing a starting long seed.
* If a long seed is not supported by the algorithm,
* an UnsupportedOperationException is thrown.
* an {@link UnsupportedOperationException} is thrown.
*
* @param seed long random seed value.
*
Expand All @@ -643,7 +642,7 @@ public T create(long seed) {
* <a href="package-summary.html#algorithms">algorithm</a> chosen,
* and providing a starting byte[] seed.
* If a byte[] seed is not supported by the algorithm,
* an UnsupportedOperationException is thrown.
* an {@link UnsupportedOperationException} is thrown.
*
* @param seed byte array random seed value.
*
Expand Down

0 comments on commit 4bc5bf9

Please sign in to comment.