SpotBugs Bug Detector Report

The following document contains the results of SpotBugs

SpotBugs Version is 4.7.3

Threshold is medium

Effort is default

Summary

Classes Bugs Errors Missing Classes
87 48 0 0

Files

Class Bugs
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecuteEngine 4
org.apache.shardingsphere.distsql.handler.engine.update.DistSQLUpdateExecuteEngine 2
org.apache.shardingsphere.distsql.handler.engine.update.rule.database.DatabaseRuleDefinitionExecuteEngine 2
org.apache.shardingsphere.distsql.handler.engine.update.rule.global.GlobalRuleDefinitionExecuteEngine 1
org.apache.shardingsphere.distsql.handler.executor.configuration.export.DatabaseExportMetaDataGenerator 3
org.apache.shardingsphere.distsql.handler.executor.configuration.export.DatabaseExportMetaDataGenerator$1 1
org.apache.shardingsphere.distsql.handler.executor.configuration.export.ExportDatabaseConfigurationExecutor 1
org.apache.shardingsphere.distsql.handler.executor.configuration.export.ExportMetaDataExecutor 1
org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedClusterInfo 4
org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedMetaData 2
org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedStorageNodes 2
org.apache.shardingsphere.distsql.handler.executor.configuration.imports.ImportMetaDataExecutor 1
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlDataSourceConfiguration 2
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlDatabaseConfiguration 4
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlExportedServerConfiguration 4
org.apache.shardingsphere.distsql.handler.executor.metadata.RefreshTableMetaDataExecutor 1
org.apache.shardingsphere.distsql.handler.executor.metadata.ShowTableMetaDataExecutor 1
org.apache.shardingsphere.distsql.handler.executor.preview.PreviewExecutor 1
org.apache.shardingsphere.distsql.handler.executor.resource.AlterStorageUnitExecutor 1
org.apache.shardingsphere.distsql.handler.executor.resource.RegisterStorageUnitExecutor 1
org.apache.shardingsphere.distsql.handler.executor.resource.ShowLogicalTablesExecutor 1
org.apache.shardingsphere.distsql.handler.executor.resource.ShowRulesUsedStorageUnitExecutor 1
org.apache.shardingsphere.distsql.handler.executor.resource.ShowStorageUnitExecutor 1
org.apache.shardingsphere.distsql.handler.executor.resource.UnregisterStorageUnitExecutor 1
org.apache.shardingsphere.distsql.handler.executor.rule.RuleCountExecutor 1
org.apache.shardingsphere.distsql.handler.executor.variable.ShowDistVariableExecutor 1
org.apache.shardingsphere.distsql.handler.executor.variable.ShowDistVariablesExecutor 1
org.apache.shardingsphere.distsql.handler.util.ExportUtils 2

org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecuteEngine

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecuteEngine.getColumnNames() may expose internal representation by returning DistSQLQueryExecuteEngine.columnNames MALICIOUS_CODE EI_EXPOSE_REP 48 Medium
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecuteEngine.getRows() may expose internal representation by returning DistSQLQueryExecuteEngine.rows MALICIOUS_CODE EI_EXPOSE_REP 51 Medium
new org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecuteEngine(DistSQLStatement, String, ContextManager, DistSQLConnectionContext) may expose internal representation by storing an externally mutable object into DistSQLQueryExecuteEngine.distsqlConnectionContext MALICIOUS_CODE EI_EXPOSE_REP2 58 Medium
new org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecuteEngine(DistSQLStatement, String, ContextManager, DistSQLConnectionContext) may expose internal representation by storing an externally mutable object into DistSQLQueryExecuteEngine.sqlStatement MALICIOUS_CODE EI_EXPOSE_REP2 56 Medium

org.apache.shardingsphere.distsql.handler.engine.update.DistSQLUpdateExecuteEngine

Bug Category Details Line Priority
new org.apache.shardingsphere.distsql.handler.engine.update.DistSQLUpdateExecuteEngine(DistSQLStatement, String, ContextManager, DistSQLConnectionContext) may expose internal representation by storing an externally mutable object into DistSQLUpdateExecuteEngine.distsqlConnectionContext MALICIOUS_CODE EI_EXPOSE_REP2 61 Medium
new org.apache.shardingsphere.distsql.handler.engine.update.DistSQLUpdateExecuteEngine(DistSQLStatement, String, ContextManager, DistSQLConnectionContext) may expose internal representation by storing an externally mutable object into DistSQLUpdateExecuteEngine.sqlStatement MALICIOUS_CODE EI_EXPOSE_REP2 58 Medium

org.apache.shardingsphere.distsql.handler.engine.update.rule.database.DatabaseRuleDefinitionExecuteEngine

Bug Category Details Line Priority
new org.apache.shardingsphere.distsql.handler.engine.update.rule.database.DatabaseRuleDefinitionExecuteEngine(DatabaseRuleDefinitionStatement, ContextManager, ShardingSphereDatabase, DatabaseRuleDefinitionExecutor) may expose internal representation by storing an externally mutable object into DatabaseRuleDefinitionExecuteEngine.database MALICIOUS_CODE EI_EXPOSE_REP2 35 Medium
new org.apache.shardingsphere.distsql.handler.engine.update.rule.database.DatabaseRuleDefinitionExecuteEngine(DatabaseRuleDefinitionStatement, ContextManager, ShardingSphereDatabase, DatabaseRuleDefinitionExecutor) may expose internal representation by storing an externally mutable object into DatabaseRuleDefinitionExecuteEngine.sqlStatement MALICIOUS_CODE EI_EXPOSE_REP2 35 Medium

org.apache.shardingsphere.distsql.handler.engine.update.rule.global.GlobalRuleDefinitionExecuteEngine

Bug Category Details Line Priority
new org.apache.shardingsphere.distsql.handler.engine.update.rule.global.GlobalRuleDefinitionExecuteEngine(GlobalRuleDefinitionStatement, ContextManager, GlobalRuleDefinitionExecutor) may expose internal representation by storing an externally mutable object into GlobalRuleDefinitionExecuteEngine.sqlStatement MALICIOUS_CODE EI_EXPOSE_REP2 28 Medium

org.apache.shardingsphere.distsql.handler.executor.configuration.export.DatabaseExportMetaDataGenerator

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.configuration.export.DatabaseExportMetaDataGenerator.appendDataSourceConfigurations(ShardingSphereDatabase, StringBuilder) invokes inefficient new String(String) constructor PERFORMANCE DM_STRING_CTOR 80 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.export.DatabaseExportMetaDataGenerator.createDataSourceConfiguration(DataSourcePoolProperties) invokes inefficient new String(String) constructor PERFORMANCE DM_STRING_CTOR 89 Medium
new org.apache.shardingsphere.distsql.handler.executor.configuration.export.DatabaseExportMetaDataGenerator(ShardingSphereDatabase) may expose internal representation by storing an externally mutable object into DatabaseExportMetaDataGenerator.database MALICIOUS_CODE EI_EXPOSE_REP2 51 Medium

org.apache.shardingsphere.distsql.handler.executor.configuration.export.DatabaseExportMetaDataGenerator$1

Bug Category Details Line Priority
Comparison of String parameter using == or != in org.apache.shardingsphere.distsql.handler.executor.configuration.export.DatabaseExportMetaDataGenerator$1.write(String, int, int) BAD_PRACTICE ES_COMPARING_PARAMETER_STRING_WITH_EQ 112 High

org.apache.shardingsphere.distsql.handler.executor.configuration.export.ExportDatabaseConfigurationExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.configuration.export.ExportDatabaseConfigurationExecutor.setDatabase(ShardingSphereDatabase) may expose internal representation by storing an externally mutable object into ExportDatabaseConfigurationExecutor.database MALICIOUS_CODE EI_EXPOSE_REP2 35 Medium

org.apache.shardingsphere.distsql.handler.executor.configuration.export.ExportMetaDataExecutor

Bug Category Details Line Priority
Found reliance on default encoding in org.apache.shardingsphere.distsql.handler.executor.configuration.export.ExportMetaDataExecutor.getRows(ExportMetaDataStatement, ContextManager): String.getBytes() I18N DM_DEFAULT_ENCODING 51 High

org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedClusterInfo

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedClusterInfo.getMetaData() may expose internal representation by returning ExportedClusterInfo.metaData MALICIOUS_CODE EI_EXPOSE_REP 33 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedClusterInfo.getSnapshotInfo() may expose internal representation by returning ExportedClusterInfo.snapshotInfo MALICIOUS_CODE EI_EXPOSE_REP 36 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedClusterInfo.setMetaData(ExportedMetaData) may expose internal representation by storing an externally mutable object into ExportedClusterInfo.metaData MALICIOUS_CODE EI_EXPOSE_REP2 29 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedClusterInfo.setSnapshotInfo(ExportedSnapshotInfo) may expose internal representation by storing an externally mutable object into ExportedClusterInfo.snapshotInfo MALICIOUS_CODE EI_EXPOSE_REP2 29 Medium

org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedMetaData

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedMetaData.getDatabases() may expose internal representation by returning ExportedMetaData.databases MALICIOUS_CODE EI_EXPOSE_REP 32 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedMetaData.setDatabases(Map) may expose internal representation by storing an externally mutable object into ExportedMetaData.databases MALICIOUS_CODE EI_EXPOSE_REP2 29 Medium

org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedStorageNodes

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedStorageNodes.getStorageNodes() may expose internal representation by returning ExportedStorageNodes.storageNodes MALICIOUS_CODE EI_EXPOSE_REP 36 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.export.model.ExportedStorageNodes.setStorageNodes(Map) may expose internal representation by storing an externally mutable object into ExportedStorageNodes.storageNodes MALICIOUS_CODE EI_EXPOSE_REP2 32 Medium

org.apache.shardingsphere.distsql.handler.executor.configuration.imports.ImportMetaDataExecutor

Bug Category Details Line Priority
Found reliance on default encoding in org.apache.shardingsphere.distsql.handler.executor.configuration.imports.ImportMetaDataExecutor.getMetaDataFromConsole(ImportMetaDataStatement): new String(byte[]) I18N DM_DEFAULT_ENCODING 60 High

org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlDataSourceConfiguration

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlDataSourceConfiguration.getCustomPoolProps() may expose internal representation by returning YamlDataSourceConfiguration.customPoolProps MALICIOUS_CODE EI_EXPOSE_REP 55 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlDataSourceConfiguration.setCustomPoolProps(Properties) may expose internal representation by storing an externally mutable object into YamlDataSourceConfiguration.customPoolProps MALICIOUS_CODE EI_EXPOSE_REP2 30 Medium

org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlDatabaseConfiguration

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlDatabaseConfiguration.getDataSources() may expose internal representation by returning YamlDatabaseConfiguration.dataSources MALICIOUS_CODE EI_EXPOSE_REP 39 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlDatabaseConfiguration.getRules() may expose internal representation by returning YamlDatabaseConfiguration.rules MALICIOUS_CODE EI_EXPOSE_REP 41 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlDatabaseConfiguration.setDataSources(Map) may expose internal representation by storing an externally mutable object into YamlDatabaseConfiguration.dataSources MALICIOUS_CODE EI_EXPOSE_REP2 34 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlDatabaseConfiguration.setRules(Collection) may expose internal representation by storing an externally mutable object into YamlDatabaseConfiguration.rules MALICIOUS_CODE EI_EXPOSE_REP2 34 Medium

org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlExportedServerConfiguration

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlExportedServerConfiguration.getProps() may expose internal representation by returning YamlExportedServerConfiguration.props MALICIOUS_CODE EI_EXPOSE_REP 36 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlExportedServerConfiguration.getRules() may expose internal representation by returning YamlExportedServerConfiguration.rules MALICIOUS_CODE EI_EXPOSE_REP 34 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlExportedServerConfiguration.setProps(Properties) may expose internal representation by storing an externally mutable object into YamlExportedServerConfiguration.props MALICIOUS_CODE EI_EXPOSE_REP2 56 Medium
org.apache.shardingsphere.distsql.handler.executor.configuration.yaml.YamlExportedServerConfiguration.setRules(Collection) may expose internal representation by storing an externally mutable object into YamlExportedServerConfiguration.rules MALICIOUS_CODE EI_EXPOSE_REP2 45 Medium

org.apache.shardingsphere.distsql.handler.executor.metadata.RefreshTableMetaDataExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.metadata.RefreshTableMetaDataExecutor.setDatabase(ShardingSphereDatabase) may expose internal representation by storing an externally mutable object into RefreshTableMetaDataExecutor.database MALICIOUS_CODE EI_EXPOSE_REP2 41 Medium

org.apache.shardingsphere.distsql.handler.executor.metadata.ShowTableMetaDataExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.metadata.ShowTableMetaDataExecutor.setDatabase(ShardingSphereDatabase) may expose internal representation by storing an externally mutable object into ShowTableMetaDataExecutor.database MALICIOUS_CODE EI_EXPOSE_REP2 42 Medium

org.apache.shardingsphere.distsql.handler.executor.preview.PreviewExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.preview.PreviewExecutor.setConnectionContext(DistSQLConnectionContext) may expose internal representation by storing an externally mutable object into PreviewExecutor.connectionContext MALICIOUS_CODE EI_EXPOSE_REP2 56 Medium

org.apache.shardingsphere.distsql.handler.executor.resource.AlterStorageUnitExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.resource.AlterStorageUnitExecutor.setDatabase(ShardingSphereDatabase) may expose internal representation by storing an externally mutable object into AlterStorageUnitExecutor.database MALICIOUS_CODE EI_EXPOSE_REP2 54 Medium

org.apache.shardingsphere.distsql.handler.executor.resource.RegisterStorageUnitExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.resource.RegisterStorageUnitExecutor.setDatabase(ShardingSphereDatabase) may expose internal representation by storing an externally mutable object into RegisterStorageUnitExecutor.database MALICIOUS_CODE EI_EXPOSE_REP2 46 Medium

org.apache.shardingsphere.distsql.handler.executor.resource.ShowLogicalTablesExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.resource.ShowLogicalTablesExecutor.setDatabase(ShardingSphereDatabase) may expose internal representation by storing an externally mutable object into ShowLogicalTablesExecutor.database MALICIOUS_CODE EI_EXPOSE_REP2 44 Medium

org.apache.shardingsphere.distsql.handler.executor.resource.ShowRulesUsedStorageUnitExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.resource.ShowRulesUsedStorageUnitExecutor.setDatabase(ShardingSphereDatabase) may expose internal representation by storing an externally mutable object into ShowRulesUsedStorageUnitExecutor.database MALICIOUS_CODE EI_EXPOSE_REP2 41 Medium

org.apache.shardingsphere.distsql.handler.executor.resource.ShowStorageUnitExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.resource.ShowStorageUnitExecutor.setDatabase(ShardingSphereDatabase) may expose internal representation by storing an externally mutable object into ShowStorageUnitExecutor.database MALICIOUS_CODE EI_EXPOSE_REP2 49 Medium

org.apache.shardingsphere.distsql.handler.executor.resource.UnregisterStorageUnitExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.resource.UnregisterStorageUnitExecutor.setDatabase(ShardingSphereDatabase) may expose internal representation by storing an externally mutable object into UnregisterStorageUnitExecutor.database MALICIOUS_CODE EI_EXPOSE_REP2 45 Medium

org.apache.shardingsphere.distsql.handler.executor.rule.RuleCountExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.rule.RuleCountExecutor.setDatabase(ShardingSphereDatabase) may expose internal representation by storing an externally mutable object into RuleCountExecutor.database MALICIOUS_CODE EI_EXPOSE_REP2 39 Medium

org.apache.shardingsphere.distsql.handler.executor.variable.ShowDistVariableExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.variable.ShowDistVariableExecutor.setConnectionContext(DistSQLConnectionContext) may expose internal representation by storing an externally mutable object into ShowDistVariableExecutor.connectionContext MALICIOUS_CODE EI_EXPOSE_REP2 41 Medium

org.apache.shardingsphere.distsql.handler.executor.variable.ShowDistVariablesExecutor

Bug Category Details Line Priority
org.apache.shardingsphere.distsql.handler.executor.variable.ShowDistVariablesExecutor.setConnectionContext(DistSQLConnectionContext) may expose internal representation by storing an externally mutable object into ShowDistVariablesExecutor.connectionContext MALICIOUS_CODE EI_EXPOSE_REP2 43 Medium

org.apache.shardingsphere.distsql.handler.util.ExportUtils

Bug Category Details Line Priority
Found reliance on default encoding in org.apache.shardingsphere.distsql.handler.util.ExportUtils.exportToFile(String, String): String.getBytes() I18N DM_DEFAULT_ENCODING 50 High
Exceptional return value of java.io.File.mkdirs() ignored in org.apache.shardingsphere.distsql.handler.util.ExportUtils.exportToFile(String, String) BAD_PRACTICE RV_RETURN_VALUE_IGNORED_BAD_PRACTICE 47 Medium