SpotBugs Bug Detector Report

The following document contains the results of SpotBugs

SpotBugs Version is 4.9.1

Threshold is medium

Effort is default

Summary

Classes Bugs Errors Missing Classes
81 34 0 0

Files

Class Bugs
org.opentrafficsim.base.AlphabeticIdGenerator 1
org.opentrafficsim.base.DistancedObject 2
org.opentrafficsim.base.HierarchicalType 3
org.opentrafficsim.base.StripeElement 4
org.opentrafficsim.base.TimeStampedObject 2
org.opentrafficsim.base.geometry.CircleShape 2
org.opentrafficsim.base.geometry.DirectionalPolyLine 6
org.opentrafficsim.base.geometry.OtsLine2d 1
org.opentrafficsim.base.geometry.RadiusCalculator2d 1
org.opentrafficsim.base.geometry.RoundedRectangleShape 2
org.opentrafficsim.base.logger.Logger 1
org.opentrafficsim.base.parameters.ParameterSet 1
org.opentrafficsim.base.parameters.ParameterType 2
org.opentrafficsim.base.parameters.constraint.CollectionConstraint 2
org.opentrafficsim.base.parameters.constraint.MultiConstraint 1
org.opentrafficsim.base.parameters.constraint.SingleBound$Bound 1
org.opentrafficsim.base.parameters.constraint.SubCollectionConstraint 2

org.opentrafficsim.base.AlphabeticIdGenerator

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.base.AlphabeticIdGenerator at new org.opentrafficsim.base.AlphabeticIdGenerator(String) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 38 Medium

org.opentrafficsim.base.DistancedObject

Bug Category Details Line Priority
org.opentrafficsim.base.DistancedObject.distance() may expose internal representation by returning DistancedObject.distance MALICIOUS_CODE EI_EXPOSE_REP 17 Medium
new org.opentrafficsim.base.DistancedObject(Object, Length) may expose internal representation by storing an externally mutable object into DistancedObject.distance MALICIOUS_CODE EI_EXPOSE_REP2 25 Medium

org.opentrafficsim.base.HierarchicalType

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.base.HierarchicalType at new org.opentrafficsim.base.HierarchicalType(String) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 43 Medium
Exception thrown in class org.opentrafficsim.base.HierarchicalType at new org.opentrafficsim.base.HierarchicalType(String, HierarchicalType) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 55 Medium
org.opentrafficsim.base.HierarchicalType.getChildren() may expose internal representation by returning HierarchicalType.children MALICIOUS_CODE EI_EXPOSE_REP 85 Medium

org.opentrafficsim.base.StripeElement

Bug Category Details Line Priority
org.opentrafficsim.base.StripeElement.dashes() may expose internal representation by returning StripeElement.dashes MALICIOUS_CODE EI_EXPOSE_REP 22 Medium
org.opentrafficsim.base.StripeElement.width() may expose internal representation by returning StripeElement.width MALICIOUS_CODE EI_EXPOSE_REP 22 Medium
new org.opentrafficsim.base.StripeElement(Length, Color, LengthVector) may expose internal representation by storing an externally mutable object into StripeElement.dashes MALICIOUS_CODE EI_EXPOSE_REP2 33 Medium
new org.opentrafficsim.base.StripeElement(Length, Color, LengthVector) may expose internal representation by storing an externally mutable object into StripeElement.width MALICIOUS_CODE EI_EXPOSE_REP2 33 Medium

org.opentrafficsim.base.TimeStampedObject

Bug Category Details Line Priority
org.opentrafficsim.base.TimeStampedObject.timestamp() may expose internal representation by returning TimeStampedObject.timestamp MALICIOUS_CODE EI_EXPOSE_REP 19 Medium
new org.opentrafficsim.base.TimeStampedObject(Object, Duration) may expose internal representation by storing an externally mutable object into TimeStampedObject.timestamp MALICIOUS_CODE EI_EXPOSE_REP2 27 Medium

org.opentrafficsim.base.geometry.CircleShape

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.base.geometry.CircleShape at new org.opentrafficsim.base.geometry.CircleShape(double) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 40 Medium
Exception thrown in class org.opentrafficsim.base.geometry.CircleShape at new org.opentrafficsim.base.geometry.CircleShape(double, int) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 50 Medium

org.opentrafficsim.base.geometry.DirectionalPolyLine

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.base.geometry.DirectionalPolyLine at new org.opentrafficsim.base.geometry.DirectionalPolyLine(PolyLine2d, Direction, Direction) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 36 Medium
org.opentrafficsim.base.geometry.DirectionalPolyLine.getEndDirection() may expose internal representation by returning DirectionalPolyLine.endDirection MALICIOUS_CODE EI_EXPOSE_REP 120 Medium
org.opentrafficsim.base.geometry.DirectionalPolyLine.getStartDirection() may expose internal representation by returning DirectionalPolyLine.startDirection MALICIOUS_CODE EI_EXPOSE_REP 111 Medium
new org.opentrafficsim.base.geometry.DirectionalPolyLine(PolyLine2d, Direction, Direction) may expose internal representation by storing an externally mutable object into DirectionalPolyLine.endDirection MALICIOUS_CODE EI_EXPOSE_REP2 39 Medium
new org.opentrafficsim.base.geometry.DirectionalPolyLine(PolyLine2d, Direction, Direction) may expose internal representation by storing an externally mutable object into DirectionalPolyLine.startDirection MALICIOUS_CODE EI_EXPOSE_REP2 38 Medium
org.opentrafficsim.base.geometry.DirectionalPolyLine doesn't override org.djutils.draw.line.PolyLine2d.equals(Object) STYLE EQ_DOESNT_OVERRIDE_EQUALS 1 Medium

org.opentrafficsim.base.geometry.OtsLine2d

Bug Category Details Line Priority
org.opentrafficsim.base.geometry.OtsLine2d doesn't override org.djutils.draw.line.PolyLine2d.equals(Object) STYLE EQ_DOESNT_OVERRIDE_EQUALS 1 Medium

org.opentrafficsim.base.geometry.RadiusCalculator2d

Bug Category Details Line Priority
Useless condition: it's known that n >= 2 at this point STYLE UC_USELESS_CONDITION 92 High

org.opentrafficsim.base.geometry.RoundedRectangleShape

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.base.geometry.RoundedRectangleShape at new org.opentrafficsim.base.geometry.RoundedRectangleShape(double, double, double) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 50 Medium
Exception thrown in class org.opentrafficsim.base.geometry.RoundedRectangleShape at new org.opentrafficsim.base.geometry.RoundedRectangleShape(double, double, double, int) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 80 Medium

org.opentrafficsim.base.logger.Logger

Bug Category Details Line Priority
Public static org.opentrafficsim.base.logger.Logger.ots() may expose internal representation by returning Logger.LOGGER MALICIOUS_CODE MS_EXPOSE_REP 94 Medium

org.opentrafficsim.base.parameters.ParameterSet

Bug Category Details Line Priority
org.opentrafficsim.base.parameters.ParameterSet.setAllOneByOne(Parameters) makes inefficient use of keySet iterator instead of entrySet iterator PERFORMANCE WMI_WRONG_MAP_ITERATOR 306 Medium

org.opentrafficsim.base.parameters.ParameterType

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.base.parameters.ParameterType at new org.opentrafficsim.base.parameters.ParameterType(String, String, Class, Object) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 48 Medium
Exception thrown in class org.opentrafficsim.base.parameters.ParameterType at new org.opentrafficsim.base.parameters.ParameterType(String, String, Class, Object, Constraint) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 62 Medium

org.opentrafficsim.base.parameters.constraint.CollectionConstraint

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.base.parameters.constraint.CollectionConstraint at new org.opentrafficsim.base.parameters.constraint.CollectionConstraint(Collection) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 31 Medium
new org.opentrafficsim.base.parameters.constraint.CollectionConstraint(Collection) may expose internal representation by storing an externally mutable object into CollectionConstraint.objects MALICIOUS_CODE EI_EXPOSE_REP2 32 Medium

org.opentrafficsim.base.parameters.constraint.MultiConstraint

Bug Category Details Line Priority
new org.opentrafficsim.base.parameters.constraint.MultiConstraint(Collection) may expose internal representation by storing an externally mutable object into MultiConstraint.constraints MALICIOUS_CODE EI_EXPOSE_REP2 34 Medium

org.opentrafficsim.base.parameters.constraint.SingleBound$Bound

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.base.parameters.constraint.SingleBound$Bound at new org.opentrafficsim.base.parameters.constraint.SingleBound$Bound(Number, String) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 224 Medium

org.opentrafficsim.base.parameters.constraint.SubCollectionConstraint

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.base.parameters.constraint.SubCollectionConstraint at new org.opentrafficsim.base.parameters.constraint.SubCollectionConstraint(Collection) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 31 Medium
new org.opentrafficsim.base.parameters.constraint.SubCollectionConstraint(Collection) may expose internal representation by storing an externally mutable object into SubCollectionConstraint.objects MALICIOUS_CODE EI_EXPOSE_REP2 32 Medium