Skip to content
This repository was archived by the owner on Feb 25, 2024. It is now read-only.

Commit 9e7830c

Browse files
committed
implement Java 17 j.u.r.RandomGenerator#isDeprecated()
1 parent 7e1223b commit 9e7830c

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

src/main/java/java9/util/SplittableRandom.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -843,6 +843,26 @@ public DoubleStream doubles(double randomNumberOrigin, double randomNumberBound)
843843
false);
844844
}
845845

846+
/**
847+
* Return true if the implementation of RandomGenerator (algorithm) has been
848+
* marked for deprecation.
849+
*
850+
* <p><b>Implementation Requirements:</b><br>
851+
* Random number generator algorithms evolve over time; new
852+
* algorithms will be introduced and old algorithms will
853+
* lose standing. If an older algorithm is deemed unsuitable
854+
* for continued use, it will be marked as deprecated to indicate
855+
* that it may be removed at some point in the future.
856+
*
857+
* @return true if the implementation of RandomGenerator (algorithm) has been
858+
* marked for deprecation
859+
*
860+
* @since 17
861+
*/
862+
public boolean isDeprecated() {
863+
return false;
864+
}
865+
846866
/**
847867
* Spliterator for int streams. We multiplex the four int
848868
* versions into one class by treating a bound less than origin as

src/main/java/java9/util/concurrent/ThreadLocalRandom.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,26 @@ public DoubleStream doubles(double randomNumberOrigin, double randomNumberBound)
729729
false);
730730
}
731731

732+
/**
733+
* Return true if the implementation of RandomGenerator (algorithm) has been
734+
* marked for deprecation.
735+
*
736+
* <p><b>Implementation Requirements:</b><br>
737+
* Random number generator algorithms evolve over time; new
738+
* algorithms will be introduced and old algorithms will
739+
* lose standing. If an older algorithm is deemed unsuitable
740+
* for continued use, it will be marked as deprecated to indicate
741+
* that it may be removed at some point in the future.
742+
*
743+
* @return true if the implementation of RandomGenerator (algorithm) has been
744+
* marked for deprecation
745+
*
746+
* @since 17
747+
*/
748+
public boolean isDeprecated() {
749+
return false;
750+
}
751+
732752
/**
733753
* Spliterator for int streams. We multiplex the four int
734754
* versions into one class by treating a bound less than origin as

0 commit comments

Comments
 (0)