Julian Leichert created OFBIZ-9718:
--------------------------------------
Summary: [FB] Package org.apache.ofbiz.entity.connection
Key: OFBIZ-9718
URL:
https://issues.apache.org/jira/browse/OFBIZ-9718 Project: OFBiz
Issue Type: Sub-task
Affects Versions: Trunk
Reporter: Julian Leichert
Priority: Minor
DBCPConnectionFactory.java:169, SIO_SUPERFLUOUS_INSTANCEOF
- SIO: org.apache.ofbiz.entity.connection.DBCPConnectionFactory.getDataSourceInfo(String) does an unnecessary type check using instanceof operator when it can be determined statically
Type check performed using the instanceof operator where it can be statically determined whether the object is of the type requested.
DBCPConnectionFactory.java:169, BC_VACUOUS_INSTANCEOF
- BC: instanceof will always return true for all nonnull values in org.apache.ofbiz.entity.connection.DBCPConnectionFactory.getDataSourceInfo(String), since all org.apache.ofbiz.entity.connection.DebugManagedDataSource are instances of org.apache.ofbiz.entity.connection.DebugManagedDataSource
This instanceof test will always return true (unless the value being tested is null). Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. If you really want to test the value for being null, perhaps it would be clearer to do better to do a null test rather than an instanceof test.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)