Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbtype参数枚举化之后,equals方法没改全(druid1.2.1) #4005

Closed
lizongbo opened this issue Oct 27, 2020 · 0 comments
Closed

dbtype参数枚举化之后,equals方法没改全(druid1.2.1) #4005

lizongbo opened this issue Oct 27, 2020 · 0 comments
Assignees
Labels
Milestone

Comments

@lizongbo
Copy link
Collaborator

https://github.com/alibaba/druid/blob/master/src/main/java/com/alibaba/druid/pool/DruidAbstractDataSource.java
第869行
` public void setValidationQueryTimeout(int validationQueryTimeout) {
if (validationQueryTimeout < 0 && JdbcConstants.SQL_SERVER.equals(dbTypeName)) {
LOG.error("validationQueryTimeout should be >= 0");
}
this.validationQueryTimeout = validationQueryTimeout;
}

`
c此时JdbcConstants.SQL_SERVER是个枚举,dbTypeName是字符串类型。
导入druid 1.2.1的源代码,sonarlint扫描提示:
Silly equality checks should not be made (java:S2159)

@wenshao wenshao added this to the 1.2.2 milestone Nov 3, 2020
@wenshao wenshao added the Bug label Nov 3, 2020
@wenshao wenshao self-assigned this Nov 3, 2020
@wenshao wenshao closed this as completed in 10f84b4 Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants