SpotBugs Bug Detector Report

The following document contains the results of SpotBugs

SpotBugs Version is 4.5.3

Threshold is medium

Effort is default

Summary

Classes Bugs Errors Missing Classes
3219 80 0 0

Files

Class Bugs
org.tikv.common.MetricsServer 2
org.tikv.common.PDClient 2
org.tikv.common.TiConfiguration 3
org.tikv.common.TiSession 2
org.tikv.common.catalog.CatalogTransaction 1
org.tikv.common.codec.CodecDataInput 1
org.tikv.common.codec.MetaCodec 8
org.tikv.common.codec.MyDecimal 2
org.tikv.common.codec.RowDecoderV2 1
org.tikv.common.codec.RowEncoderV2 1
org.tikv.common.codec.RowV2 1
org.tikv.common.columnar.TiBlockColumnVector 1
org.tikv.common.columnar.TiChunkColumnVector 3
org.tikv.common.event.CacheInvalidateEvent 1
org.tikv.common.expression.ComparisonBinaryExpression 1
org.tikv.common.expression.StringRegExpression 1
org.tikv.common.key.CompoundKey 1
org.tikv.common.key.IndexKey 1
org.tikv.common.key.IndexKey$EncodeIndexDataResult 2
org.tikv.common.key.Key 1
org.tikv.common.key.RowKey 1
org.tikv.common.key.RowKey$DecodeResult 2
org.tikv.common.key.TypedKey 2
org.tikv.common.meta.Collation 1
org.tikv.common.operation.iterator.ConcreteScanIterator 1
org.tikv.common.policy.RetryPolicy 1
org.tikv.common.predicates.ScanSpec$Builder 1
org.tikv.common.region.AbstractRegionStoreClient 1
org.tikv.common.region.RegionCache 2
org.tikv.common.region.TiRegion$RegionVerID 1
org.tikv.common.region.TiStore 1
org.tikv.common.replica.Store 1
org.tikv.common.statistics.Bucket 1
org.tikv.common.types.BytesType 1
org.tikv.common.types.Converter 6
org.tikv.common.types.DataType 3
org.tikv.common.types.DataTypeFactory 14
org.tikv.common.util.ChannelFactory$JksContext 2
org.tikv.common.util.RangeSplitter 1
org.tikv.raw.RawKVClient 1

org.tikv.common.MetricsServer

Bug Category Details Line Priority
Write to static field org.tikv.common.MetricsServer.METRICS_SERVER_INSTANCE from instance method org.tikv.common.MetricsServer.close() STYLE ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD 75 Medium
Write to static field org.tikv.common.MetricsServer.metricsServerRefCount from instance method org.tikv.common.MetricsServer.close() STYLE ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD 79 Medium

org.tikv.common.PDClient

Bug Category Details Line Priority
Inconsistent synchronization of org.tikv.common.PDClient.lastUpdateLeaderTime; locked 75% of time MT_CORRECTNESS IS2_INCONSISTENT_SYNC 665 Medium
org.tikv.common.PDClient.isCheckerPaused(PDChecker) has Boolean return type and returns explicit null BAD_PRACTICE NP_BOOLEAN_RETURN_NULL 235 High

org.tikv.common.TiConfiguration

Bug Category Details Line Priority
Private method org.tikv.common.TiConfiguration.getBoolean(String, boolean) is never called PERFORMANCE UPM_UNCALLED_PRIVATE_METHOD 398-400 Medium
Private method org.tikv.common.TiConfiguration.getDouble(String) is never called PERFORMANCE UPM_UNCALLED_PRIVATE_METHOD 381 Medium
Private method org.tikv.common.TiConfiguration.getInt(String, int) is never called PERFORMANCE UPM_UNCALLED_PRIVATE_METHOD 362-364 Medium

org.tikv.common.TiSession

Bug Category Details Line Priority
org.tikv.common.TiSession.getImporterRegionStoreClientBuilder() uses the same code for two branches STYLE DB_DUPLICATE_BRANCHES 339-342 Medium
org.tikv.common.TiSession.closeAwaitTermination(long) calls Thread.sleep() with a lock held MT_CORRECTNESS SWL_SLEEP_WITH_LOCK_HELD 750 Medium

org.tikv.common.catalog.CatalogTransaction

Bug Category Details Line Priority
Format string should use %n rather than \n in org.tikv.common.catalog.CatalogTransaction.parseFromJson(ByteString, Class) BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 59 Medium

org.tikv.common.codec.CodecDataInput

Bug Category Details Line Priority
org.tikv.common.codec.CodecDataInput.readPartialUnsignedShort() ignores result of java.io.DataInputStream.read(byte[], int, int) BAD_PRACTICE RR_NOT_CHECKED 123 Medium

org.tikv.common.codec.MetaCodec

Bug Category Details Line Priority
Found reliance on default encoding in org.tikv.common.codec.MetaCodec.autoTableIDKey(long): String.getBytes() I18N DM_DEFAULT_ENCODING 86 High
Found reliance on default encoding in org.tikv.common.codec.MetaCodec.decodeHashDataKey(ByteString): new String(byte[]) I18N DM_DEFAULT_ENCODING 72 High
Found reliance on default encoding in org.tikv.common.codec.MetaCodec.encodeDatabaseID(long): String.getBytes() I18N DM_DEFAULT_ENCODING 94 High
Found reliance on default encoding in org.tikv.common.codec.MetaCodec.tableKey(long): String.getBytes() I18N DM_DEFAULT_ENCODING 90 High
org.tikv.common.codec.MetaCodec.KEY_DBs isn't final but should be MALICIOUS_CODE MS_SHOULD_BE_FINAL 40 High
org.tikv.common.codec.MetaCodec.KEY_SCHEMA_VERSION isn't final but should be MALICIOUS_CODE MS_SHOULD_BE_FINAL 42 High
org.tikv.common.codec.MetaCodec.KEY_TABLE isn't final but should be MALICIOUS_CODE MS_SHOULD_BE_FINAL 41 High
org.tikv.common.codec.MetaCodec.decodeHashDataKey(ByteString) ignores result of org.tikv.common.codec.CodecDataInput.skipBytes(int) BAD_PRACTICE SR_NOT_CHECKED 75 Medium

org.tikv.common.codec.MyDecimal

Bug Category Details Line Priority
Switch statement found in org.tikv.common.codec.MyDecimal.readWord(int[], int, int) where default case is missing STYLE SF_SWITCH_NO_DEFAULT 114-130 Medium
Switch statement found in org.tikv.common.codec.MyDecimal.writeWord(int[], int, int, int) where default case is missing STYLE SF_SWITCH_NO_DEFAULT 745-762 Medium

org.tikv.common.codec.RowDecoderV2

Bug Category Details Line Priority
Check for sign of bitwise operation involving 0x8000000000000000 (-9223372036854775808) in org.tikv.common.codec.RowDecoderV2.decodeDouble(byte[]) CORRECTNESS BIT_SIGNED_CHECK_HIGH_BIT 118 Medium

org.tikv.common.codec.RowEncoderV2

Bug Category Details Line Priority
Bitwise OR of signed byte value computed in org.tikv.common.codec.RowEncoderV2.encodeBit(CodecDataOutput, Object) CORRECTNESS BIT_IOR_OF_SIGNED_BYTE 298 High

org.tikv.common.codec.RowV2

Bug Category Details Line Priority
org.tikv.common.codec.RowV2.CODEC_VER isn't final but should be MALICIOUS_CODE MS_SHOULD_BE_FINAL 25 High

org.tikv.common.columnar.TiBlockColumnVector

Bug Category Details Line Priority
Found reliance on default encoding in org.tikv.common.columnar.TiBlockColumnVector.getUTF8String(int): new String(byte[]) I18N DM_DEFAULT_ENCODING 266 High

org.tikv.common.columnar.TiChunkColumnVector

Bug Category Details Line Priority
Dead store to resultFrac in org.tikv.common.columnar.TiChunkColumnVector.getMyDecimal(int) STYLE DLS_DEAD_LOCAL_STORE 213 Medium
Found reliance on default encoding in org.tikv.common.columnar.TiChunkColumnVector.getEnumString(int): new String(byte[]) I18N DM_DEFAULT_ENCODING 240 High
Found reliance on default encoding in org.tikv.common.columnar.TiChunkColumnVector.getUTF8String(int): new String(byte[]) I18N DM_DEFAULT_ENCODING 258 High

org.tikv.common.event.CacheInvalidateEvent

Bug Category Details Line Priority
Result of integer multiplication cast to long in org.tikv.common.event.CacheInvalidateEvent.hashCode() STYLE ICAST_INTEGER_MULTIPLY_CAST_TO_LONG 67 Medium

org.tikv.common.expression.ComparisonBinaryExpression

Bug Category Details Line Priority
org.tikv.common.expression.ComparisonBinaryExpression is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 39-158 Medium

org.tikv.common.expression.StringRegExpression

Bug Category Details Line Priority
org.tikv.common.expression.StringRegExpression is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 38-137 Medium

org.tikv.common.key.CompoundKey

Bug Category Details Line Priority
org.tikv.common.key.CompoundKey doesn't override Key.equals(Object) STYLE EQ_DOESNT_OVERRIDE_EQUALS 1 Medium

org.tikv.common.key.IndexKey

Bug Category Details Line Priority
org.tikv.common.key.IndexKey doesn't override Key.equals(Object) STYLE EQ_DOESNT_OVERRIDE_EQUALS 1 Medium

org.tikv.common.key.IndexKey$EncodeIndexDataResult

Bug Category Details Line Priority
Unread public/protected field: org.tikv.common.key.IndexKey$EncodeIndexDataResult.appendHandle STYLE URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD 48 Medium
Unread public/protected field: org.tikv.common.key.IndexKey$EncodeIndexDataResult.keys STYLE URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD 47 Medium

org.tikv.common.key.Key

Bug Category Details Line Priority
org.tikv.common.key.Key.TBL_PREFIX should be package protected MALICIOUS_CODE MS_PKGPROTECT 37 Medium

org.tikv.common.key.RowKey

Bug Category Details Line Priority
org.tikv.common.key.RowKey doesn't override Key.equals(Object) STYLE EQ_DOESNT_OVERRIDE_EQUALS 1 Medium

org.tikv.common.key.RowKey$DecodeResult

Bug Category Details Line Priority
Unused public or protected field: org.tikv.common.key.RowKey$DecodeResult.handle STYLE UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD Not available Medium
Unused public or protected field: org.tikv.common.key.RowKey$DecodeResult.status STYLE UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD Not available Medium

org.tikv.common.key.TypedKey

Bug Category Details Line Priority
Found reliance on default encoding in org.tikv.common.key.TypedKey.next(): String.getBytes() I18N DM_DEFAULT_ENCODING 100 High
org.tikv.common.key.TypedKey doesn't override Key.equals(Object) STYLE EQ_DOESNT_OVERRIDE_EQUALS 1 Medium

org.tikv.common.meta.Collation

Bug Category Details Line Priority
org.tikv.common.meta.Collation.<static initializer for Collation>() makes inefficient use of keySet iterator instead of entrySet iterator PERFORMANCE WMI_WRONG_MAP_ITERATOR 254 Medium

org.tikv.common.operation.iterator.ConcreteScanIterator

Bug Category Details Line Priority
Exception is caught when Exception is not thrown in org.tikv.common.operation.iterator.ConcreteScanIterator.resolveCurrentLock(Kvrpcpb$KvPair) STYLE REC_CATCH_EXCEPTION 99 Medium

org.tikv.common.policy.RetryPolicy

Bug Category Details Line Priority
Unread field: org.tikv.common.policy.RetryPolicy.backOffer PERFORMANCE URF_UNREAD_FIELD 33 Medium

org.tikv.common.predicates.ScanSpec$Builder

Bug Category Details Line Priority
Useless object stored in variable pointTypes of method org.tikv.common.predicates.ScanSpec$Builder.build() STYLE UC_USELESS_OBJECT 112 Medium

org.tikv.common.region.AbstractRegionStoreClient

Bug Category Details Line Priority
org.tikv.common.region.AbstractRegionStoreClient.seekLeaderStore(BackOffer) has Boolean return type and returns explicit null BAD_PRACTICE NP_BOOLEAN_RETURN_NULL 266 Medium

org.tikv.common.region.RegionCache

Bug Category Details Line Priority
org.tikv.common.region.RegionCache.insertRegionToCache(TiRegion) might ignore java.lang.Exception BAD_PRACTICE DE_MIGHT_IGNORE 131 Medium
Nullcheck of oldRegion at line 141 of value previously dereferenced in org.tikv.common.region.RegionCache.updateRegion(TiRegion, TiRegion) CORRECTNESS RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE 141 Medium

org.tikv.common.region.TiRegion$RegionVerID

Bug Category Details Line Priority
Should org.tikv.common.region.TiRegion$RegionVerID be a _static_ inner class? PERFORMANCE SIC_INNER_SHOULD_BE_STATIC 287-323 Medium

org.tikv.common.region.TiStore

Bug Category Details Line Priority
org.tikv.common.region.TiStore defines equals and uses Object.hashCode() BAD_PRACTICE HE_EQUALS_USE_HASHCODE 49-66 High

org.tikv.common.replica.Store

Bug Category Details Line Priority
org.tikv.common.replica.Store defines equals and uses Object.hashCode() BAD_PRACTICE HE_EQUALS_USE_HASHCODE 117-121 High

org.tikv.common.statistics.Bucket

Bug Category Details Line Priority
org.tikv.common.statistics.Bucket defines compareTo(Bucket) and uses Object.equals() BAD_PRACTICE EQ_COMPARETO_USE_OBJECT_EQUALS 60 Medium

org.tikv.common.types.BytesType

Bug Category Details Line Priority
Found reliance on default encoding in org.tikv.common.types.BytesType.convertToBytes(Object): String.getBytes() I18N DM_DEFAULT_ENCODING 97 High
org.tikv.common.types.BytesType.subTypes should be package protected MALICIOUS_CODE MS_PKGPROTECT 41 Medium

org.tikv.common.types.Converter

Bug Category Details Line Priority
Found reliance on default encoding in org.tikv.common.types.Converter.convertToBytes(Object): String.getBytes() I18N DM_DEFAULT_ENCODING 180 High
Found reliance on default encoding in org.tikv.common.types.Converter.convertToBytes(Object, int): String.getBytes() I18N DM_DEFAULT_ENCODING 193 High
Found reliance on default encoding in org.tikv.common.types.Converter.convertUtf8ToBytes(Object, int): new String(byte[]) I18N DM_DEFAULT_ENCODING 203 High
Public static org.tikv.common.types.Converter.getLocalTimezone() may expose internal representation by returning Converter.localTimeZone MALICIOUS_CODE MS_EXPOSE_REP 217 Medium
Exception is caught when Exception is not thrown in org.tikv.common.types.Converter.convertStrToDuration(String) STYLE REC_CATCH_EXCEPTION 358 Medium
Nonsensical self computation of hour with itself in org.tikv.common.types.Converter.convertStrToDuration(String) CORRECTNESS SA_LOCAL_SELF_COMPUTATION 342 High

org.tikv.common.types.DataType

Bug Category Details Line Priority
Check for sign of bitwise operation in org.tikv.common.types.DataType.isNoDefault() BAD_PRACTICE BIT_SIGNED_CHECK 541 Medium
Check for sign of bitwise operation in org.tikv.common.types.DataType.isNum() BAD_PRACTICE BIT_SIGNED_CHECK 585 Medium
Check for sign of bitwise operation in org.tikv.common.types.DataType.isOnUpdateNow() BAD_PRACTICE BIT_SIGNED_CHECK 569 Medium

org.tikv.common.types.DataTypeFactory

Bug Category Details Line Priority

org.tikv.common.util.ChannelFactory$JksContext

Bug Category Details Line Priority
org.tikv.common.util.ChannelFactory$JksContext.createSslContextBuilder() may fail to clean up java.io.InputStream EXPERIMENTAL OBL_UNSATISFIED_OBLIGATION 153 Medium
org.tikv.common.util.ChannelFactory$JksContext.createSslContextBuilder() may fail to close stream BAD_PRACTICE OS_OPEN_STREAM 153 Medium

org.tikv.common.util.RangeSplitter

Bug Category Details Line Priority
Redundant nullcheck of regionStorePair, which is known to be non-null in org.tikv.common.util.RangeSplitter.splitRangeByRegion(List, TiStoreType) STYLE RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE 173 Medium

org.tikv.raw.RawKVClient

Bug Category Details Line Priority
Private method org.tikv.raw.RawKVClient.scan0(ScanOption) is never called PERFORMANCE UPM_UNCALLED_PRIVATE_METHOD 1090-1094 Medium