diff --git a/src/main/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilder.java b/src/main/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilder.java index 251940af7..32c22330e 100644 --- a/src/main/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilder.java +++ b/src/main/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilder.java @@ -40,7 +40,6 @@ import org.springframework.data.jpa.repository.query.EscapeCharacter; import org.springframework.data.repository.core.support.ExampleMatcherAccessor; import org.springframework.data.util.DirectFieldAccessFallbackBeanWrapper; import org.springframework.lang.Nullable; -import org.springframework.orm.jpa.JpaSystemException; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.ObjectUtils; @@ -94,7 +93,7 @@ public class QueryByExamplePredicateBuilder { * @return never {@literal null}. */ public static Predicate getPredicate(Root root, CriteriaBuilder cb, Example example, - EscapeCharacter escapeCharacter) { + EscapeCharacter escapeCharacter) { Assert.notNull(root, "Root must not be null!"); Assert.notNull(cb, "CriteriaBuilder must not be null!"); diff --git a/src/main/java/org/springframework/data/jpa/repository/support/CrudMethodMetadataPostProcessor.java b/src/main/java/org/springframework/data/jpa/repository/support/CrudMethodMetadataPostProcessor.java index 28614f5d0..6b373f541 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/CrudMethodMetadataPostProcessor.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/CrudMethodMetadataPostProcessor.java @@ -30,7 +30,6 @@ import javax.persistence.QueryHint; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; - import org.springframework.aop.Advisor; import org.springframework.aop.TargetSource; import org.springframework.aop.framework.ProxyFactory; @@ -90,7 +89,7 @@ class CrudMethodMetadataPostProcessor implements RepositoryProxyPostProcessor, B * Returns a {@link CrudMethodMetadata} proxy that will lookup the actual target object by obtaining a thread bound * instance from the {@link TransactionSynchronizationManager} later. */ - public CrudMethodMetadata getCrudMethodMetadata() { + CrudMethodMetadata getCrudMethodMetadata() { ProxyFactory factory = new ProxyFactory(); @@ -112,7 +111,7 @@ class CrudMethodMetadataPostProcessor implements RepositoryProxyPostProcessor, B INSTANCE; - private final ConcurrentMap metadataCache = new ConcurrentHashMap(); + private final ConcurrentMap metadataCache = new ConcurrentHashMap<>(); /* * (non-Javadoc) @@ -192,7 +191,7 @@ class CrudMethodMetadataPostProcessor implements RepositoryProxyPostProcessor, B private static Map findQueryHints(Method method, Predicate annotationFilter) { - Map queryHints = new HashMap(); + Map queryHints = new HashMap<>(); QueryHints queryHintsAnnotation = AnnotatedElementUtils.findMergedAnnotation(method, QueryHints.class); if (queryHintsAnnotation != null && annotationFilter.test(queryHintsAnnotation)) { @@ -283,7 +282,7 @@ class CrudMethodMetadataPostProcessor implements RepositoryProxyPostProcessor, B * @see org.springframework.aop.TargetSource#getTarget() */ @Override - public Object getTarget() throws Exception { + public Object getTarget() { MethodInvocation invocation = ExposeRepositoryInvocationInterceptor.currentInvocation(); return TransactionSynchronizationManager.getResource(invocation.getMethod()); @@ -294,7 +293,7 @@ class CrudMethodMetadataPostProcessor implements RepositoryProxyPostProcessor, B * @see org.springframework.aop.TargetSource#releaseTarget(java.lang.Object) */ @Override - public void releaseTarget(Object target) throws Exception {} + public void releaseTarget(Object target) {} } /** @@ -302,7 +301,7 @@ class CrudMethodMetadataPostProcessor implements RepositoryProxyPostProcessor, B * {@link ExposeInvocationInterceptor} that might expose nested proxy calls to e.g. proxied transaction managers. * * @author Mark Paluch - * @since 1.11.13 + * @since 2.2.0 * @see ExposeInvocationInterceptor */ @SuppressWarnings("serial")