From efb37e38bcb7a9ad32b74bb3fe206ac9f93e8cae Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Tue, 2 Jul 2019 14:02:46 +0200 Subject: [PATCH] DATAJPA-1368 - Polishing. Removed superfluous import, throws declaration and public modifiers. Uses <> operator where applicable. Original pull request: #280. --- .../data/jpa/convert/QueryByExamplePredicateBuilder.java | 2 +- .../support/CrudMethodMetadataPostProcessor.java | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) 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 1a2b71692..469da8823 100644 --- a/src/main/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilder.java +++ b/src/main/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilder.java @@ -88,7 +88,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 06ac632a1..01570a047 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 @@ -28,7 +28,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; @@ -86,7 +85,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(); @@ -266,7 +265,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()); @@ -277,7 +276,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) {} } /** @@ -285,7 +284,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")