DATACMNS-1224 - Polishing of nullability annotations.
Refactored code to properly check for null fields in Eclipse. Added warning suppressions where suitable.
This commit is contained in:
@@ -141,7 +141,7 @@ public class SpringDataWebConfiguration implements WebMvcConfigurer, BeanClassLo
|
||||
argumentResolvers.add(pageableResolver());
|
||||
|
||||
ProxyingHandlerMethodArgumentResolver resolver = new ProxyingHandlerMethodArgumentResolver(
|
||||
getRequiredConversionService());
|
||||
conversionService.getObject());
|
||||
resolver.setBeanFactory(context);
|
||||
forwardBeanClassLoader(resolver);
|
||||
|
||||
@@ -180,17 +180,6 @@ public class SpringDataWebConfiguration implements WebMvcConfigurer, BeanClassLo
|
||||
sortResolverCustomizer.ifPresent(c -> c.customize(sortResolver));
|
||||
}
|
||||
|
||||
private ConversionService getRequiredConversionService() {
|
||||
|
||||
ConversionService conversionService = this.conversionService.getObject();
|
||||
|
||||
if (conversionService == null) {
|
||||
throw new IllegalStateException("No ConversionService configured!");
|
||||
}
|
||||
|
||||
return conversionService;
|
||||
}
|
||||
|
||||
private void forwardBeanClassLoader(BeanClassLoaderAware target) {
|
||||
|
||||
if (beanClassLoader != null) {
|
||||
|
||||
@@ -90,6 +90,7 @@ public class QuerydslPredicateArgumentResolver implements HandlerMethodArgumentR
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#resolveArgument(org.springframework.core.MethodParameter, org.springframework.web.method.support.ModelAndViewContainer, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.bind.support.WebDataBinderFactory)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Predicate resolveArgument(MethodParameter parameter, @Nullable ModelAndViewContainer mavContainer,
|
||||
NativeWebRequest webRequest, @Nullable WebDataBinderFactory binderFactory) throws Exception {
|
||||
@@ -149,6 +150,10 @@ public class QuerydslPredicateArgumentResolver implements HandlerMethodArgumentR
|
||||
|
||||
TypeInformation<?> actualType = source.getActualType();
|
||||
|
||||
if (actualType == null) {
|
||||
throw new IllegalArgumentException(String.format("Could not determine domain type from %s!", source));
|
||||
}
|
||||
|
||||
if (source != actualType) {
|
||||
return detectDomainType(actualType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user