This is an automated email from the ASF dual-hosted git repository. garydgregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 9368465e7575810c45acd9d2e6f805cd002f4ff8 Author: Gary Gregory <[email protected]> AuthorDate: Wed Nov 11 15:50:36 2026 -0500 Update Javadoc examples to use TimedSemaphore builder Replace deprecated constructor calls and correct TimeUnit.SECOND to TimeUnit.SECONDS. Describe the configured ToStringStyle in DiffBuilder and ReflectionDiffBuilder without referring to constructor arguments. --- src/changes/changes.xml | 1 + src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java | 2 +- .../org/apache/commons/lang3/builder/ReflectionDiffBuilder.java | 2 +- .../java/org/apache/commons/lang3/concurrent/TimedSemaphore.java | 6 +++++- .../java/org/apache/commons/lang3/concurrent/package-info.java | 8 +++++++- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 22c5e3284..c03f77c4f 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -47,6 +47,7 @@ The <action> type attribute can be add,update,fix,remove. <release version="3.22.1" date="YYYY-MM-DD" description="This is a feature and maintenance release. Java 8 or later is required."> <!-- FIX --> <action type="fix" dev="ggregory" due-to="maria-zortea">Javadoc: Use DiffBuilder.builder() in nested diff example.</action> + <action type="fix" dev="ggregory" due-to="Gary Gregory">Javadoc fixes: DiffBuilder, ReflectionDiffBuilder, TimedSemaphore.</action> <!-- ADD --> <!-- UPDATE --> </release> diff --git a/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java b/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java index ce72612c3..06f0b141f 100644 --- a/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java +++ b/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java @@ -57,7 +57,7 @@ * }</pre> * * <p> - * The {@link ToStringStyle} passed to the constructor is embedded in the returned {@link DiffResult} and influences the style of the + * The configured {@link ToStringStyle} is embedded in the returned {@link DiffResult} and influences the style of the * {@code DiffResult.toString()} method. This style choice can be overridden by calling {@link DiffResult#toString(ToStringStyle)}. * </p> * <p> diff --git a/src/main/java/org/apache/commons/lang3/builder/ReflectionDiffBuilder.java b/src/main/java/org/apache/commons/lang3/builder/ReflectionDiffBuilder.java index 455255769..31853445f 100644 --- a/src/main/java/org/apache/commons/lang3/builder/ReflectionDiffBuilder.java +++ b/src/main/java/org/apache/commons/lang3/builder/ReflectionDiffBuilder.java @@ -63,7 +63,7 @@ * }</pre> * * <p> - * The {@link ToStringStyle} passed to the constructor is embedded in the returned {@link DiffResult} and influences the style of the + * The configured {@link ToStringStyle} is embedded in the returned {@link DiffResult} and influences the style of the * {@code DiffResult.toString()} method. This style choice can be overridden by calling {@link DiffResult#toString(ToStringStyle)}. * </p> * <p> 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 232be52ff..520b7373d 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java @@ -76,7 +76,11 @@ * </p> * * <pre> - * TimedSemaphore sem = new TimedSemaphore(1, TimeUnit.SECOND, 10); + * TimedSemaphore sem = TimedSemaphore.builder() + * .setPeriod(1) + * .setTimeUnit(TimeUnit.SECONDS) + * .setLimit(10) + * .get(); * StatisticsThread thread = new StatisticsThread(sem); * thread.start(); * </pre> diff --git a/src/main/java/org/apache/commons/lang3/concurrent/package-info.java b/src/main/java/org/apache/commons/lang3/concurrent/package-info.java index dcc0c4a9e..56c3f2717 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/package-info.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/package-info.java @@ -450,7 +450,13 @@ * properties with default values: * </p> * - * {@code TimedSemaphore semaphore = new TimedSemaphore(1, TimeUnit.SECONDS, 100);} + * <pre>{@code + * TimedSemaphore semaphore = TimedSemaphore.builder() + * .setPeriod(1) + * .setTimeUnit(TimeUnit.SECONDS) + * .setLimit(100) + * .get(); + * }</pre> * * <p> * Here we specify that the semaphore should allow 100 permits in one second. This is effectively the limit of database
