Clean up warnings in Gradle build, polishing, etc.
This commit is contained in:
parent
bc9b9bc477
commit
b33d2fe683
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -198,8 +198,8 @@ public class AspectJExpressionPointcutTests {
|
|||
// not currently testable in a reliable fashion
|
||||
//assertDoesNotMatchStringClass(classFilter);
|
||||
|
||||
assertThat(methodMatcher.matches(setSomeNumber, TestBean.class, new Double(12))).as("Should match with setSomeNumber with Double input").isTrue();
|
||||
assertThat(methodMatcher.matches(setSomeNumber, TestBean.class, new Integer(11))).as("Should not match setSomeNumber with Integer input").isFalse();
|
||||
assertThat(methodMatcher.matches(setSomeNumber, TestBean.class, 12D)).as("Should match with setSomeNumber with Double input").isTrue();
|
||||
assertThat(methodMatcher.matches(setSomeNumber, TestBean.class, 11)).as("Should not match setSomeNumber with Integer input").isFalse();
|
||||
assertThat(methodMatcher.matches(getAge, TestBean.class)).as("Should not match getAge").isFalse();
|
||||
assertThat(methodMatcher.isRuntime()).as("Should be a runtime match").isTrue();
|
||||
}
|
||||
|
|
@ -224,10 +224,10 @@ public class AspectJExpressionPointcutTests {
|
|||
TestBean testBean = getAdvisedProxy(expression, interceptor);
|
||||
|
||||
assertThat(interceptor.getCount()).as("Calls should be 0").isEqualTo(0);
|
||||
testBean.setSomeNumber(new Double(30));
|
||||
testBean.setSomeNumber(30D);
|
||||
assertThat(interceptor.getCount()).as("Calls should be 1").isEqualTo(1);
|
||||
|
||||
testBean.setSomeNumber(new Integer(90));
|
||||
testBean.setSomeNumber(90);
|
||||
assertThat(interceptor.getCount()).as("Calls should be 1").isEqualTo(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -91,9 +91,8 @@ public class TrickyAspectJPointcutExpressionTests {
|
|||
// Make sure the interface is loaded from the parent class loader
|
||||
loader.excludeClass(TestService.class.getName());
|
||||
loader.excludeClass(TestException.class.getName());
|
||||
TestService other = (TestService) loader.loadClass(TestServiceImpl.class.getName()).newInstance();
|
||||
TestService other = (TestService) loader.loadClass(TestServiceImpl.class.getName()).getDeclaredConstructor().newInstance();
|
||||
testAdvice(new DefaultPointcutAdvisor(pointcut, logAdvice), logAdvice, other, "TestServiceImpl");
|
||||
|
||||
}
|
||||
|
||||
private void testAdvice(Advisor advisor, LogUserAdvice logAdvice, TestService target, String message)
|
||||
|
|
@ -127,7 +126,6 @@ public class TrickyAspectJPointcutExpressionTests {
|
|||
public SimpleThrowawayClassLoader(ClassLoader parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ public class AspectProxyFactoryTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testSerializable() throws Exception {
|
||||
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(new TestBean());
|
||||
proxyFactory.addAspect(LoggingAspectOnVarargs.class);
|
||||
|
|
@ -114,11 +115,11 @@ public class AspectProxyFactoryTests {
|
|||
@Test
|
||||
public void testWithNonSingletonAspectInstance() throws Exception {
|
||||
AspectJProxyFactory pf = new AspectJProxyFactory();
|
||||
assertThatIllegalArgumentException().isThrownBy(() ->
|
||||
pf.addAspect(new PerThisAspect()));
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> pf.addAspect(new PerThisAspect()));
|
||||
}
|
||||
|
||||
@Test // SPR-13328
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testProxiedVarargsWithEnumArray() throws Exception {
|
||||
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(new TestBean());
|
||||
proxyFactory.addAspect(LoggingAspectOnVarargs.class);
|
||||
|
|
@ -127,6 +128,7 @@ public class AspectProxyFactoryTests {
|
|||
}
|
||||
|
||||
@Test // SPR-13328
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testUnproxiedVarargsWithEnumArray() throws Exception {
|
||||
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(new TestBean());
|
||||
proxyFactory.addAspect(LoggingAspectOnSetter.class);
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ public class CustomizableTraceInterceptorTests {
|
|||
|
||||
given(methodInvocation.getMethod()).willReturn(String.class.getMethod("toString", new Class[0]));
|
||||
given(methodInvocation.getThis()).willReturn(this);
|
||||
given(methodInvocation.getArguments()).willReturn(new Object[]{"$ One \\$", new Long(2)});
|
||||
given(methodInvocation.getArguments()).willReturn(new Object[]{"$ One \\$", 2L});
|
||||
given(methodInvocation.proceed()).willReturn("Hello!");
|
||||
|
||||
Log log = mock(Log.class);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -44,7 +44,6 @@ public abstract class SqlParameterSourceUtils {
|
|||
* @see BeanPropertySqlParameterSource
|
||||
* @see NamedParameterJdbcTemplate#batchUpdate(String, SqlParameterSource[])
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static SqlParameterSource[] createBatch(Object... candidates) {
|
||||
return createBatch(Arrays.asList(candidates));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,10 +71,9 @@ import org.springframework.util.StringUtils;
|
|||
* {@link SocketAcceptor} adapter to register with the
|
||||
* {@link io.rsocket.core.RSocketServer}.
|
||||
*
|
||||
* <p>For a client, possibly in the same process as a server, consider
|
||||
* consider using the static factory method
|
||||
* {@link #responder(RSocketStrategies, Object...)} to obtain a client
|
||||
* responder to be registered via
|
||||
* <p>For a client, possibly in the same process as a server, consider using the
|
||||
* static factory method {@link #responder(RSocketStrategies, Object...)} to
|
||||
* obtain a client responder to be registered via
|
||||
* {@link org.springframework.messaging.rsocket.RSocketRequester.Builder#rsocketConnector
|
||||
* RSocketRequester.Builder}.
|
||||
*
|
||||
|
|
@ -500,8 +499,8 @@ public class RSocketMessageHandler extends MessageMappingMessageHandler {
|
|||
* annotated handler methods. This is intended to be passed into
|
||||
* {@link org.springframework.messaging.rsocket.RSocketRequester.Builder#rsocketFactory}.
|
||||
* <p>In effect a shortcut to create and initialize
|
||||
* {@code RSocketMessageHandler} with the given strategies and handlers,
|
||||
* use {@link #responder()} to obtain the responder, and plug that into
|
||||
* {@code RSocketMessageHandler} with the given strategies and handlers.
|
||||
* Use {@link #responder()} to obtain the responder and plug that into
|
||||
* {@link io.rsocket.RSocketFactory.ClientRSocketFactory ClientRSocketFactory}.
|
||||
* For more advanced scenarios, e.g. discovering handlers through a custom
|
||||
* stereotype annotation, consider declaring {@code RSocketMessageHandler}
|
||||
|
|
@ -509,15 +508,16 @@ public class RSocketMessageHandler extends MessageMappingMessageHandler {
|
|||
* @param strategies the strategies to set on the created
|
||||
* {@code RSocketMessageHandler}
|
||||
* @param candidateHandlers a list of Objects and/or Classes with annotated
|
||||
* handler methods; used to call {@link #setHandlers(List)} with
|
||||
* on the created {@code RSocketMessageHandler}
|
||||
* handler methods; used to call {@link #setHandlers(List)} on the created
|
||||
* {@code RSocketMessageHandler}
|
||||
* @return a configurer that may be passed into
|
||||
* {@link org.springframework.messaging.rsocket.RSocketRequester.Builder#rsocketFactory}
|
||||
* @deprecated as of 5.2.6 following the deprecation of
|
||||
* @deprecated as of 5.2.6 following the deprecation of
|
||||
* {@link io.rsocket.RSocketFactory.ClientRSocketFactory RSocketFactory.ClientRSocketFactory}
|
||||
* in RSocket 1.0 RC7.
|
||||
* in RSocket 1.0 RC7
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("deprecation")
|
||||
public static org.springframework.messaging.rsocket.ClientRSocketFactoryConfigurer clientResponder(
|
||||
RSocketStrategies strategies, Object... candidateHandlers) {
|
||||
|
||||
|
|
@ -536,5 +536,3 @@ public class RSocketMessageHandler extends MessageMappingMessageHandler {
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
* Set the Hibernate SessionFactory that should be used to create
|
||||
* Hibernate Sessions.
|
||||
*/
|
||||
public void setSessionFactory(@Nullable SessionFactory sessionFactory) {
|
||||
public void setSessionFactory(@Nullable SessionFactory sessionFactory) {
|
||||
this.sessionFactory = sessionFactory;
|
||||
}
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
* @see #enableFilters(Session)
|
||||
* @see Session#enableFilter(String)
|
||||
*/
|
||||
public void setFilterNames(@Nullable String... filterNames) {
|
||||
public void setFilterNames(@Nullable String... filterNames) {
|
||||
this.filterNames = filterNames;
|
||||
}
|
||||
|
||||
|
|
@ -465,9 +465,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
|
||||
@Override
|
||||
@Nullable
|
||||
public <T> T get(final Class<T> entityClass, final Serializable id, @Nullable final LockMode lockMode)
|
||||
throws DataAccessException {
|
||||
|
||||
public <T> T get(Class<T> entityClass, Serializable id, @Nullable LockMode lockMode) throws DataAccessException {
|
||||
return executeWithNativeSession(session -> {
|
||||
if (lockMode != null) {
|
||||
return session.get(entityClass, id, new LockOptions(lockMode));
|
||||
|
|
@ -486,9 +484,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
|
||||
@Override
|
||||
@Nullable
|
||||
public Object get(final String entityName, final Serializable id, @Nullable final LockMode lockMode)
|
||||
throws DataAccessException {
|
||||
|
||||
public Object get(String entityName, Serializable id, @Nullable LockMode lockMode) throws DataAccessException {
|
||||
return executeWithNativeSession(session -> {
|
||||
if (lockMode != null) {
|
||||
return session.get(entityName, id, new LockOptions(lockMode));
|
||||
|
|
@ -505,7 +501,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public <T> T load(final Class<T> entityClass, final Serializable id, @Nullable final LockMode lockMode)
|
||||
public <T> T load(Class<T> entityClass, Serializable id, @Nullable LockMode lockMode)
|
||||
throws DataAccessException {
|
||||
|
||||
return nonNull(executeWithNativeSession(session -> {
|
||||
|
|
@ -524,9 +520,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object load(final String entityName, final Serializable id, @Nullable final LockMode lockMode)
|
||||
throws DataAccessException {
|
||||
|
||||
public Object load(String entityName, Serializable id, @Nullable LockMode lockMode) throws DataAccessException {
|
||||
return nonNull(executeWithNativeSession(session -> {
|
||||
if (lockMode != null) {
|
||||
return session.load(entityName, id, new LockOptions(lockMode));
|
||||
|
|
@ -539,7 +533,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "deprecation"})
|
||||
public <T> List<T> loadAll(final Class<T> entityClass) throws DataAccessException {
|
||||
public <T> List<T> loadAll(Class<T> entityClass) throws DataAccessException {
|
||||
return nonNull(executeWithNativeSession((HibernateCallback<List<T>>) session -> {
|
||||
Criteria criteria = session.createCriteria(entityClass);
|
||||
criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
|
||||
|
|
@ -550,7 +544,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
|
||||
@Override
|
||||
@SuppressWarnings({"deprecation"})
|
||||
public void load(final Object entity, final Serializable id) throws DataAccessException {
|
||||
public void load(Object entity, Serializable id) throws DataAccessException {
|
||||
executeWithNativeSession(session -> {
|
||||
session.load(entity, id);
|
||||
return null;
|
||||
|
|
@ -558,12 +552,12 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void refresh(final Object entity) throws DataAccessException {
|
||||
public void refresh(Object entity) throws DataAccessException {
|
||||
refresh(entity, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh(final Object entity, @Nullable final LockMode lockMode) throws DataAccessException {
|
||||
public void refresh(Object entity, @Nullable LockMode lockMode) throws DataAccessException {
|
||||
executeWithNativeSession(session -> {
|
||||
if (lockMode != null) {
|
||||
session.refresh(entity, new LockOptions(lockMode));
|
||||
|
|
@ -576,14 +570,14 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(final Object entity) throws DataAccessException {
|
||||
public boolean contains(Object entity) throws DataAccessException {
|
||||
Boolean result = executeWithNativeSession(session -> session.contains(entity));
|
||||
Assert.state(result != null, "No contains result");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evict(final Object entity) throws DataAccessException {
|
||||
public void evict(Object entity) throws DataAccessException {
|
||||
executeWithNativeSession(session -> {
|
||||
session.evict(entity);
|
||||
return null;
|
||||
|
|
@ -616,7 +610,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
//-------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public void lock(final Object entity, final LockMode lockMode) throws DataAccessException {
|
||||
public void lock(Object entity, LockMode lockMode) throws DataAccessException {
|
||||
executeWithNativeSession(session -> {
|
||||
session.buildLockRequest(new LockOptions(lockMode)).lock(entity);
|
||||
return null;
|
||||
|
|
@ -624,7 +618,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void lock(final String entityName, final Object entity, final LockMode lockMode)
|
||||
public void lock(String entityName, Object entity, LockMode lockMode)
|
||||
throws DataAccessException {
|
||||
|
||||
executeWithNativeSession(session -> {
|
||||
|
|
@ -634,7 +628,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public Serializable save(final Object entity) throws DataAccessException {
|
||||
public Serializable save(Object entity) throws DataAccessException {
|
||||
return nonNull(executeWithNativeSession(session -> {
|
||||
checkWriteOperationAllowed(session);
|
||||
return session.save(entity);
|
||||
|
|
@ -642,7 +636,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public Serializable save(final String entityName, final Object entity) throws DataAccessException {
|
||||
public Serializable save(String entityName, Object entity) throws DataAccessException {
|
||||
return nonNull(executeWithNativeSession(session -> {
|
||||
checkWriteOperationAllowed(session);
|
||||
return session.save(entityName, entity);
|
||||
|
|
@ -655,7 +649,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void update(final Object entity, @Nullable final LockMode lockMode) throws DataAccessException {
|
||||
public void update(Object entity, @Nullable LockMode lockMode) throws DataAccessException {
|
||||
executeWithNativeSession(session -> {
|
||||
checkWriteOperationAllowed(session);
|
||||
session.update(entity);
|
||||
|
|
@ -672,7 +666,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void update(final String entityName, final Object entity, @Nullable final LockMode lockMode)
|
||||
public void update(String entityName, Object entity, @Nullable LockMode lockMode)
|
||||
throws DataAccessException {
|
||||
|
||||
executeWithNativeSession(session -> {
|
||||
|
|
@ -686,7 +680,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void saveOrUpdate(final Object entity) throws DataAccessException {
|
||||
public void saveOrUpdate(Object entity) throws DataAccessException {
|
||||
executeWithNativeSession(session -> {
|
||||
checkWriteOperationAllowed(session);
|
||||
session.saveOrUpdate(entity);
|
||||
|
|
@ -695,7 +689,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void saveOrUpdate(final String entityName, final Object entity) throws DataAccessException {
|
||||
public void saveOrUpdate(String entityName, Object entity) throws DataAccessException {
|
||||
executeWithNativeSession(session -> {
|
||||
checkWriteOperationAllowed(session);
|
||||
session.saveOrUpdate(entityName, entity);
|
||||
|
|
@ -704,9 +698,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void replicate(final Object entity, final ReplicationMode replicationMode)
|
||||
throws DataAccessException {
|
||||
|
||||
public void replicate(Object entity, ReplicationMode replicationMode) throws DataAccessException {
|
||||
executeWithNativeSession(session -> {
|
||||
checkWriteOperationAllowed(session);
|
||||
session.replicate(entity, replicationMode);
|
||||
|
|
@ -715,7 +707,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void replicate(final String entityName, final Object entity, final ReplicationMode replicationMode)
|
||||
public void replicate(String entityName, Object entity, ReplicationMode replicationMode)
|
||||
throws DataAccessException {
|
||||
|
||||
executeWithNativeSession(session -> {
|
||||
|
|
@ -726,7 +718,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void persist(final Object entity) throws DataAccessException {
|
||||
public void persist(Object entity) throws DataAccessException {
|
||||
executeWithNativeSession(session -> {
|
||||
checkWriteOperationAllowed(session);
|
||||
session.persist(entity);
|
||||
|
|
@ -735,7 +727,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void persist(final String entityName, final Object entity) throws DataAccessException {
|
||||
public void persist(String entityName, Object entity) throws DataAccessException {
|
||||
executeWithNativeSession(session -> {
|
||||
checkWriteOperationAllowed(session);
|
||||
session.persist(entityName, entity);
|
||||
|
|
@ -745,7 +737,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T merge(final T entity) throws DataAccessException {
|
||||
public <T> T merge(T entity) throws DataAccessException {
|
||||
return nonNull(executeWithNativeSession(session -> {
|
||||
checkWriteOperationAllowed(session);
|
||||
return (T) session.merge(entity);
|
||||
|
|
@ -754,7 +746,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T merge(final String entityName, final T entity) throws DataAccessException {
|
||||
public <T> T merge(String entityName, T entity) throws DataAccessException {
|
||||
return nonNull(executeWithNativeSession(session -> {
|
||||
checkWriteOperationAllowed(session);
|
||||
return (T) session.merge(entityName, entity);
|
||||
|
|
@ -767,7 +759,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void delete(final Object entity, @Nullable final LockMode lockMode) throws DataAccessException {
|
||||
public void delete(Object entity, @Nullable LockMode lockMode) throws DataAccessException {
|
||||
executeWithNativeSession(session -> {
|
||||
checkWriteOperationAllowed(session);
|
||||
if (lockMode != null) {
|
||||
|
|
@ -784,7 +776,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void delete(final String entityName, final Object entity, @Nullable final LockMode lockMode)
|
||||
public void delete(String entityName, Object entity, @Nullable LockMode lockMode)
|
||||
throws DataAccessException {
|
||||
|
||||
executeWithNativeSession(session -> {
|
||||
|
|
@ -798,7 +790,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(final Collection<?> entities) throws DataAccessException {
|
||||
public void deleteAll(Collection<?> entities) throws DataAccessException {
|
||||
executeWithNativeSession(session -> {
|
||||
checkWriteOperationAllowed(session);
|
||||
for (Object entity : entities) {
|
||||
|
|
@ -835,8 +827,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<?> findByCriteria(final DetachedCriteria criteria, final int firstResult, final int maxResults)
|
||||
public List<?> findByCriteria(DetachedCriteria criteria, int firstResult, int maxResults)
|
||||
throws DataAccessException {
|
||||
|
||||
Assert.notNull(criteria, "DetachedCriteria must not be null");
|
||||
|
|
@ -870,8 +861,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "deprecation"})
|
||||
public <T> List<T> findByExample(
|
||||
@Nullable final String entityName, final T exampleEntity, final int firstResult, final int maxResults)
|
||||
public <T> List<T> findByExample(@Nullable String entityName, T exampleEntity, int firstResult, int maxResults)
|
||||
throws DataAccessException {
|
||||
|
||||
Assert.notNull(exampleEntity, "Example entity must not be null");
|
||||
|
|
@ -898,7 +888,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
@Deprecated
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes", "unchecked", "deprecation"})
|
||||
public List<?> find(final String queryString, @Nullable final Object... values) throws DataAccessException {
|
||||
public List<?> find(String queryString, @Nullable Object... values) throws DataAccessException {
|
||||
return nonNull(executeWithNativeSession((HibernateCallback<List<?>>) session -> {
|
||||
org.hibernate.Query queryObject = queryObject(
|
||||
ReflectionUtils.invokeMethod(createQueryMethod, session, queryString));
|
||||
|
|
@ -923,7 +913,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
@Deprecated
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes", "unchecked", "deprecation"})
|
||||
public List<?> findByNamedParam(final String queryString, final String[] paramNames, final Object[] values)
|
||||
public List<?> findByNamedParam(String queryString, String[] paramNames, Object[] values)
|
||||
throws DataAccessException {
|
||||
|
||||
if (paramNames.length != values.length) {
|
||||
|
|
@ -943,8 +933,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
@Deprecated
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes", "unchecked", "deprecation"})
|
||||
public List<?> findByValueBean(final String queryString, final Object valueBean)
|
||||
throws DataAccessException {
|
||||
public List<?> findByValueBean(String queryString, Object valueBean) throws DataAccessException {
|
||||
|
||||
return nonNull(executeWithNativeSession((HibernateCallback<List<?>>) session -> {
|
||||
org.hibernate.Query queryObject = queryObject(
|
||||
|
|
@ -963,7 +952,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
@Deprecated
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes", "unchecked", "deprecation"})
|
||||
public List<?> findByNamedQuery(final String queryName, @Nullable final Object... values) throws DataAccessException {
|
||||
public List<?> findByNamedQuery(String queryName, @Nullable Object... values) throws DataAccessException {
|
||||
return nonNull(executeWithNativeSession((HibernateCallback<List<?>>) session -> {
|
||||
org.hibernate.Query queryObject = queryObject(
|
||||
ReflectionUtils.invokeMethod(getNamedQueryMethod, session, queryName));
|
||||
|
|
@ -989,7 +978,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
@Override
|
||||
@SuppressWarnings({"rawtypes", "unchecked", "deprecation"})
|
||||
public List<?> findByNamedQueryAndNamedParam(
|
||||
final String queryName, @Nullable final String[] paramNames, @Nullable final Object[] values)
|
||||
String queryName, @Nullable String[] paramNames, @Nullable Object[] values)
|
||||
throws DataAccessException {
|
||||
|
||||
if (values != null && (paramNames == null || paramNames.length != values.length)) {
|
||||
|
|
@ -1011,8 +1000,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
@Deprecated
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes", "unchecked", "deprecation"})
|
||||
public List<?> findByNamedQueryAndValueBean(final String queryName, final Object valueBean)
|
||||
throws DataAccessException {
|
||||
public List<?> findByNamedQueryAndValueBean(String queryName, Object valueBean) throws DataAccessException {
|
||||
|
||||
return nonNull(executeWithNativeSession((HibernateCallback<List<?>>) session -> {
|
||||
org.hibernate.Query queryObject = queryObject(
|
||||
|
|
@ -1031,7 +1019,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
@Deprecated
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes", "deprecation"})
|
||||
public Iterator<?> iterate(final String queryString, @Nullable final Object... values) throws DataAccessException {
|
||||
public Iterator<?> iterate(String queryString, @Nullable Object... values) throws DataAccessException {
|
||||
return nonNull(executeWithNativeSession((HibernateCallback<Iterator<?>>) session -> {
|
||||
org.hibernate.Query queryObject = queryObject(
|
||||
ReflectionUtils.invokeMethod(createQueryMethod, session, queryString));
|
||||
|
|
@ -1059,7 +1047,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
|
|||
@Deprecated
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes", "deprecation"})
|
||||
public int bulkUpdate(final String queryString, @Nullable final Object... values) throws DataAccessException {
|
||||
public int bulkUpdate(String queryString, @Nullable Object... values) throws DataAccessException {
|
||||
Integer result = executeWithNativeSession(session -> {
|
||||
org.hibernate.Query queryObject = queryObject(
|
||||
ReflectionUtils.invokeMethod(createQueryMethod, session, queryString));
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import org.junit.jupiter.api.Test;
|
|||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.publisher.Sinks;
|
||||
import reactor.core.publisher.UnicastProcessor;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.codec.StringDecoder;
|
||||
|
|
@ -233,7 +232,8 @@ public class MultipartHttpMessageWriterTests extends AbstractLeakCheckingTests {
|
|||
|
||||
@Test // SPR-16402
|
||||
public void singleSubscriberWithStrings() {
|
||||
UnicastProcessor<String> processor = UnicastProcessor.create();
|
||||
@SuppressWarnings("deprecation")
|
||||
reactor.core.publisher.UnicastProcessor<String> processor = reactor.core.publisher.UnicastProcessor.create();
|
||||
Flux.just("foo", "bar", "baz").subscribe(processor);
|
||||
|
||||
MultipartBodyBuilder bodyBuilder = new MultipartBodyBuilder();
|
||||
|
|
|
|||
|
|
@ -64,10 +64,11 @@ public class ForwardedHeaderFilterTests {
|
|||
|
||||
private final ForwardedHeaderFilter filter = new ForwardedHeaderFilter();
|
||||
|
||||
private MockHttpServletRequest request;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private final MockFilterChain filterChain = new MockFilterChain(new HttpServlet() {});
|
||||
|
||||
private MockHttpServletRequest request;
|
||||
|
||||
|
||||
@BeforeEach
|
||||
@SuppressWarnings("serial")
|
||||
|
|
|
|||
|
|
@ -138,7 +138,6 @@ public class RedirectViewTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("AssertEqualsBetweenInconvertibleTypes")
|
||||
public void flashMap() throws Exception {
|
||||
RedirectView rv = new RedirectView();
|
||||
rv.setUrl("https://url.somewhere.com/path");
|
||||
|
|
|
|||
|
|
@ -304,7 +304,6 @@ public class ScriptTemplateViewTests {
|
|||
assertThat(accessor.getPropertyValue("sharedEngine")).isEqualTo(true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test // gh-23258
|
||||
public void engineSupplierWithNonSharedEngine() {
|
||||
this.configurer.setEngineSupplier(() -> mock(InvocableScriptEngine.class));
|
||||
|
|
|
|||
Loading…
Reference in New Issue