garydgregory commented on code in PR #1474:
URL: https://github.com/apache/commons-lang/pull/1474#discussion_r2463744395
##########
src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java:
##########
@@ -179,6 +181,17 @@ public Builder setTimeUnit(final TimeUnit timeUnit) {
this.timeUnit = timeUnit;
return this;
}
+
+ /**
+ * ADDED: Enables or disables FIFO fairness
Review Comment:
Remove "ADDED", it's meaningless. Use a Javadoc since tag. A setter Javadoc
"Sets...". A sentence ends in a period, see the other Javadocs.
##########
src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java:
##########
@@ -235,10 +249,18 @@ public static Builder builder() {
/** A flag whether shutdown() was called. */
private boolean shutdown; // @GuardedBy("this")
+ /** Fairness mode checker */
Review Comment:
End sentence in a period.
##########
src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java:
##########
@@ -123,6 +124,7 @@ public static class Builder implements
Supplier<TimedSemaphore> {
private long period;
private TimeUnit timeUnit;
private int limit;
+ private boolean fair = false;
Review Comment:
Don't initialize the default value.
##########
src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java:
##########
@@ -190,6 +203,7 @@ public Builder setTimeUnit(final TimeUnit timeUnit) {
/** Constant for the thread pool size for the executor. */
private static final int THREAD_POOL_SIZE = 1;
+
Review Comment:
Remove this extra blank line. You PR shouldn't contain noise like this.
##########
src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java:
##########
@@ -437,6 +469,17 @@ private void prepareAcquire() {
*/
public final synchronized void setLimit(final int limit) {
this.limit = limit;
+
Review Comment:
Remove extra blank lines.
##########
src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java:
##########
@@ -264,6 +287,7 @@ private TimedSemaphore(final Builder builder) {
@Deprecated
public TimedSemaphore(final long timePeriod, final TimeUnit timeUnit,
final int limit) {
this(null, timePeriod, timeUnit, limit);
+
Review Comment:
Remove this extra blank line. You PR shouldn't contain noise like this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]