INT-3632: Sonar Improvements
JIRA: https://jira.spring.io/browse/INT-3632 - Use Map.entrySet() - Double check locking only works when the field(s) are volatile - Remove unnecessary instanceof tests
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -107,7 +107,8 @@ public abstract class TestUtils {
|
||||
ConfigurableListableBeanFactory configurableListableBeanFactory = null;
|
||||
if (beanFactory instanceof ConfigurableListableBeanFactory) {
|
||||
configurableListableBeanFactory = (ConfigurableListableBeanFactory) beanFactory;
|
||||
} else if (beanFactory instanceof GenericApplicationContext) {
|
||||
}
|
||||
else if (beanFactory instanceof GenericApplicationContext) {
|
||||
configurableListableBeanFactory = ((GenericApplicationContext) beanFactory).getBeanFactory();
|
||||
}
|
||||
if (bean instanceof BeanNameAware) {
|
||||
@@ -124,7 +125,7 @@ public abstract class TestUtils {
|
||||
throw new FatalBeanException("failed to register bean with test context", e);
|
||||
}
|
||||
}
|
||||
configurableListableBeanFactory.registerSingleton(beanName, bean);
|
||||
configurableListableBeanFactory.registerSingleton(beanName, bean);//NOSONAR false positive
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user