Avoid String allocations with Assert.state()
This commit is contained in:
parent
6022065ad3
commit
34b1857236
|
@ -179,7 +179,7 @@ public final class AotServices<T> implements Iterable<T> {
|
||||||
public Source getSource(T service) {
|
public Source getSource(T service) {
|
||||||
Source source = this.sources.get(service);
|
Source source = this.sources.get(service);
|
||||||
Assert.state(source != null,
|
Assert.state(source != null,
|
||||||
"Unable to find service " + ObjectUtils.identityToString(source));
|
() -> "Unable to find service " + ObjectUtils.identityToString(source));
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,11 +40,12 @@ public class RegisterReflectionForBindingProcessor implements ReflectiveProcesso
|
||||||
RegisterReflectionForBinding registerReflection = AnnotationUtils.getAnnotation(element, RegisterReflectionForBinding.class);
|
RegisterReflectionForBinding registerReflection = AnnotationUtils.getAnnotation(element, RegisterReflectionForBinding.class);
|
||||||
if (registerReflection != null) {
|
if (registerReflection != null) {
|
||||||
Class<?>[] classes = registerReflection.classes();
|
Class<?>[] classes = registerReflection.classes();
|
||||||
Assert.state(classes.length != 0, "A least one class should be specified in" +
|
Assert.state(classes.length != 0, () -> "A least one class should be specified in " +
|
||||||
" @RegisterReflectionForBinding attributes and none was provided on " + element);
|
"@RegisterReflectionForBinding attributes, and none was provided on " + element);
|
||||||
for (Class<?> type : classes) {
|
for (Class<?> type : classes) {
|
||||||
this.bindingRegistrar.registerReflectionHints(hints, type);
|
this.bindingRegistrar.registerReflectionHints(hints, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue