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 |
106 |
63 |
0 |
0 |
com.bric.multislider.DefaultMultiThumbSliderUi
Bug |
Category |
Details |
Line |
Priority |
Using floating-point loop counters can lead to unexpected behavior. |
CORRECTNESS |
FL_FLOATS_AS_LOOP_COUNTERS |
72 |
Medium |
com.bric.multislider.MultiThumbSlider
Bug |
Category |
Details |
Line |
Priority |
Exception thrown in class com.bric.multislider.MultiThumbSlider at new com.bric.multislider.MultiThumbSlider(int, float[], Object[]) 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 |
Exception thrown in class com.bric.multislider.MultiThumbSlider at new com.bric.multislider.MultiThumbSlider(float[], Object[]) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. |
BAD_PRACTICE |
CT_CONSTRUCTOR_THROW |
159 |
Medium |
com.bric.multislider.MultiThumbSlider.setSelectedThumb(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead |
PERFORMANCE |
DM_NUMBER_CTOR |
669 |
Medium |
com.bric.multislider.MultiThumbSliderUi
Bug |
Category |
Details |
Line |
Priority |
new com.bric.multislider.MultiThumbSliderUi(MultiThumbSlider) may expose internal representation by storing an externally mutable object into MultiThumbSliderUi.slider |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
288 |
Medium |
Inconsistent synchronization of com.bric.multislider.MultiThumbSliderUi.mouseInside; locked 50% of time |
MT_CORRECTNESS |
IS2_INCONSISTENT_SYNC |
1106 |
Medium |
Inconsistent synchronization of com.bric.multislider.MultiThumbSliderUi.thumbIndications; locked 75% of time |
MT_CORRECTNESS |
IS2_INCONSISTENT_SYNC |
1074 |
Medium |
Inconsistent synchronization of com.bric.multislider.MultiThumbSliderUi.thumbPositions; locked 57% of time |
MT_CORRECTNESS |
IS2_INCONSISTENT_SYNC |
893 |
Medium |
com.bric.multislider.MultiThumbSliderUi$State
Bug |
Category |
Details |
Line |
Priority |
Exception thrown in class com.bric.multislider.MultiThumbSliderUi$State at new com.bric.multislider.MultiThumbSliderUi$State(MultiThumbSliderUi, MultiThumbSliderUi$State) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. |
BAD_PRACTICE |
CT_CONSTRUCTOR_THROW |
356 |
Medium |
com.bric.multislider.PlafPaintUtils
Bug |
Category |
Details |
Line |
Priority |
instanceof will always return true for all non-null values in com.bric.multislider.PlafPaintUtils.getFocusRingColor(), since all java.awt.Color are instances of java.awt.Color |
STYLE |
BC_VACUOUS_INSTANCEOF |
59 |
Medium |
Incorrect lazy initialization of static field com.bric.multislider.PlafPaintUtils.checkers in com.bric.multislider.PlafPaintUtils.getCheckerBoard(int, Color, Color) |
MT_CORRECTNESS |
LI_LAZY_INIT_STATIC |
269-270 |
Medium |
org.opentrafficsim.swing.graphs.SwingContourPlot
Bug |
Category |
Details |
Line |
Priority |
org.opentrafficsim.swing.graphs.SwingContourPlot.setSpaceGranularityRadioButton(double) makes inefficient use of keySet iterator instead of entrySet iterator |
PERFORMANCE |
WMI_WRONG_MAP_ITERATOR |
166 |
Medium |
org.opentrafficsim.swing.graphs.SwingContourPlot.setTimeGranularityRadioButton(double) makes inefficient use of keySet iterator instead of entrySet iterator |
PERFORMANCE |
WMI_WRONG_MAP_ITERATOR |
180 |
Medium |
org.opentrafficsim.swing.graphs.SwingPlot
Bug |
Category |
Details |
Line |
Priority |
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 |
64 |
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 |
152 |
High |
new org.opentrafficsim.swing.gui.AppearanceApplication(JPanel) may fail to clean up java.io.Reader |
EXPERIMENTAL |
OBL_UNSATISFIED_OBLIGATION |
152 |
Medium |
new org.opentrafficsim.swing.gui.AppearanceApplication(JPanel) may fail to close stream |
BAD_PRACTICE |
OS_OPEN_STREAM |
152 |
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 |
135 |
High |
org.opentrafficsim.swing.gui.AppearanceApplication$1.windowClosing(WindowEvent) may fail to clean up java.io.Writer |
EXPERIMENTAL |
OBL_UNSATISFIED_OBLIGATION |
135 |
Medium |
org.opentrafficsim.swing.gui.AppearanceApplication$1.windowClosing(WindowEvent) may fail to close stream |
BAD_PRACTICE |
OS_OPEN_STREAM |
135 |
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 |
134 |
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 |
461-477 |
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 |
44 |
Medium |
org.opentrafficsim.swing.gui.ColorControlPanel
Bug |
Category |
Details |
Line |
Priority |
new org.opentrafficsim.swing.gui.ColorControlPanel(GtuColorer) may expose internal representation by storing an externally mutable object into ColorControlPanel.switchableGtuColorer |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
55 |
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 |
106 |
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 |
92 |
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, Dimension, OtsAnimator, OtsModelInterface, GtuColorer, Network) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. |
BAD_PRACTICE |
CT_CONSTRUCTOR_THROW |
171 |
Medium |
org.opentrafficsim.swing.gui.OtsAnimationPanel.getAnimationPanel() may expose internal representation by returning OtsAnimationPanel.animationPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
560 |
Medium |
org.opentrafficsim.swing.gui.OtsAnimationPanel.getColorControlPanel() may expose internal representation by returning OtsAnimationPanel.colorControlPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
678 |
Medium |
org.opentrafficsim.swing.gui.OtsAnimationPanel.getDemoPanel() may expose internal representation by returning OtsAnimationPanel.demoPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
621 |
Medium |
new org.opentrafficsim.swing.gui.OtsAnimationPanel(Rectangle2D, Dimension, OtsAnimator, OtsModelInterface, GtuColorer, Network) invokes org.opentrafficsim.swing.gui.OtsAnimationPanel$UpdateTimer.start() |
MT_CORRECTNESS |
SC_START_IN_CTOR |
231 |
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 |
1064 |
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 |
706 |
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 |
705 |
Medium |
Should org.opentrafficsim.swing.gui.OtsAnimationPanel$DisposeOnCloseThread be a _static_ inner class? |
PERFORMANCE |
SIC_INNER_SHOULD_BE_STATIC |
705-741 |
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 |
137 |
Medium |
Do not catch NullPointerException like in org.opentrafficsim.swing.gui.OtsControlPanel.loadGrayscaleIcon(String) |
STYLE |
DCN_NULLPOINTER_EXCEPTION |
300 |
Medium |
Do not catch NullPointerException like in org.opentrafficsim.swing.gui.OtsControlPanel.loadIcon(String) |
STYLE |
DCN_NULLPOINTER_EXCEPTION |
282 |
Medium |
org.opentrafficsim.swing.gui.OtsControlPanel.getOtsSearchPanel() may expose internal representation by returning OtsControlPanel.otsSearchPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
218 |
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 |
355 |
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 |
354 |
Medium |
Should org.opentrafficsim.swing.gui.OtsControlPanel$DisposeOnCloseThread be a _static_ inner class? |
PERFORMANCE |
SIC_INNER_SHOULD_BE_STATIC |
354-391 |
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 |
797 |
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 |
60 |
Medium |
org.opentrafficsim.swing.gui.OtsSimulationApplication
Bug |
Category |
Details |
Line |
Priority |
Exception thrown in class org.opentrafficsim.swing.gui.OtsSimulationApplication at new org.opentrafficsim.swing.gui.OtsSimulationApplication(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 |
37 |
Medium |
org.opentrafficsim.swing.gui.OtsSimulationApplication.getAnimationPanel() may expose internal representation by returning OtsSimulationApplication.animationPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
74 |
Medium |
new org.opentrafficsim.swing.gui.OtsSimulationApplication(OtsModelInterface, OtsAnimationPanel) may expose internal representation by storing an externally mutable object into OtsSimulationApplication.animationPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
35 |
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 |
132 |
Medium |
org.opentrafficsim.swing.gui.OtsSimulationPanel.getOtsControlPanel() may expose internal representation by returning OtsSimulationPanel.otsControlPanel |
MALICIOUS_CODE |
EI_EXPOSE_REP |
124 |
Medium |
org.opentrafficsim.swing.gui.OtsSimulationPanel.getTabbedPane() may expose internal representation by returning OtsSimulationPanel.tabbedPane |
MALICIOUS_CODE |
EI_EXPOSE_REP |
107 |
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 |
115 |
Medium |
org.opentrafficsim.swing.script.AbstractSimulationScript.start() invokes System.exit(...), which shuts down the entire virtual machine |
BAD_PRACTICE |
DM_EXIT |
220 |
Medium |
org.opentrafficsim.swing.script.AbstractSimulationScript.getNetwork() may expose internal representation by returning AbstractSimulationScript.network |
MALICIOUS_CODE |
EI_EXPOSE_REP |
286 |
Medium |
org.opentrafficsim.swing.script.AbstractSimulationScript.getSimulationTime() may expose internal representation by returning AbstractSimulationScript.simulationTime |
MALICIOUS_CODE |
EI_EXPOSE_REP |
152 |
Medium |
org.opentrafficsim.swing.script.AbstractSimulationScript.getStartTime() may expose internal representation by returning AbstractSimulationScript.startTime |
MALICIOUS_CODE |
EI_EXPOSE_REP |
134 |
Medium |
org.opentrafficsim.swing.script.AbstractSimulationScript.getWarmupTime() may expose internal representation by returning AbstractSimulationScript.warmupTime |
MALICIOUS_CODE |
EI_EXPOSE_REP |
143 |
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 |
56 |
Medium |
org.opentrafficsim.swing.script.IdmOptions.getATruck() may expose internal representation by returning IdmOptions.aTruck |
MALICIOUS_CODE |
EI_EXPOSE_REP |
65 |
Medium |
org.opentrafficsim.swing.script.IdmOptions.getB() may expose internal representation by returning IdmOptions.b |
MALICIOUS_CODE |
EI_EXPOSE_REP |
74 |
Medium |
org.opentrafficsim.swing.script.IdmOptions.getTMax() may expose internal representation by returning IdmOptions.tMax |
MALICIOUS_CODE |
EI_EXPOSE_REP |
92 |
Medium |
org.opentrafficsim.swing.script.IdmOptions.getTMin() may expose internal representation by returning IdmOptions.tMin |
MALICIOUS_CODE |
EI_EXPOSE_REP |
83 |
Medium |