Suppress warnings, remove unused code, etc.

This commit is contained in:
Sam Brannen
2020-06-20 16:42:36 +02:00
parent 2f0970b184
commit 9d5881e0ad
53 changed files with 418 additions and 449 deletions

View File

@@ -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.
@@ -17,6 +17,7 @@
package org.springframework.dao.support;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
@@ -119,14 +120,11 @@ public class DataAccessUtilsTests {
}
@Test
@SuppressWarnings("deprecation") // on JDK 9
public void withEquivalentIntegerInstanceTwice() {
Collection<Integer> col = new ArrayList<>(2);
col.add(new Integer(5));
col.add(new Integer(5));
Collection<Integer> col = Arrays.asList(Integer.valueOf(555), Integer.valueOf(555));
assertThatExceptionOfType(IncorrectResultSizeDataAccessException.class).isThrownBy(() ->
DataAccessUtils.uniqueResult(col))
assertThatExceptionOfType(IncorrectResultSizeDataAccessException.class)
.isThrownBy(() -> DataAccessUtils.uniqueResult(col))
.satisfies(sizeRequirements(1, 2));
}

View File

@@ -32,6 +32,7 @@ import org.springframework.aop.framework.Advised;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.testfixture.io.SerializationTestUtils;
import org.springframework.transaction.TransactionManager;
import org.springframework.transaction.interceptor.NoRollbackRuleAttribute;
import org.springframework.transaction.interceptor.RollbackRuleAttribute;
import org.springframework.transaction.interceptor.RuleBasedTransactionAttribute;
@@ -54,7 +55,7 @@ public class AnnotationTransactionAttributeSourceTests {
TestBean1 tb = new TestBean1();
CallCountingTransactionManager ptm = new CallCountingTransactionManager();
AnnotationTransactionAttributeSource tas = new AnnotationTransactionAttributeSource();
TransactionInterceptor ti = new TransactionInterceptor(ptm, tas);
TransactionInterceptor ti = new TransactionInterceptor((TransactionManager) ptm, tas);
ProxyFactory proxyFactory = new ProxyFactory();
proxyFactory.setInterfaces(ITestBean1.class);

View File

@@ -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.
@@ -25,6 +25,7 @@ import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.transaction.TransactionManager;
import org.springframework.transaction.interceptor.TransactionInterceptor;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.transaction.testfixture.CallCountingTransactionManager;
@@ -48,7 +49,7 @@ public class AnnotationTransactionInterceptorTests {
private final AnnotationTransactionAttributeSource source = new AnnotationTransactionAttributeSource();
private final TransactionInterceptor ti = new TransactionInterceptor(this.ptm, this.source);
private final TransactionInterceptor ti = new TransactionInterceptor((TransactionManager) this.ptm, this.source);
@Test