Skip to content

Commit

Permalink
Remove @Deprecated API.
Browse files Browse the repository at this point in the history
See #3208
  • Loading branch information
mp911de committed Nov 20, 2024
1 parent bac5ee8 commit 30d1701
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 436 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.springframework.data.mapping.Association;
import org.springframework.data.mapping.PersistentEntity;
import org.springframework.data.mapping.PersistentProperty;
import org.springframework.data.util.ClassUtils;
import org.springframework.data.util.KotlinReflectionUtils;
import org.springframework.data.util.Lazy;
import org.springframework.data.util.ReflectionUtils;
Expand All @@ -50,7 +51,7 @@ public abstract class AbstractPersistentProperty<P extends PersistentProperty<P>
static {

CAUSE_FIELD = ReflectionUtils.getRequiredField(Throwable.class, "cause");
ASSOCIATION_TYPE = ReflectionUtils.loadIfPresent("org.jmolecules.ddd.types.Association",
ASSOCIATION_TYPE = ClassUtils.loadIfPresent("org.jmolecules.ddd.types.Association",
AbstractPersistentProperty.class.getClassLoader());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
import org.springframework.data.mapping.MappingException;
import org.springframework.data.mapping.PersistentEntity;
import org.springframework.data.mapping.PersistentProperty;
import org.springframework.data.util.ClassUtils;
import org.springframework.data.util.Lazy;
import org.springframework.data.util.Optionals;
import org.springframework.data.util.ReflectionUtils;
import org.springframework.data.util.StreamUtils;
import org.springframework.data.util.TypeInformation;
import org.springframework.lang.Nullable;
Expand Down Expand Up @@ -316,7 +316,7 @@ private Stream<? extends AnnotatedElement> getAccessors() {
@SuppressWarnings("unchecked")
private static Class<? extends Annotation> loadIdentityType() {

return (Class<? extends Annotation>) ReflectionUtils.loadIfPresent("org.jmolecules.ddd.annotation.Identity",
return (Class<? extends Annotation>) ClassUtils.loadIfPresent("org.jmolecules.ddd.annotation.Identity",
AbstractPersistentProperty.class.getClassLoader());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -678,13 +679,11 @@ private static boolean shouldExposeMetadata(RepositoryFragments fragments) {
*/
static class ImplementationMethodExecutionInterceptor implements MethodInterceptor {

private final RepositoryInformation information;
private final RepositoryComposition composition;
private final RepositoryInvocationMulticaster invocationMulticaster;

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

try {
return composition.invoke(invocationMulticaster, method, arguments);
} catch (Exception e) {
org.springframework.util.ReflectionUtils.handleReflectionException(e);
}
} catch (Exception ex) {

if (ex instanceof InvocationTargetException) {
throw ((InvocationTargetException) ex).getTargetException();
}

throw new IllegalStateException("Should not occur");
throw ex;
}
}
}

Expand Down
204 changes: 0 additions & 204 deletions src/main/java/org/springframework/data/repository/util/ClassUtils.java

This file was deleted.

28 changes: 0 additions & 28 deletions src/main/java/org/springframework/data/util/CastUtils.java

This file was deleted.

Loading

0 comments on commit 30d1701

Please sign in to comment.