Skip to content

Commit cc5ecf5

Browse files
committed
Deprecate TimedSemaphore constructors in favor of the builder
1 parent 9132251 commit cc5ecf5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The <action> type attribute can be add,update,fix,remove.
5959
<action type="add" dev="ggregory" due-to="Gary Gregory">Add JavaVersion.JAVA_25.</action>
6060
<action type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_25.</action>
6161
<action type="add" dev="ggregory" due-to="jack5505, Gary Gregory">Add MutablePair.ofNonNull(Map.Entry).</action>
62-
<action type="add" dev="ggregory" due-to="Gary Gregory">Add TimedSemaphore.builder() and Builder.</action>
62+
<action type="add" dev="ggregory" due-to="Gary Gregory">Add TimedSemaphore.builder(), Builder, and deprecate constructors.</action>
6363
<!-- UPDATE -->
6464
<action type="update" dev="ggregory" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 88 to 89.</action>
6565
</release>

src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ private TimedSemaphore(final Builder builder) {
259259
* @param timeUnit the unit for the period.
260260
* @param limit the limit for the semaphore.
261261
* @throws IllegalArgumentException if the period is less or equals 0.
262+
* @deprecated Use {@link #builder()} and {@link Builder}.
262263
*/
264+
@Deprecated
263265
public TimedSemaphore(final long timePeriod, final TimeUnit timeUnit, final int limit) {
264266
this(null, timePeriod, timeUnit, limit);
265267
}
@@ -273,7 +275,9 @@ public TimedSemaphore(final long timePeriod, final TimeUnit timeUnit, final int
273275
* @param timeUnit the unit for the period.
274276
* @param limit the limit for the semaphore.
275277
* @throws IllegalArgumentException if the period is less or equals 0.
278+
* @deprecated Use {@link #builder()} and {@link Builder}.
276279
*/
280+
@Deprecated
277281
public TimedSemaphore(final ScheduledExecutorService service, final long timePeriod, final TimeUnit timeUnit, final int limit) {
278282
this(builder().setService(service).setPeriod(timePeriod).setTimeUnit(timeUnit).setLimit(limit));
279283
}

0 commit comments

Comments
 (0)