SpotBugs Bug Detector Report
The following document contains the results of SpotBugs
SpotBugs Version is 4.8.6
Threshold is medium
Effort is default
Summary
Classes | Bugs | Errors | Missing Classes |
---|---|---|---|
36 | 51 | 0 | 0 |
Files
org.opentrafficsim.trafficcontrol.AbstractTrafficController
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Exception thrown in class org.opentrafficsim.trafficcontrol.AbstractTrafficController at new org.opentrafficsim.trafficcontrol.AbstractTrafficController(String, OtsSimulatorInterface) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 32 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Exception thrown in class org.opentrafficsim.trafficcontrol.FixedTimeController at new org.opentrafficsim.trafficcontrol.FixedTimeController(String, OtsSimulatorInterface, Network, Duration, Duration, Set) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 69 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController.getCycleTime() may expose internal representation by returning FixedTimeController.cycleTime | MALICIOUS_CODE | EI_EXPOSE_REP | 283 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController.getOffset() may expose internal representation by returning FixedTimeController.offset | MALICIOUS_CODE | EI_EXPOSE_REP | 291 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController.getSignalGroups() may expose internal representation by returning FixedTimeController.signalGroups | MALICIOUS_CODE | EI_EXPOSE_REP | 299 | Medium |
new org.opentrafficsim.trafficcontrol.FixedTimeController(String, OtsSimulatorInterface, Network, Duration, Duration, Set) may expose internal representation by storing an externally mutable object into FixedTimeController.cycleTime | MALICIOUS_CODE | EI_EXPOSE_REP2 | 90 | Medium |
new org.opentrafficsim.trafficcontrol.FixedTimeController(String, OtsSimulatorInterface, Network, Duration, Duration, Set) may expose internal representation by storing an externally mutable object into FixedTimeController.offset | MALICIOUS_CODE | EI_EXPOSE_REP2 | 91 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController.mergeGreenPhasesInNewSignalGroups() concatenates strings using + in a loop | PERFORMANCE | SBSC_USE_STRINGBUFFER_CONCATENATION | 194 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController.mergeGreenPhasesInNewSignalGroups() makes inefficient use of keySet iterator instead of entrySet iterator | PERFORMANCE | WMI_WRONG_MAP_ITERATOR | 124 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController$Flank
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.trafficcontrol.FixedTimeController$Flank.compareTo(FixedTimeController$Flank) incorrectly handles double value | BAD_PRACTICE | CO_COMPARETO_INCORRECT_FLOATING | 716 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController$Flank defines compareTo(FixedTimeController$Flank) and uses Object.equals() | BAD_PRACTICE | EQ_COMPARETO_USE_OBJECT_EQUALS | 707-728 | Medium |
Should org.opentrafficsim.trafficcontrol.FixedTimeController$Flank be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 658-728 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Exception thrown in class org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup at new org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup(String, Set, Duration, Duration, Duration) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 367 | Medium |
Exception thrown in class org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup at new org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup(String, Set, Duration, Duration, Duration, Duration) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 382 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup.getGreen() may expose internal representation by returning FixedTimeController$SignalGroup.green | MALICIOUS_CODE | EI_EXPOSE_REP | 623 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup.getOffset() may expose internal representation by returning FixedTimeController$SignalGroup.offset | MALICIOUS_CODE | EI_EXPOSE_REP | 607 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup.getPreGreen() may expose internal representation by returning FixedTimeController$SignalGroup.preGreen | MALICIOUS_CODE | EI_EXPOSE_REP | 615 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup.getRed() may expose internal representation by returning FixedTimeController$SignalGroup.red | MALICIOUS_CODE | EI_EXPOSE_REP | 591 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup.getYellow() may expose internal representation by returning FixedTimeController$SignalGroup.yellow | MALICIOUS_CODE | EI_EXPOSE_REP | 631 | Medium |
new org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup(String, Set, Duration, Duration, Duration, Duration) may expose internal representation by storing an externally mutable object into FixedTimeController$SignalGroup.green | MALICIOUS_CODE | EI_EXPOSE_REP2 | 396 | Medium |
new org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup(String, Set, Duration, Duration, Duration, Duration) may expose internal representation by storing an externally mutable object into FixedTimeController$SignalGroup.offset | MALICIOUS_CODE | EI_EXPOSE_REP2 | 394 | Medium |
new org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup(String, Set, Duration, Duration, Duration, Duration) may expose internal representation by storing an externally mutable object into FixedTimeController$SignalGroup.preGreen | MALICIOUS_CODE | EI_EXPOSE_REP2 | 395 | Medium |
new org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup(String, Set, Duration, Duration, Duration, Duration) may expose internal representation by storing an externally mutable object into FixedTimeController$SignalGroup.yellow | MALICIOUS_CODE | EI_EXPOSE_REP2 | 397 | Medium |
org.opentrafficsim.trafficcontrol.ccol.Ccol
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Exception thrown in class org.opentrafficsim.trafficcontrol.ccol.Ccol at new org.opentrafficsim.trafficcontrol.ccol.Ccol(String, String, Set, Set, OtsSimulator) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 115 | Medium |
Dead store to $L2 in org.opentrafficsim.trafficcontrol.ccol.Ccol.step() | STYLE | DLS_DEAD_LOCAL_STORE | 173 | Medium |
Found reliance on default encoding in org.opentrafficsim.trafficcontrol.ccol.Ccol.setClientSocket(Socket): new java.io.InputStreamReader(InputStream) | I18N | DM_DEFAULT_ENCODING | 133 | High |
Found reliance on default encoding in org.opentrafficsim.trafficcontrol.ccol.Ccol.setClientSocket(Socket): new java.io.PrintWriter(OutputStream) | I18N | DM_DEFAULT_ENCODING | 134 | High |
new org.opentrafficsim.trafficcontrol.ccol.Ccol(String, String, Set, Set, OtsSimulator) may expose internal representation by storing an externally mutable object into Ccol.simulator | MALICIOUS_CODE | EI_EXPOSE_REP2 | 86 | Medium |
new org.opentrafficsim.trafficcontrol.ccol.Ccol(String, String, Set, Set, OtsSimulator) invokes Thread.start() | MT_CORRECTNESS | SC_START_IN_CTOR | 107 | Medium |
org.opentrafficsim.trafficcontrol.trafcod.Diagram
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Exception thrown in class org.opentrafficsim.trafficcontrol.trafcod.Diagram at new org.opentrafficsim.trafficcontrol.trafcod.Diagram(Set) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 138 | Medium |
Integer is incompatible with expected argument type Short in org.opentrafficsim.trafficcontrol.trafcod.Diagram.routePoint(int, Diagram$RouteStep[]) | CORRECTNESS | GC_UNRELATED_TYPES | 690 | High |
org.opentrafficsim.trafficcontrol.trafcod.Diagram$2
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Write to static field org.opentrafficsim.trafficcontrol.trafcod.Diagram.checkBoxPanel from instance method org.opentrafficsim.trafficcontrol.trafcod.Diagram$2.run() | STYLE | ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD | 814 | Medium |
org.opentrafficsim.trafficcontrol.trafcod.Diagram$RouteStep
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Exception thrown in class org.opentrafficsim.trafficcontrol.trafcod.Diagram$RouteStep at new org.opentrafficsim.trafficcontrol.trafcod.Diagram$RouteStep(Diagram, int, int, Diagram$Command) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 435 | Medium |
Exception thrown in class org.opentrafficsim.trafficcontrol.trafcod.Diagram$RouteStep at new org.opentrafficsim.trafficcontrol.trafcod.Diagram$RouteStep(Diagram, Diagram$Command) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 473 | Medium |
Exception thrown in class org.opentrafficsim.trafficcontrol.trafcod.Diagram$RouteStep at new org.opentrafficsim.trafficcontrol.trafcod.Diagram$RouteStep(Diagram, Diagram$Command, int) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 456 | Medium |
Should org.opentrafficsim.trafficcontrol.trafcod.Diagram$RouteStep be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 418-521 | Medium |
org.opentrafficsim.trafficcontrol.trafcod.NameAndStream
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Exception thrown in class org.opentrafficsim.trafficcontrol.trafcod.NameAndStream at new org.opentrafficsim.trafficcontrol.trafcod.NameAndStream(String, String) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 1944 | Medium |
org.opentrafficsim.trafficcontrol.trafcod.TrafCod
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Exception thrown in class org.opentrafficsim.trafficcontrol.trafcod.TrafCod at new org.opentrafficsim.trafficcontrol.trafcod.TrafCod(String, URL, OtsSimulatorInterface, Container, BufferedImage, List) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 163 | Medium |
Exception thrown in class org.opentrafficsim.trafficcontrol.trafcod.TrafCod at new org.opentrafficsim.trafficcontrol.trafcod.TrafCod(String, List, OtsSimulatorInterface, BufferedImage, List) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 182 | Medium |
Dead store to tli in org.opentrafficsim.trafficcontrol.trafcod.TrafCod.addTrafCODDisplay(List) | STYLE | DLS_DEAD_LOCAL_STORE | 591 | Medium |
Found reliance on default encoding in org.opentrafficsim.trafficcontrol.trafcod.TrafCod.loadTextFromURL(URL): new java.io.InputStreamReader(InputStream) | I18N | DM_DEFAULT_ENCODING | 232 | High |
org.opentrafficsim.trafficcontrol.trafcod.TrafCod.parse(String, String) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead | PERFORMANCE | DM_NUMBER_CTOR | 1516 | Medium |
org.opentrafficsim.trafficcontrol.trafcod.TrafCod.getDisplayContainer() may expose internal representation by returning TrafCod.displayContainer | MALICIOUS_CODE | EI_EXPOSE_REP | 1889 | Medium |
new org.opentrafficsim.trafficcontrol.trafcod.TrafCod(String, List, OtsSimulatorInterface, BufferedImage, List) may expose internal representation by storing an externally mutable object into TrafCod.displayBackground | MALICIOUS_CODE | EI_EXPOSE_REP2 | 185 | Medium |
new org.opentrafficsim.trafficcontrol.trafcod.TrafCod(String, List, OtsSimulatorInterface, BufferedImage, List) may expose internal representation by storing an externally mutable object into TrafCod.displayObjectLocations | MALICIOUS_CODE | EI_EXPOSE_REP2 | 186 | Medium |
new org.opentrafficsim.trafficcontrol.trafcod.TrafCod(String, List, OtsSimulatorInterface, BufferedImage, List) may expose internal representation by storing an externally mutable object into TrafCod.trafCODRules | MALICIOUS_CODE | EI_EXPOSE_REP2 | 188 | Medium |
v could be null and is guaranteed to be dereferenced in org.opentrafficsim.trafficcontrol.trafcod.TrafCod.notify(Event) | CORRECTNESS | NP_GUARANTEED_DEREF | 1838 | High |
org.opentrafficsim.trafficcontrol.trafcod.TrafCod.loadTextFromURL(URL) may fail to close stream | BAD_PRACTICE | OS_OPEN_STREAM | 232 | Medium |
org.opentrafficsim.trafficcontrol.trafcod.TrafCodDisplay
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.trafficcontrol.trafcod.TrafCodDisplay(BufferedImage) may expose internal representation by storing an externally mutable object into TrafCodDisplay.image | MALICIOUS_CODE | EI_EXPOSE_REP2 | 55 | Medium |
org.opentrafficsim.trafficcontrol.trafcod.Variable
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Load of known null value in org.opentrafficsim.trafficcontrol.trafcod.Variable.cloneState(Variable, Network) | STYLE | NP_LOAD_OF_KNOWN_NULL_VALUE | 2327 | Medium |
A known null value is checked to see if it is an instance of org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLight in org.opentrafficsim.trafficcontrol.trafcod.Variable.cloneState(Variable, Network) | CORRECTNESS | NP_NULL_INSTANCEOF | 2327 | Medium |