FindBugs Bug Detector Report

The following document contains the results of FindBugs

FindBugs Version is 3.0.1

Threshold is experimental

Effort is max

Summary

Classes Bugs Errors Missing Classes
101 79 0 0

Files

Class Bugs
net.sf.mbus4j.Connection 1
net.sf.mbus4j.MBusAddressing 1
net.sf.mbus4j.MBusUtils 2
net.sf.mbus4j.SerialPortConnection 2
net.sf.mbus4j.TcpIpConnection 2
net.sf.mbus4j.dataframes.ApplicationReset 2
net.sf.mbus4j.dataframes.ApplicationReset$1 2
net.sf.mbus4j.dataframes.GeneralApplicationError 3
net.sf.mbus4j.dataframes.GeneralApplicationError$1 2
net.sf.mbus4j.dataframes.RequestClassXData 1
net.sf.mbus4j.dataframes.SelectionOfSlaves 5
net.sf.mbus4j.dataframes.SendUserData 1
net.sf.mbus4j.dataframes.SetBaudrate 2
net.sf.mbus4j.dataframes.SynchronizeAction 1
net.sf.mbus4j.dataframes.UserDataResponse 9
net.sf.mbus4j.dataframes.datablocks.BigDecimalDataBlock 1
net.sf.mbus4j.dataframes.datablocks.ByteDataBlock 1
net.sf.mbus4j.dataframes.datablocks.DataBlock 3
net.sf.mbus4j.dataframes.datablocks.DateAndTimeDataBlock 3
net.sf.mbus4j.dataframes.datablocks.DateDataBlock 3
net.sf.mbus4j.dataframes.datablocks.EmptyDataBlock 1
net.sf.mbus4j.dataframes.datablocks.EnhancedIdentificationDataBlock 2
net.sf.mbus4j.dataframes.datablocks.IntegerDataBlock 1
net.sf.mbus4j.dataframes.datablocks.LongDataBlock 1
net.sf.mbus4j.dataframes.datablocks.RawDataBlock 3
net.sf.mbus4j.dataframes.datablocks.ReadOutDataBlock 1
net.sf.mbus4j.dataframes.datablocks.RealDataBlock 1
net.sf.mbus4j.dataframes.datablocks.ShortDataBlock 1
net.sf.mbus4j.dataframes.datablocks.StringDataBlock 1
net.sf.mbus4j.dataframes.datablocks.VariableLengthDataBlock 1
net.sf.mbus4j.dataframes.datablocks.vif.VifFB 1
net.sf.mbus4j.dataframes.datablocks.vif.VifFD 2
net.sf.mbus4j.dataframes.datablocks.vif.VifPrimary 1
net.sf.mbus4j.decoder.Decoder 4
net.sf.mbus4j.decoder.Stack 1
net.sf.mbus4j.decoder.VariableDataBlockDecoder 1
net.sf.mbus4j.encoder.Encoder 7
net.sf.mbus4j.log.LogUtils 2

net.sf.mbus4j.Connection

Bug Category Details Line Priority
Switch statement found in net.sf.mbus4j.Connection.readObject(ObjectInputStream) where default case is missing STYLE SF_SWITCH_NO_DEFAULT 168-170 Medium

net.sf.mbus4j.MBusAddressing

Bug Category Details Line Priority
Class net.sf.mbus4j.MBusAddressing implements same interface as superclass STYLE RI_REDUNDANT_INTERFACES 36-56 Low

net.sf.mbus4j.MBusUtils

Bug Category Details Line Priority
Found reliance on default encoding in net.sf.mbus4j.MBusUtils.man2Short(String): String.getBytes() I18N DM_DEFAULT_ENCODING 68 High
The method name net.sf.mbus4j.MBusUtils.String2Bcd(String) doesn't start with a lower case letter BAD_PRACTICE NM_METHOD_NAMING_CONVENTION 74-79 Medium

net.sf.mbus4j.SerialPortConnection

Bug Category Details Line Priority
Switch statement found in net.sf.mbus4j.SerialPortConnection.readObject(ObjectInputStream) where default case is missing STYLE SF_SWITCH_NO_DEFAULT 127-132 Medium
SerialPortConnection.sPort not initialized in constructor and dereferenced in net.sf.mbus4j.SerialPortConnection.close() STYLE UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR 98 Low

net.sf.mbus4j.TcpIpConnection

Bug Category Details Line Priority
Switch statement found in net.sf.mbus4j.TcpIpConnection.readObject(ObjectInputStream) where default case is missing STYLE SF_SWITCH_NO_DEFAULT 126-128 Medium
TcpIpConnection.socket not initialized in constructor and dereferenced in net.sf.mbus4j.TcpIpConnection.close() STYLE UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR 79 Low

net.sf.mbus4j.dataframes.ApplicationReset

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.ApplicationReset defines equals and uses Object.hashCode() BAD_PRACTICE HE_EQUALS_USE_HASHCODE 260-266 High
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.ApplicationReset.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 251 Medium

net.sf.mbus4j.dataframes.ApplicationReset$1

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.ApplicationReset$1.next() can't throw NoSuchElementException BAD_PRACTICE IT_NO_SUCH_ELEMENT 200 Low
The class net.sf.mbus4j.dataframes.ApplicationReset$1 could be refactored into a named _static_ inner class PERFORMANCE SIC_INNER_SHOULD_BE_STATIC_ANON 192-205 Low

net.sf.mbus4j.dataframes.GeneralApplicationError

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.GeneralApplicationError.RSP_UD_SUBTYPE isn't final but should be MALICIOUS_CODE MS_SHOULD_BE_FINAL 43 High
GeneralApplicationError.error not initialized in constructor and dereferenced in net.sf.mbus4j.dataframes.GeneralApplicationError.toJSON(JsonSerializeType) STYLE UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR 54 Low
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.GeneralApplicationError.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 238 Medium

net.sf.mbus4j.dataframes.GeneralApplicationError$1

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.GeneralApplicationError$1.next() can't throw NoSuchElementException BAD_PRACTICE IT_NO_SUCH_ELEMENT 184 Low
The class net.sf.mbus4j.dataframes.GeneralApplicationError$1 could be refactored into a named _static_ inner class PERFORMANCE SIC_INNER_SHOULD_BE_STATIC_ANON 175-189 Low

net.sf.mbus4j.dataframes.RequestClassXData

Bug Category Details Line Priority
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.RequestClassXData.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 102 Medium

net.sf.mbus4j.dataframes.SelectionOfSlaves

Bug Category Details Line Priority
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.SelectionOfSlaves.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 214 Medium
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.SelectionOfSlaves.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 215 Medium
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.SelectionOfSlaves.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 216 Medium
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.SelectionOfSlaves.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 218 Medium
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.SelectionOfSlaves.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 217 Medium

net.sf.mbus4j.dataframes.SendUserData

Bug Category Details Line Priority
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.SendUserData.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 111 Medium

net.sf.mbus4j.dataframes.SetBaudrate

Bug Category Details Line Priority
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.SetBaudrate.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 104 Medium
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.SetBaudrate.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 105 Medium

net.sf.mbus4j.dataframes.SynchronizeAction

Bug Category Details Line Priority
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.SynchronizeAction.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 88 Medium

net.sf.mbus4j.dataframes.UserDataResponse

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.UserDataResponse.getStatus() may expose internal representation by returning UserDataResponse.status MALICIOUS_CODE EI_EXPOSE_REP 291 Medium
net.sf.mbus4j.dataframes.UserDataResponse.setStatus(UserDataResponse$StatusCode[]) may expose internal representation by storing an externally mutable object into UserDataResponse.status MALICIOUS_CODE EI_EXPOSE_REP2 377 Medium
UserDataResponse.medium not initialized in constructor and dereferenced in net.sf.mbus4j.dataframes.UserDataResponse.toString() STYLE UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR 398 Low
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.UserDataResponse.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 390 Medium
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.UserDataResponse.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 402 Medium
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.UserDataResponse.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 391 Medium
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.UserDataResponse.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 397 Medium
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.UserDataResponse.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 395 Medium
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.UserDataResponse.toString() BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 393 Medium

net.sf.mbus4j.dataframes.datablocks.BigDecimalDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.BigDecimalDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 43-79 Low

net.sf.mbus4j.dataframes.datablocks.ByteDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.ByteDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 46-148 Low

net.sf.mbus4j.dataframes.datablocks.DataBlock

Bug Category Details Line Priority
instanceof will always return true for all non-null values in net.sf.mbus4j.dataframes.datablocks.DataBlock.vifesFromJSON(VifTypes, JSONArray), since all net.sf.json.JSONArray are instances of net.sf.json.JSONArray STYLE BC_VACUOUS_INSTANCEOF 258 Medium
net.sf.mbus4j.dataframes.datablocks.DataBlock.getVifes() may expose internal representation by returning DataBlock.vifes MALICIOUS_CODE EI_EXPOSE_REP 379 Medium
net.sf.mbus4j.dataframes.datablocks.DataBlock.vifesFromJSON(VifTypes, JSONArray) does an unnecessary type check using instanceof operator when it can be determined statically CORRECTNESS SIO_SUPERFLUOUS_INSTANCEOF 258 Low

net.sf.mbus4j.dataframes.datablocks.DateAndTimeDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.DateAndTimeDataBlock.getValue() may expose internal representation by returning DateAndTimeDataBlock.value MALICIOUS_CODE EI_EXPOSE_REP 75 Medium
net.sf.mbus4j.dataframes.datablocks.DateAndTimeDataBlock.setValue(Date) may expose internal representation by storing an externally mutable object into DateAndTimeDataBlock.value MALICIOUS_CODE EI_EXPOSE_REP2 151 Medium
net.sf.mbus4j.dataframes.datablocks.DateAndTimeDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 47-241 Low

net.sf.mbus4j.dataframes.datablocks.DateDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.DateDataBlock.getValue() may expose internal representation by returning DateDataBlock.value MALICIOUS_CODE EI_EXPOSE_REP 70 Medium
net.sf.mbus4j.dataframes.datablocks.DateDataBlock.setValue(Date) may expose internal representation by storing an externally mutable object into DateDataBlock.value MALICIOUS_CODE EI_EXPOSE_REP2 82 Medium
net.sf.mbus4j.dataframes.datablocks.DateDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 47-110 Low

net.sf.mbus4j.dataframes.datablocks.EmptyDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.EmptyDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 38-48 Low

net.sf.mbus4j.dataframes.datablocks.EnhancedIdentificationDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.EnhancedIdentificationDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 48-157 Low
Format string should use %n rather than \n in net.sf.mbus4j.dataframes.datablocks.EnhancedIdentificationDataBlock.toString(StringBuilder, String) BAD_PRACTICE VA_FORMAT_STRING_USES_NEWLINE 118 Medium

net.sf.mbus4j.dataframes.datablocks.IntegerDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.IntegerDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 48-158 Low

net.sf.mbus4j.dataframes.datablocks.LongDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.LongDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 46-151 Low

net.sf.mbus4j.dataframes.datablocks.RawDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.RawDataBlock.getValue() may expose internal representation by returning RawDataBlock.value MALICIOUS_CODE EI_EXPOSE_REP 50 Medium
net.sf.mbus4j.dataframes.datablocks.RawDataBlock.setValue(byte[]) may expose internal representation by storing an externally mutable object into RawDataBlock.value MALICIOUS_CODE EI_EXPOSE_REP2 68 Medium
net.sf.mbus4j.dataframes.datablocks.RawDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 43-108 Low

net.sf.mbus4j.dataframes.datablocks.ReadOutDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.ReadOutDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 38-48 Low

net.sf.mbus4j.dataframes.datablocks.RealDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.RealDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 45-86 Low

net.sf.mbus4j.dataframes.datablocks.ShortDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.ShortDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 46-148 Low

net.sf.mbus4j.dataframes.datablocks.StringDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.StringDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 43-74 Low

net.sf.mbus4j.dataframes.datablocks.VariableLengthDataBlock

Bug Category Details Line Priority
net.sf.mbus4j.dataframes.datablocks.VariableLengthDataBlock is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 38-48 Low

net.sf.mbus4j.dataframes.datablocks.vif.VifFB

Bug Category Details Line Priority
Suspicious comparison of Integer references in net.sf.mbus4j.dataframes.datablocks.vif.VifFB.assemble(String, UnitOfMeasurement, SiPrefix, Integer) CORRECTNESS RC_REF_COMPARISON 257 Low

net.sf.mbus4j.dataframes.datablocks.vif.VifFD

Bug Category Details Line Priority
Incorrect lazy initialization and update of static field net.sf.mbus4j.dataframes.datablocks.vif.VifFD.map in net.sf.mbus4j.dataframes.datablocks.vif.VifFD.valueOfTableIndex(byte) MT_CORRECTNESS LI_LAZY_INIT_UPDATE_STATIC 188-189 High
Suspicious comparison of Integer references in net.sf.mbus4j.dataframes.datablocks.vif.VifFD.assemble(String, UnitOfMeasurement, SiPrefix, Integer) CORRECTNESS RC_REF_COMPARISON 271 Low

net.sf.mbus4j.dataframes.datablocks.vif.VifPrimary

Bug Category Details Line Priority
Suspicious comparison of Integer references in net.sf.mbus4j.dataframes.datablocks.vif.VifPrimary.assemble(String, UnitOfMeasurement, SiPrefix, Integer) CORRECTNESS RC_REF_COMPARISON 292 Low

net.sf.mbus4j.decoder.Decoder

Bug Category Details Line Priority
net.sf.mbus4j.decoder.Decoder.addByte(byte) uses the same code for two switch clauses STYLE DB_DUPLICATE_SWITCH_CLAUSES 219-220 Low
Switch statement found in net.sf.mbus4j.decoder.Decoder.addByte(byte) where one case falls through to the next case STYLE SF_SWITCH_FALLTHROUGH 497-501 Medium
Switch statement found in net.sf.mbus4j.decoder.Decoder.addByte(byte) where default case is missing STYLE SF_SWITCH_NO_DEFAULT 395-409 Medium
Private method net.sf.mbus4j.decoder.Decoder.bcd2Int(byte[]) is never called PERFORMANCE UPM_UNCALLED_PRIVATE_METHOD 516-525 Low

net.sf.mbus4j.decoder.Stack

Bug Category Details Line Priority
net.sf.mbus4j.decoder.Stack.popBytes() may expose internal representation by returning Stack.data MALICIOUS_CODE EI_EXPOSE_REP 185 Medium

net.sf.mbus4j.decoder.VariableDataBlockDecoder

Bug Category Details Line Priority
Possible bad parsing of shift operation in net.sf.mbus4j.decoder.VariableDataBlockDecoder.decodeDIFE(byte, int) CORRECTNESS BSHIFT_WRONG_ADD_PRIORITY 332 Low

net.sf.mbus4j.encoder.Encoder

Bug Category Details Line Priority
net.sf.mbus4j.encoder.Encoder.encodeFrame(ControlFrame) may expose internal representation by returning Encoder.data MALICIOUS_CODE EI_EXPOSE_REP 105 Medium
net.sf.mbus4j.encoder.Encoder.encodeFrame(LongFrame) may expose internal representation by returning Encoder.data MALICIOUS_CODE EI_EXPOSE_REP 129 Medium
net.sf.mbus4j.encoder.Encoder.encodeFrame(ShortFrame) may expose internal representation by returning Encoder.data MALICIOUS_CODE EI_EXPOSE_REP 137 Medium
net.sf.mbus4j.encoder.Encoder.encodeFrame(SingleCharFrame) may expose internal representation by returning Encoder.data MALICIOUS_CODE EI_EXPOSE_REP 142 Medium
Should net.sf.mbus4j.encoder.Encoder.encode(Frame) return a zero length array rather than null? STYLE PZLA_PREFER_ZERO_LENGTH_ARRAYS 95 Low
Switch statement found in net.sf.mbus4j.encoder.Encoder.pushCIField(ControlFrame) where default case is missing STYLE SF_SWITCH_NO_DEFAULT 318-342 Medium
Unread field: net.sf.mbus4j.encoder.Encoder.log PERFORMANCE URF_UNREAD_FIELD 83 Low

net.sf.mbus4j.log.LogUtils

Bug Category Details Line Priority
Exception is caught when Exception is not thrown in net.sf.mbus4j.log.LogUtils.initJul() STYLE REC_CATCH_EXCEPTION 74
Exception is caught when Exception is not thrown in net.sf.mbus4j.log.LogUtils.initJulFromResource(String) STYLE REC_CATCH_EXCEPTION 66