Simplify DefaultBootstrapContext.toString()
This commit is contained in:
@@ -60,19 +60,9 @@ class DefaultBootstrapContext implements BootstrapContext {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringCreator(this)//
|
return new ToStringCreator(this)//
|
||||||
.append("testClass", testClass)//
|
.append("testClass", testClass.getName())//
|
||||||
.append("cacheAwareContextLoaderDelegate", nullSafeToString(cacheAwareContextLoaderDelegate))//
|
.append("cacheAwareContextLoaderDelegate", cacheAwareContextLoaderDelegate.getClass().getName())//
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a null-safe {@link String} representation of the supplied
|
|
||||||
* {@link CacheAwareContextLoaderDelegate} based solely on the fully qualified
|
|
||||||
* name of the delegate or "null" if the supplied delegate is
|
|
||||||
* {@code null}.
|
|
||||||
*/
|
|
||||||
private static String nullSafeToString(CacheAwareContextLoaderDelegate delegate) {
|
|
||||||
return delegate == null ? "null" : delegate.getClass().getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user