Skip to content

Commit 30d1701

Browse files
committed
Remove @Deprecated API.
See #3208
1 parent bac5ee8 commit 30d1701

File tree

9 files changed

+14
-436
lines changed

9 files changed

+14
-436
lines changed

src/main/java/org/springframework/data/mapping/model/AbstractPersistentProperty.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.springframework.data.mapping.Association;
2828
import org.springframework.data.mapping.PersistentEntity;
2929
import org.springframework.data.mapping.PersistentProperty;
30+
import org.springframework.data.util.ClassUtils;
3031
import org.springframework.data.util.KotlinReflectionUtils;
3132
import org.springframework.data.util.Lazy;
3233
import org.springframework.data.util.ReflectionUtils;
@@ -50,7 +51,7 @@ public abstract class AbstractPersistentProperty<P extends PersistentProperty<P>
5051
static {
5152

5253
CAUSE_FIELD = ReflectionUtils.getRequiredField(Throwable.class, "cause");
53-
ASSOCIATION_TYPE = ReflectionUtils.loadIfPresent("org.jmolecules.ddd.types.Association",
54+
ASSOCIATION_TYPE = ClassUtils.loadIfPresent("org.jmolecules.ddd.types.Association",
5455
AbstractPersistentProperty.class.getClassLoader());
5556
}
5657

src/main/java/org/springframework/data/mapping/model/AnnotationBasedPersistentProperty.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
import org.springframework.data.mapping.MappingException;
3838
import org.springframework.data.mapping.PersistentEntity;
3939
import org.springframework.data.mapping.PersistentProperty;
40+
import org.springframework.data.util.ClassUtils;
4041
import org.springframework.data.util.Lazy;
4142
import org.springframework.data.util.Optionals;
42-
import org.springframework.data.util.ReflectionUtils;
4343
import org.springframework.data.util.StreamUtils;
4444
import org.springframework.data.util.TypeInformation;
4545
import org.springframework.lang.Nullable;
@@ -316,7 +316,7 @@ private Stream<? extends AnnotatedElement> getAccessors() {
316316
@SuppressWarnings("unchecked")
317317
private static Class<? extends Annotation> loadIdentityType() {
318318

319-
return (Class<? extends Annotation>) ReflectionUtils.loadIfPresent("org.jmolecules.ddd.annotation.Identity",
319+
return (Class<? extends Annotation>) ClassUtils.loadIfPresent("org.jmolecules.ddd.annotation.Identity",
320320
AbstractPersistentProperty.class.getClassLoader());
321321
}
322322
}

src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import java.io.Serializable;
1919
import java.lang.reflect.Constructor;
20+
import java.lang.reflect.InvocationTargetException;
2021
import java.lang.reflect.Method;
2122
import java.util.ArrayList;
2223
import java.util.Arrays;
@@ -678,13 +679,11 @@ private static boolean shouldExposeMetadata(RepositoryFragments fragments) {
678679
*/
679680
static class ImplementationMethodExecutionInterceptor implements MethodInterceptor {
680681

681-
private final RepositoryInformation information;
682682
private final RepositoryComposition composition;
683683
private final RepositoryInvocationMulticaster invocationMulticaster;
684684

685685
public ImplementationMethodExecutionInterceptor(RepositoryInformation information,
686686
RepositoryComposition composition, List<RepositoryMethodInvocationListener> methodInvocationListeners) {
687-
this.information = information;
688687
this.composition = composition;
689688
this.invocationMulticaster = methodInvocationListeners.isEmpty() ? NoOpRepositoryInvocationMulticaster.INSTANCE
690689
: new DefaultRepositoryInvocationMulticaster(methodInvocationListeners);
@@ -699,11 +698,14 @@ public Object invoke(@SuppressWarnings("null") MethodInvocation invocation) thro
699698

700699
try {
701700
return composition.invoke(invocationMulticaster, method, arguments);
702-
} catch (Exception e) {
703-
org.springframework.util.ReflectionUtils.handleReflectionException(e);
704-
}
701+
} catch (Exception ex) {
702+
703+
if (ex instanceof InvocationTargetException) {
704+
throw ((InvocationTargetException) ex).getTargetException();
705+
}
705706

706-
throw new IllegalStateException("Should not occur");
707+
throw ex;
708+
}
707709
}
708710
}
709711

src/main/java/org/springframework/data/repository/util/ClassUtils.java

-204
This file was deleted.

src/main/java/org/springframework/data/util/CastUtils.java

-28
This file was deleted.

0 commit comments

Comments
 (0)