add a number of null check to return methods.
This allows calling these methods on error cleanup paths without having to surround them with if checks all the time.
This commit is contained in:
@@ -54,11 +54,15 @@ public abstract class Pool<T> {
|
||||
}
|
||||
|
||||
public void returnBrokenResource(final T resource) {
|
||||
returnBrokenResourceObject(resource);
|
||||
if (resource != null) {
|
||||
returnBrokenResourceObject(resource);
|
||||
}
|
||||
}
|
||||
|
||||
public void returnResource(final T resource) {
|
||||
returnResourceObject(resource);
|
||||
if (resource != null) {
|
||||
returnResourceObject(resource);
|
||||
}
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
@@ -81,4 +85,4 @@ public abstract class Pool<T> {
|
||||
throw new JedisException("Could not destroy the pool", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user