Fix various compiler warnings in spring-context
All warning types other than [deprecation] and [unchecked] are now fixed in spring-context/src/test
This commit is contained in:
parent
4c7cafbde6
commit
40357be72b
|
@ -40,8 +40,7 @@ public class ServiceInvocationCounter {
|
|||
@Before("serviceExecution()")
|
||||
public void countUse() {
|
||||
this.useCount++;
|
||||
this.threadLocalCount.set(this.useCount);
|
||||
System.out.println("");
|
||||
threadLocalCount.set(this.useCount);
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
|
|
|
@ -70,8 +70,8 @@ public class SimpleMapScope implements Scope, Serializable {
|
|||
}
|
||||
|
||||
public void close() {
|
||||
for (Iterator it = this.callbacks.iterator(); it.hasNext();) {
|
||||
Runnable runnable = (Runnable) it.next();
|
||||
for (Iterator<Runnable> it = this.callbacks.iterator(); it.hasNext();) {
|
||||
Runnable runnable = it.next();
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,14 +99,11 @@ public class ConfigurationClassAndBFPPTests {
|
|||
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("static-access")
|
||||
public void staticBeanMethodsDoNotRespectScoping() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(ConfigWithStaticBeanMethod.class);
|
||||
ctx.refresh();
|
||||
|
||||
ConfigWithStaticBeanMethod config = ctx.getBean(ConfigWithStaticBeanMethod.class);
|
||||
assertThat(config.testBean(), not(sameInstance(config.testBean())));
|
||||
assertThat(ConfigWithStaticBeanMethod.testBean(), not(sameInstance(ConfigWithStaticBeanMethod.testBean())));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1444,7 +1444,6 @@ public class DataBinderTests extends TestCase {
|
|||
assertEquals("badName", nameError.getCode());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testBindingWithResortedList() {
|
||||
IndexedTestBean tb = new IndexedTestBean();
|
||||
DataBinder binder = new DataBinder(tb, "tb");
|
||||
|
@ -1590,6 +1589,7 @@ public class DataBinderTests extends TestCase {
|
|||
mpv.add("f[list][1]", "secondValue");
|
||||
binder.bind(mpv);
|
||||
assertFalse(binder.getBindingResult().hasErrors());
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Object> list = (List<Object>) form.getF().get("list");
|
||||
assertEquals("firstValue", list.get(0));
|
||||
assertEquals("secondValue", list.get(1));
|
||||
|
|
Loading…
Reference in New Issue