You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/01/21 19:44:48 UTC
(commons-pool) branch master updated: Fix ParenPad
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-pool.git
The following commit(s) were added to refs/heads/master by this push:
new e44cdd19 Fix ParenPad
e44cdd19 is described below
commit e44cdd19d5f9b1122760472b4623adc083fc08a9
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jan 21 14:44:28 2025 -0500
Fix ParenPad
---
src/conf/checkstyle.xml | 1 +
.../java/org/apache/commons/pool3/impl/LinkedBlockingDeque.java | 9 ++++-----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/conf/checkstyle.xml b/src/conf/checkstyle.xml
index 690e1d8a..2b959d03 100644
--- a/src/conf/checkstyle.xml
+++ b/src/conf/checkstyle.xml
@@ -71,6 +71,7 @@
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
</module>
+ <module name="ParenPad" />
<module name="TypecastParenPad" />
</module>
diff --git a/src/main/java/org/apache/commons/pool3/impl/LinkedBlockingDeque.java b/src/main/java/org/apache/commons/pool3/impl/LinkedBlockingDeque.java
index b4232df5..3c5c3a3b 100644
--- a/src/main/java/org/apache/commons/pool3/impl/LinkedBlockingDeque.java
+++ b/src/main/java/org/apache/commons/pool3/impl/LinkedBlockingDeque.java
@@ -953,13 +953,12 @@ final class LinkedBlockingDeque<E> extends AbstractQueue<E>
* @return the unlinked element
* @throws InterruptedException if the current thread is interrupted
*/
- public E pollLast(final Duration timeout)
- throws InterruptedException {
+ public E pollLast(final Duration timeout) throws InterruptedException {
long nanos = timeout.toNanos();
lock.lockInterruptibly();
try {
E x;
- while ( (x = unlinkLast()) == null) {
+ while ((x = unlinkLast()) == null) {
if (nanos <= 0) {
return null;
}
@@ -1292,7 +1291,7 @@ final class LinkedBlockingDeque<E> extends AbstractQueue<E>
lock.lock();
try {
E x;
- while ( (x = unlinkFirst()) == null) {
+ while ((x = unlinkFirst()) == null) {
notEmpty.await();
}
return x;
@@ -1312,7 +1311,7 @@ final class LinkedBlockingDeque<E> extends AbstractQueue<E>
lock.lock();
try {
E x;
- while ( (x = unlinkLast()) == null) {
+ while ((x = unlinkLast()) == null) {
notEmpty.await();
}
return x;