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 |
| 79 |
59 |
0 |
0 |
org.opentrafficsim.swing.graphs.SwingContourPlot
| Bug |
Category |
Details |
Line |
Priority |
| org.opentrafficsim.swing.graphs.SwingContourPlot.notify(Event) makes inefficient use of keySet iterator instead of entrySet iterator |
PERFORMANCE |
WMI_WRONG_MAP_ITERATOR |
171 |
Medium |
org.opentrafficsim.swing.graphs.SwingPlot
| Bug |
Category |
Details |
Line |
Priority |
| org.opentrafficsim.swing.graphs.SwingPlot.getChartPanel() may expose internal representation by returning SwingPlot.chartPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
289 |
Medium |
| org.opentrafficsim.swing.graphs.SwingPlot.getPlot() may expose internal representation by returning SwingPlot.plot |
MALICIOUS_CODE |
EI_EXPOSE_REP |
280 |
Medium |
| new org.opentrafficsim.swing.graphs.SwingPlot(AbstractPlot) may expose internal representation by storing an externally mutable object into SwingPlot.plot |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
68 |
Medium |
org.opentrafficsim.swing.graphs.SwingTrajectoryPlot
| Bug |
Category |
Details |
Line |
Priority |
| Exception thrown in class org.opentrafficsim.swing.graphs.SwingTrajectoryPlot at new org.opentrafficsim.swing.graphs.SwingTrajectoryPlot(TrajectoryPlot) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. |
BAD_PRACTICE |
CT_CONSTRUCTOR_THROW |
79 |
Medium |
| Exception thrown in class org.opentrafficsim.swing.graphs.SwingTrajectoryPlot at new org.opentrafficsim.swing.graphs.SwingTrajectoryPlot(TrajectoryPlot, boolean) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. |
BAD_PRACTICE |
CT_CONSTRUCTOR_THROW |
94 |
Medium |
org.opentrafficsim.swing.gui.AppearanceApplication
| Bug |
Category |
Details |
Line |
Priority |
| Found reliance on default encoding in new org.opentrafficsim.swing.gui.AppearanceApplication(JPanel): new java.io.FileReader(String) |
I18N |
DM_DEFAULT_ENCODING |
154 |
High |
| new org.opentrafficsim.swing.gui.AppearanceApplication(JPanel) may fail to clean up java.io.Reader |
EXPERIMENTAL |
OBL_UNSATISFIED_OBLIGATION |
154 |
Medium |
| new org.opentrafficsim.swing.gui.AppearanceApplication(JPanel) may fail to close stream |
BAD_PRACTICE |
OS_OPEN_STREAM |
154 |
Medium |
org.opentrafficsim.swing.gui.AppearanceApplication$1
| Bug |
Category |
Details |
Line |
Priority |
| Found reliance on default encoding in org.opentrafficsim.swing.gui.AppearanceApplication$1.windowClosing(WindowEvent): new java.io.FileWriter(File) |
I18N |
DM_DEFAULT_ENCODING |
137 |
High |
| org.opentrafficsim.swing.gui.AppearanceApplication$1.windowClosing(WindowEvent) may fail to clean up java.io.Writer |
EXPERIMENTAL |
OBL_UNSATISFIED_OBLIGATION |
137 |
Medium |
| org.opentrafficsim.swing.gui.AppearanceApplication$1.windowClosing(WindowEvent) may fail to close stream |
BAD_PRACTICE |
OS_OPEN_STREAM |
137 |
Medium |
| Exceptional return value of java.io.File.mkdirs() ignored in org.opentrafficsim.swing.gui.AppearanceApplication$1.windowClosing(WindowEvent) |
BAD_PRACTICE |
RV_RETURN_VALUE_IGNORED_BAD_PRACTICE |
136 |
Medium |
org.opentrafficsim.swing.gui.AppearanceApplication$SubMenuShower
| Bug |
Category |
Details |
Line |
Priority |
| Should org.opentrafficsim.swing.gui.AppearanceApplication$SubMenuShower be a _static_ inner class? |
PERFORMANCE |
SIC_INNER_SHOULD_BE_STATIC |
458-472 |
Medium |
org.opentrafficsim.swing.gui.AppearanceControl
| Bug |
Category |
Details |
Line |
Priority |
| The class name org.opentrafficsim.swing.gui.AppearanceControl shadows the simple name of implemented interface nl.tudelft.simulation.dsol.swing.gui.appearance.AppearanceControl |
BAD_PRACTICE |
NM_SAME_SIMPLE_NAME_AS_INTERFACE |
38-46 |
Medium |
org.opentrafficsim.swing.gui.ColorControlPanel
| Bug |
Category |
Details |
Line |
Priority |
| org.opentrafficsim.swing.gui.ColorControlPanel.getGtuColorerManager() may expose internal representation by returning ColorControlPanel.gtuColorerManager |
MALICIOUS_CODE |
EI_EXPOSE_REP |
91 |
Medium |
org.opentrafficsim.swing.gui.CustomSimulation$CustomModel
| Bug |
Category |
Details |
Line |
Priority |
| org.opentrafficsim.swing.gui.CustomSimulation$CustomModel.getNetwork() may expose internal representation by returning CustomSimulation$CustomModel.network |
MALICIOUS_CODE |
EI_EXPOSE_REP |
101 |
Medium |
| org.opentrafficsim.swing.gui.CustomSimulation$CustomModel.setNetwork(RoadNetwork) may expose internal representation by storing an externally mutable object into CustomSimulation$CustomModel.network |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
89 |
Medium |
org.opentrafficsim.swing.gui.GhostText
| Bug |
Category |
Details |
Line |
Priority |
| new org.opentrafficsim.swing.gui.GhostText(JTextComponent, String) may expose internal representation by storing an externally mutable object into GhostText.textComp |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
47 |
Medium |
org.opentrafficsim.swing.gui.OtsAnimationPanel
| Bug |
Category |
Details |
Line |
Priority |
| Exception thrown in class org.opentrafficsim.swing.gui.OtsAnimationPanel at new org.opentrafficsim.swing.gui.OtsAnimationPanel(Rectangle2D, OtsAnimator, OtsModelInterface, List, Network) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. |
BAD_PRACTICE |
CT_CONSTRUCTOR_THROW |
170 |
Medium |
| org.opentrafficsim.swing.gui.OtsAnimationPanel.getAnimationPanel() may expose internal representation by returning OtsAnimationPanel.animationPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
539 |
Medium |
| org.opentrafficsim.swing.gui.OtsAnimationPanel.getColorControlPanel() may expose internal representation by returning OtsAnimationPanel.colorControlPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
647 |
Medium |
| org.opentrafficsim.swing.gui.OtsAnimationPanel.getDemoPanel() may expose internal representation by returning OtsAnimationPanel.demoPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
600 |
Medium |
| new org.opentrafficsim.swing.gui.OtsAnimationPanel(Rectangle2D, OtsAnimator, OtsModelInterface, List, Network) invokes org.opentrafficsim.swing.gui.OtsAnimationPanel$UpdateTimer.start() |
MT_CORRECTNESS |
SC_START_IN_CTOR |
234 |
Medium |
org.opentrafficsim.swing.gui.OtsAnimationPanel$AutoAnimationPanel
| Bug |
Category |
Details |
Line |
Priority |
| Unwritten field: org.opentrafficsim.swing.gui.OtsAnimationPanel$AutoAnimationPanel.lastGtu |
CORRECTNESS |
UWF_UNWRITTEN_FIELD |
962 |
Medium |
org.opentrafficsim.swing.gui.OtsAnimationPanel$DisposeOnCloseThread
| Bug |
Category |
Details |
Line |
Priority |
| new org.opentrafficsim.swing.gui.OtsAnimationPanel$DisposeOnCloseThread(OtsAnimationPanel, OtsAnimationPanel) may expose internal representation by storing an externally mutable object into OtsAnimationPanel$DisposeOnCloseThread.panel |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
676 |
Medium |
| new org.opentrafficsim.swing.gui.OtsAnimationPanel$DisposeOnCloseThread(OtsAnimationPanel, OtsAnimationPanel) may expose internal representation by storing an externally mutable object into OtsAnimationPanel$DisposeOnCloseThread.this$0 |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
675 |
Medium |
| Should org.opentrafficsim.swing.gui.OtsAnimationPanel$DisposeOnCloseThread be a _static_ inner class? |
PERFORMANCE |
SIC_INNER_SHOULD_BE_STATIC |
675-709 |
Medium |
org.opentrafficsim.swing.gui.OtsAnimationPanel$UpdateTimer
| Bug |
Category |
Details |
Line |
Priority |
| new org.opentrafficsim.swing.gui.OtsAnimationPanel$UpdateTimer(OtsAnimationPanel) may expose internal representation by storing an externally mutable object into OtsAnimationPanel$UpdateTimer.this$0 |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
787 |
Medium |
org.opentrafficsim.swing.gui.OtsControlPanel
| Bug |
Category |
Details |
Line |
Priority |
| Exception thrown in class org.opentrafficsim.swing.gui.OtsControlPanel at new org.opentrafficsim.swing.gui.OtsControlPanel(OtsSimulatorInterface, OtsModelInterface, OtsAnimationPanel) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. |
BAD_PRACTICE |
CT_CONSTRUCTOR_THROW |
146 |
Medium |
| Do not catch NullPointerException like in org.opentrafficsim.swing.gui.OtsControlPanel.loadGrayscaleIcon(String) |
STYLE |
DCN_NULLPOINTER_EXCEPTION |
305 |
Medium |
| Do not catch NullPointerException like in org.opentrafficsim.swing.gui.OtsControlPanel.loadIcon(String) |
STYLE |
DCN_NULLPOINTER_EXCEPTION |
286 |
Medium |
| org.opentrafficsim.swing.gui.OtsControlPanel.getOtsSearchPanel() may expose internal representation by returning OtsControlPanel.otsSearchPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
224 |
Medium |
| Exception is caught when Exception is not thrown in org.opentrafficsim.swing.gui.OtsControlPanel.actionPerformed(ActionEvent) |
STYLE |
REC_CATCH_EXCEPTION |
466 |
Medium |
org.opentrafficsim.swing.gui.OtsControlPanel$DisposeOnCloseThread
| Bug |
Category |
Details |
Line |
Priority |
| new org.opentrafficsim.swing.gui.OtsControlPanel$DisposeOnCloseThread(OtsControlPanel, OtsControlPanel) may expose internal representation by storing an externally mutable object into OtsControlPanel$DisposeOnCloseThread.panel |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
354 |
Medium |
| new org.opentrafficsim.swing.gui.OtsControlPanel$DisposeOnCloseThread(OtsControlPanel, OtsControlPanel) may expose internal representation by storing an externally mutable object into OtsControlPanel$DisposeOnCloseThread.this$0 |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
353 |
Medium |
| Should org.opentrafficsim.swing.gui.OtsControlPanel$DisposeOnCloseThread be a _static_ inner class? |
PERFORMANCE |
SIC_INNER_SHOULD_BE_STATIC |
353-388 |
Medium |
org.opentrafficsim.swing.gui.OtsControlPanel$TimeWarpPanel
| Bug |
Category |
Details |
Line |
Priority |
| Exception thrown in class org.opentrafficsim.swing.gui.OtsControlPanel$TimeWarpPanel at new org.opentrafficsim.swing.gui.OtsControlPanel$TimeWarpPanel(OtsControlPanel, double, double, double, int, OtsSimulatorInterface) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. |
BAD_PRACTICE |
CT_CONSTRUCTOR_THROW |
780 |
Medium |
org.opentrafficsim.swing.gui.OtsSearchPanel
| Bug |
Category |
Details |
Line |
Priority |
| new org.opentrafficsim.swing.gui.OtsSearchPanel(OtsAnimationPanel) may expose internal representation by storing an externally mutable object into OtsSearchPanel.otsAnimationPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
61 |
Medium |
org.opentrafficsim.swing.gui.OtsSimulationApplication
| Bug |
Category |
Details |
Line |
Priority |
| org.opentrafficsim.swing.gui.OtsSimulationApplication.getAnimationPanel() may expose internal representation by returning OtsSimulationApplication.animationPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
90 |
Medium |
| new org.opentrafficsim.swing.gui.OtsSimulationApplication(OtsModelInterface, OtsAnimationPanel, Map) may expose internal representation by storing an externally mutable object into OtsSimulationApplication.animationPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
42 |
Medium |
| new org.opentrafficsim.swing.gui.OtsSimulationApplication(OtsModelInterface, OtsAnimationPanel, Map) may expose internal representation by storing an externally mutable object into OtsSimulationApplication.markers |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
43 |
Medium |
org.opentrafficsim.swing.gui.OtsSimulationPanel
| Bug |
Category |
Details |
Line |
Priority |
| org.opentrafficsim.swing.gui.OtsSimulationPanel.getConsole() may expose internal representation by returning OtsSimulationPanel.console |
MALICIOUS_CODE |
EI_EXPOSE_REP |
135 |
Medium |
| org.opentrafficsim.swing.gui.OtsSimulationPanel.getOtsControlPanel() may expose internal representation by returning OtsSimulationPanel.otsControlPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
126 |
Medium |
| org.opentrafficsim.swing.gui.OtsSimulationPanel.getTabbedPane() may expose internal representation by returning OtsSimulationPanel.tabbedPane |
MALICIOUS_CODE |
EI_EXPOSE_REP |
108 |
Medium |
org.opentrafficsim.swing.gui.ProbabilityDistributionEditor
| Bug |
Category |
Details |
Line |
Priority |
| Exception thrown in class org.opentrafficsim.swing.gui.ProbabilityDistributionEditor at new org.opentrafficsim.swing.gui.ProbabilityDistributionEditor(List, 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 |
62 |
Medium |
org.opentrafficsim.swing.script.AbstractSimulationScript
| Bug |
Category |
Details |
Line |
Priority |
| Exception thrown in class org.opentrafficsim.swing.script.AbstractSimulationScript at new org.opentrafficsim.swing.script.AbstractSimulationScript(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 |
121 |
Medium |
| org.opentrafficsim.swing.script.AbstractSimulationScript.start() invokes System.exit(...), which shuts down the entire virtual machine |
BAD_PRACTICE |
DM_EXIT |
235 |
Medium |
| org.opentrafficsim.swing.script.AbstractSimulationScript.getGtuColorers() may expose internal representation by returning AbstractSimulationScript.gtuColorers |
MALICIOUS_CODE |
EI_EXPOSE_REP |
185 |
Medium |
| org.opentrafficsim.swing.script.AbstractSimulationScript.getNetwork() may expose internal representation by returning AbstractSimulationScript.network |
MALICIOUS_CODE |
EI_EXPOSE_REP |
300 |
Medium |
| org.opentrafficsim.swing.script.AbstractSimulationScript.getSimulationTime() may expose internal representation by returning AbstractSimulationScript.simulationTime |
MALICIOUS_CODE |
EI_EXPOSE_REP |
158 |
Medium |
| org.opentrafficsim.swing.script.AbstractSimulationScript.getStartTime() may expose internal representation by returning AbstractSimulationScript.startTime |
MALICIOUS_CODE |
EI_EXPOSE_REP |
140 |
Medium |
| org.opentrafficsim.swing.script.AbstractSimulationScript.getWarmupTime() may expose internal representation by returning AbstractSimulationScript.warmupTime |
MALICIOUS_CODE |
EI_EXPOSE_REP |
149 |
Medium |
| org.opentrafficsim.swing.script.AbstractSimulationScript.setGtuColorers(List) may expose internal representation by storing an externally mutable object into AbstractSimulationScript.gtuColorers |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
176 |
Medium |
org.opentrafficsim.swing.script.IdmOptions
| Bug |
Category |
Details |
Line |
Priority |
| org.opentrafficsim.swing.script.IdmOptions.getACar() may expose internal representation by returning IdmOptions.aCar |
MALICIOUS_CODE |
EI_EXPOSE_REP |
64 |
Medium |
| org.opentrafficsim.swing.script.IdmOptions.getATruck() may expose internal representation by returning IdmOptions.aTruck |
MALICIOUS_CODE |
EI_EXPOSE_REP |
73 |
Medium |
| org.opentrafficsim.swing.script.IdmOptions.getB() may expose internal representation by returning IdmOptions.b |
MALICIOUS_CODE |
EI_EXPOSE_REP |
82 |
Medium |
| org.opentrafficsim.swing.script.IdmOptions.getTMax() may expose internal representation by returning IdmOptions.tMax |
MALICIOUS_CODE |
EI_EXPOSE_REP |
100 |
Medium |
| org.opentrafficsim.swing.script.IdmOptions.getTMin() may expose internal representation by returning IdmOptions.tMin |
MALICIOUS_CODE |
EI_EXPOSE_REP |
91 |
Medium |