|
17 | 17 |
|
18 | 18 | import java.io.Serializable;
|
19 | 19 | import java.lang.reflect.Constructor;
|
| 20 | +import java.lang.reflect.InvocationTargetException; |
20 | 21 | import java.lang.reflect.Method;
|
21 | 22 | import java.util.ArrayList;
|
22 | 23 | import java.util.Arrays;
|
@@ -184,7 +185,7 @@ public void setNamedQueries(@Nullable NamedQueries namedQueries) {
|
184 | 185 |
|
185 | 186 | @Override
|
186 | 187 | public void setBeanClassLoader(@Nullable ClassLoader classLoader) {
|
187 |
| - this.classLoader = classLoader == null ? org.springframework.util.ClassUtils.getDefaultClassLoader() : classLoader; |
| 188 | + this.classLoader = classLoader == null ? ClassUtils.getDefaultClassLoader() : classLoader; |
188 | 189 | this.projectionFactory = createProjectionFactory();
|
189 | 190 | }
|
190 | 191 |
|
@@ -429,15 +430,15 @@ public <T> T getRepository(Class<T> repositoryInterface, RepositoryFragments fra
|
429 | 430 |
|
430 | 431 | if (DefaultMethodInvokingMethodInterceptor.hasDefaultMethods(repositoryInterface)) {
|
431 | 432 | if (logger.isTraceEnabled()) {
|
432 |
| - logger.trace(LogMessage.format("Register DefaultMethodInvokingMethodInterceptor for %s…", repositoryInterface.getName())); |
| 433 | + logger.trace(LogMessage.format("Register DefaultMethodInvokingMethodInterceptor for %s…", |
| 434 | + repositoryInterface.getName())); |
433 | 435 | }
|
434 | 436 | result.addAdvice(new DefaultMethodInvokingMethodInterceptor());
|
435 | 437 | }
|
436 | 438 |
|
437 | 439 | Optional<QueryLookupStrategy> queryLookupStrategy = getQueryLookupStrategy(queryLookupStrategyKey,
|
438 | 440 | new ValueExpressionDelegate(
|
439 |
| - new QueryMethodValueEvaluationContextAccessor(getEnvironment(), evaluationContextProvider), |
440 |
| - VALUE_PARSER)); |
| 441 | + new QueryMethodValueEvaluationContextAccessor(getEnvironment(), evaluationContextProvider), VALUE_PARSER)); |
441 | 442 | result.addAdvice(new QueryExecutorMethodInterceptor(information, getProjectionFactory(), queryLookupStrategy,
|
442 | 443 | namedQueries, queryPostProcessors, methodInvocationListeners));
|
443 | 444 |
|
@@ -529,7 +530,7 @@ private RepositoryInformation getRepositoryInformation(RepositoryMetadata metada
|
529 | 530 |
|
530 | 531 | return repositoryInformationCache.computeIfAbsent(cacheKey, key -> {
|
531 | 532 |
|
532 |
| - Class<?> baseClass = repositoryBaseClass != null ? repositoryBaseClass : getRepositoryBaseClass(metadata); |
| 533 | + Class<?> baseClass = repositoryBaseClass != null ? repositoryBaseClass : getRepositoryBaseClass(metadata); |
533 | 534 |
|
534 | 535 | return new DefaultRepositoryInformation(metadata, baseClass, composition);
|
535 | 536 | });
|
@@ -751,11 +752,13 @@ public Object invoke(@SuppressWarnings("null") MethodInvocation invocation) thro
|
751 | 752 |
|
752 | 753 | try {
|
753 | 754 | return composition.invoke(invocationMulticaster, method, arguments);
|
754 |
| - } catch (Exception e) { |
755 |
| - org.springframework.data.repository.util.ClassUtils.unwrapReflectionException(e); |
756 |
| - } |
| 755 | + } catch (Exception ex) { |
| 756 | + if (ex instanceof InvocationTargetException) { |
| 757 | + throw ((InvocationTargetException) ex).getTargetException(); |
| 758 | + } |
757 | 759 |
|
758 |
| - throw new IllegalStateException("Should not occur"); |
| 760 | + throw ex; |
| 761 | + } |
759 | 762 | }
|
760 | 763 | }
|
761 | 764 |
|
@@ -886,25 +889,24 @@ static class RepositoryValidator {
|
886 | 889 |
|
887 | 890 | static {
|
888 | 891 |
|
889 |
| - org.springframework.data.repository.util.ClassUtils.ifPresent( |
890 |
| - "org.springframework.data.querydsl.QuerydslPredicateExecutor", RepositoryValidator.class.getClassLoader(), |
891 |
| - it -> { |
| 892 | + org.springframework.data.util.ClassUtils.ifPresent("org.springframework.data.querydsl.QuerydslPredicateExecutor", |
| 893 | + RepositoryValidator.class.getClassLoader(), it -> { |
892 | 894 | WELL_KNOWN_EXECUTORS.put(it, "Querydsl");
|
893 | 895 | });
|
894 | 896 |
|
895 |
| - org.springframework.data.repository.util.ClassUtils.ifPresent( |
| 897 | + org.springframework.data.util.ClassUtils.ifPresent( |
896 | 898 | "org.springframework.data.querydsl.ReactiveQuerydslPredicateExecutor",
|
897 | 899 | RepositoryValidator.class.getClassLoader(), it -> {
|
898 | 900 | WELL_KNOWN_EXECUTORS.put(it, "Reactive Querydsl");
|
899 | 901 | });
|
900 | 902 |
|
901 |
| - org.springframework.data.repository.util.ClassUtils.ifPresent( |
| 903 | + org.springframework.data.util.ClassUtils.ifPresent( |
902 | 904 | "org.springframework.data.repository.query.QueryByExampleExecutor",
|
903 | 905 | RepositoryValidator.class.getClassLoader(), it -> {
|
904 | 906 | WELL_KNOWN_EXECUTORS.put(it, "Query by Example");
|
905 | 907 | });
|
906 | 908 |
|
907 |
| - org.springframework.data.repository.util.ClassUtils.ifPresent( |
| 909 | + org.springframework.data.util.ClassUtils.ifPresent( |
908 | 910 | "org.springframework.data.repository.query.ReactiveQueryByExampleExecutor",
|
909 | 911 | RepositoryValidator.class.getClassLoader(), it -> {
|
910 | 912 | WELL_KNOWN_EXECUTORS.put(it, "Reactive Query by Example");
|
|
0 commit comments