DATAJPA-1368 - Polishing.

Removed superfluous import, throws declaration and public modifiers.
Uses <> operator where applicable.

Original pull request: #280.
This commit is contained in:
Jens Schauder
2019-07-02 14:02:46 +02:00
parent a1ad978c62
commit e7b4233e25
2 changed files with 7 additions and 9 deletions

View File

@@ -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 <T> Predicate getPredicate(Root<T> root, CriteriaBuilder cb, Example<T> example,
EscapeCharacter escapeCharacter) {
EscapeCharacter escapeCharacter) {
Assert.notNull(root, "Root must not be null!");
Assert.notNull(cb, "CriteriaBuilder must not be null!");

View File

@@ -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<Method, CrudMethodMetadata> metadataCache = new ConcurrentHashMap<Method, CrudMethodMetadata>();
private final ConcurrentMap<Method, CrudMethodMetadata> metadataCache = new ConcurrentHashMap<>();
/*
* (non-Javadoc)
@@ -192,7 +191,7 @@ class CrudMethodMetadataPostProcessor implements RepositoryProxyPostProcessor, B
private static Map<String, Object> findQueryHints(Method method, Predicate<QueryHints> annotationFilter) {
Map<String, Object> queryHints = new HashMap<String, Object>();
Map<String, Object> 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")