Deprecate TimedSemaphore constructors in favor of the builder
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index fdd80bc..c08351a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -59,7 +59,7 @@
<action type="add" dev="ggregory" due-to="Gary Gregory">Add JavaVersion.JAVA_25.</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_25.</action>
<action type="add" dev="ggregory" due-to="jack5505, Gary Gregory">Add MutablePair.ofNonNull(Map.Entry).</action>
- <action type="add" dev="ggregory" due-to="Gary Gregory">Add TimedSemaphore.builder() and Builder.</action>
+ <action type="add" dev="ggregory" due-to="Gary Gregory">Add TimedSemaphore.builder(), Builder, and deprecate constructors.</action>
<!-- UPDATE -->
<action type="update" dev="ggregory" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 88 to 89.</action>
</release>
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java b/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java
index 3c28843..941f403 100644
--- a/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java
+++ b/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java
@@ -259,7 +259,9 @@ private TimedSemaphore(final Builder builder) {
* @param timeUnit the unit for the period.
* @param limit the limit for the semaphore.
* @throws IllegalArgumentException if the period is less or equals 0.
+ * @deprecated Use {@link #builder()} and {@link Builder}.
*/
+ @Deprecated
public TimedSemaphore(final long timePeriod, final TimeUnit timeUnit, final int limit) {
this(null, timePeriod, timeUnit, limit);
}
@@ -273,7 +275,9 @@ public TimedSemaphore(final long timePeriod, final TimeUnit timeUnit, final int
* @param timeUnit the unit for the period.
* @param limit the limit for the semaphore.
* @throws IllegalArgumentException if the period is less or equals 0.
+ * @deprecated Use {@link #builder()} and {@link Builder}.
*/
+ @Deprecated
public TimedSemaphore(final ScheduledExecutorService service, final long timePeriod, final TimeUnit timeUnit, final int limit) {
this(builder().setService(service).setPeriod(timePeriod).setTimeUnit(timeUnit).setLimit(limit));
}