我有Sonar
抱怨代码质量问题。我有一个扩展Spring
类的类,而该类又扩展了其他几个Spring
类。
这种问题有解决方案吗?
声纳报告的问题:
"LOGGER" differs only by case from "logger" in "DaoSupport"
AddressDao.java
@Component
public class AddressDao extends PayhubNamedParameterJdbcDaoSupport {
private static final Logger LOGGER = LoggerFactory.getLogger(AddressDao.class);
...
}
Spring类PayhubNamedParameterJdbcDaoSupport扩展了其他类
PayhubNamedParameterJdbcDaoSupport -> NamedParameterJdbcDaoSupport -> JdbcDaoSupport -> DaoSupport
org.springframework.dao.support.DaoSupport.java
public abstract class DaoSupport implements InitializingBean {
protected final Log logger = LogFactory.getLog(this.getClass());
}
pom.xml
<!-- Spring -->
<spring.version>4.1.7.RELEASE</spring.version>
<!-- Logging -->
<slf4j.version>1.7.6</slf4j.version>
<log4j.slf4j.version>2.0-rc1</log4j.slf4j.version>
<commons.lang3.version>3.3</commons.lang3.version>
<!-- Logging with SLF4J & LogBack -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0-rc1</version>
</dependency>