Skip to content
Permalink
Browse files
8265279: Remove unused RandomGeneratorFactory.all(Class<T> category)
Reviewed-by: rriggs
  • Loading branch information
JimLaskey committed May 4, 2021
1 parent ee5bba0 commit 770dfc1ec4fe28bc73612c8b0dd8423dd49e1597
Showing with 0 additions and 25 deletions.
  1. +0 −25 src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java
@@ -370,31 +370,6 @@ private void ensureConstructors() {
return factoryOf("L32X64MixRandom", RandomGenerator.class);
}

/**
* Returns a stream of matching Providers.
*
* @param category {@link RandomGenerator} sub-interface class to filter
* @param <T> {@link RandomGenerator} sub-interface return type
*
* RandomGenerators that are marked as deprecated or are not properly configured are not included in the result.
*
* @implSpec Availability is determined by RandomGeneratorFactory using the service provider API
* to locate implementations of the RandomGenerator interface.
*
* @return Stream of matching {@link RandomGeneratorFactory RandomGeneratorFactory(s)}.
*
* @hidden
*/
public static <T extends RandomGenerator> Stream<RandomGeneratorFactory<T>> all(Class<T> category) {
Map<String, Provider<? extends RandomGenerator>> fm = getFactoryMap();
return fm.values()
.stream()
.filter(p -> isSubclass(category, p) &&
!p.type().isAnnotationPresent(Deprecated.class) &&
p.type().isAnnotationPresent(RandomGeneratorProperties.class))
.map(RandomGeneratorFactory::new);
}

/**
* Returns a non-empty stream of available {@link RandomGeneratorFactory RandomGeneratorFactory(s)}.
*

0 comments on commit 770dfc1

Please sign in to comment.