Skip to content

Commit

Permalink
Avoid rare NPE in DefaultPooledObject.toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Sep 20, 2023
1 parent 94df576 commit 686b0a1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.time.Duration;
import java.time.Instant;
import java.util.Deque;
import java.util.Objects;

import org.apache.commons.pool3.PooledObject;
import org.apache.commons.pool3.PooledObjectState;
Expand Down Expand Up @@ -280,7 +281,7 @@ public synchronized boolean startEvictionTest() {
public String toString() {
final StringBuilder result = new StringBuilder();
result.append("Object: ");
result.append(object.toString());
result.append(Objects.toString(object));
result.append(", State: ");
synchronized (this) {
result.append(state.toString());
Expand Down

0 comments on commit 686b0a1

Please sign in to comment.