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
107 66 0 0

Files

Class Bugs
com.bric.multislider.DefaultMultiThumbSliderUi 1
com.bric.multislider.MultiThumbSlider 3
com.bric.multislider.MultiThumbSliderUi 4
com.bric.multislider.MultiThumbSliderUi$State 1
com.bric.multislider.PlafPaintUtils 2
org.opentrafficsim.swing.graphs.SwingContourPlot 2
org.opentrafficsim.swing.graphs.SwingPlot 3
org.opentrafficsim.swing.gui.AppearanceApplication 3
org.opentrafficsim.swing.gui.AppearanceApplication$1 4
org.opentrafficsim.swing.gui.AppearanceApplication$SubMenuShower 1
org.opentrafficsim.swing.gui.AppearanceControl 1
org.opentrafficsim.swing.gui.ColorControlPanel 1
org.opentrafficsim.swing.gui.CustomSimulation$CustomModel 2
org.opentrafficsim.swing.gui.GhostText 1
org.opentrafficsim.swing.gui.OtsAnimationPanel 5
org.opentrafficsim.swing.gui.OtsAnimationPanel$AutoAnimationPanel 1
org.opentrafficsim.swing.gui.OtsAnimationPanel$DisposeOnCloseThread 3
org.opentrafficsim.swing.gui.OtsControlPanel 4
org.opentrafficsim.swing.gui.OtsControlPanel$DisposeOnCloseThread 3
org.opentrafficsim.swing.gui.OtsControlPanel$TimeWarpPanel 1
org.opentrafficsim.swing.gui.OtsSearchPanel 1
org.opentrafficsim.swing.gui.OtsSimulationApplication 3
org.opentrafficsim.swing.gui.OtsSimulationPanel 3
org.opentrafficsim.swing.script.AbstractSimulationScript 8
org.opentrafficsim.swing.script.IdmOptions 5

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 161 Medium
org.opentrafficsim.swing.graphs.SwingContourPlot.setTimeGranularityRadioButton(double) makes inefficient use of keySet iterator instead of entrySet iterator PERFORMANCE WMI_WRONG_MAP_ITERATOR 175 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 288 Medium
org.opentrafficsim.swing.graphs.SwingPlot.getPlot() may expose internal representation by returning SwingPlot.plot MALICIOUS_CODE EI_EXPOSE_REP 279 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 67 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 455-469 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
org.opentrafficsim.swing.gui.ColorControlPanel.getGtuColorerManager() may expose internal representation by returning ColorControlPanel.gtuColorerManager MALICIOUS_CODE EI_EXPOSE_REP 82 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 105 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 93 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, 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 168 Medium
org.opentrafficsim.swing.gui.OtsAnimationPanel.getAnimationPanel() may expose internal representation by returning OtsAnimationPanel.animationPanel MALICIOUS_CODE EI_EXPOSE_REP 559 Medium
org.opentrafficsim.swing.gui.OtsAnimationPanel.getColorControlPanel() may expose internal representation by returning OtsAnimationPanel.colorControlPanel MALICIOUS_CODE EI_EXPOSE_REP 667 Medium
org.opentrafficsim.swing.gui.OtsAnimationPanel.getDemoPanel() may expose internal representation by returning OtsAnimationPanel.demoPanel MALICIOUS_CODE EI_EXPOSE_REP 620 Medium
new org.opentrafficsim.swing.gui.OtsAnimationPanel(Rectangle2D, Dimension, OtsAnimator, OtsModelInterface, List, 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 1037 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 695 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 694 Medium
Should org.opentrafficsim.swing.gui.OtsAnimationPanel$DisposeOnCloseThread be a _static_ inner class? PERFORMANCE SIC_INNER_SHOULD_BE_STATIC 694-728 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 294 Medium
Do not catch NullPointerException like in org.opentrafficsim.swing.gui.OtsControlPanel.loadIcon(String) STYLE DCN_NULLPOINTER_EXCEPTION 276 Medium
org.opentrafficsim.swing.gui.OtsControlPanel.getOtsSearchPanel() may expose internal representation by returning OtsControlPanel.otsSearchPanel MALICIOUS_CODE EI_EXPOSE_REP 214 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 348 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 347 Medium
Should org.opentrafficsim.swing.gui.OtsControlPanel$DisposeOnCloseThread be a _static_ inner class? PERFORMANCE SIC_INNER_SHOULD_BE_STATIC 347-382 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 777 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
org.opentrafficsim.swing.gui.OtsSimulationApplication.getAnimationPanel() may expose internal representation by returning OtsSimulationApplication.animationPanel MALICIOUS_CODE EI_EXPOSE_REP 89 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 41 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 42 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 123 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.start() invokes System.exit(...), which shuts down the entire virtual machine BAD_PRACTICE DM_EXIT 237 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getGtuColorers() may expose internal representation by returning AbstractSimulationScript.gtuColorers MALICIOUS_CODE EI_EXPOSE_REP 187 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getNetwork() may expose internal representation by returning AbstractSimulationScript.network MALICIOUS_CODE EI_EXPOSE_REP 303 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getSimulationTime() may expose internal representation by returning AbstractSimulationScript.simulationTime MALICIOUS_CODE EI_EXPOSE_REP 160 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getStartTime() may expose internal representation by returning AbstractSimulationScript.startTime MALICIOUS_CODE EI_EXPOSE_REP 142 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getWarmupTime() may expose internal representation by returning AbstractSimulationScript.warmupTime MALICIOUS_CODE EI_EXPOSE_REP 151 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 178 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