SpotBugs Bug Detector Report

The following document contains the results of SpotBugs

SpotBugs Version is 4.7.1

Threshold is medium

Effort is default

Summary

Classes Bugs Errors Missing Classes
101 51 0 0

Files

Class Bugs
com.bric.multislider.DefaultMultiThumbSliderUI 1
com.bric.multislider.JVM 1
com.bric.multislider.MultiThumbSlider 1
com.bric.multislider.MultiThumbSliderUI 4
com.bric.multislider.PlafPaintUtils 2
org.opentrafficsim.swing.graphs.SwingContourPlot 2
org.opentrafficsim.swing.graphs.SwingPlot 2
org.opentrafficsim.swing.gui.ColorControlPanel 1
org.opentrafficsim.swing.gui.OTSAnimationPanel 4
org.opentrafficsim.swing.gui.OTSAnimationPanel$AutoAnimationPanel 1
org.opentrafficsim.swing.gui.OTSAnimationPanel$DisposeOnCloseThread 3
org.opentrafficsim.swing.gui.OTSControlPanel 3
org.opentrafficsim.swing.gui.OTSControlPanel$DisposeOnCloseThread 3
org.opentrafficsim.swing.gui.OTSSearchPanel 1
org.opentrafficsim.swing.gui.OTSSimulationApplication 2
org.opentrafficsim.swing.gui.OTSSimulationPanel 3
org.opentrafficsim.swing.gui.OTSSwingApplication 3
org.opentrafficsim.swing.gui.OTSSwingApplication$2 4
org.opentrafficsim.swing.script.AbstractSimulationScript 5
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.JVM

Bug Category Details Line Priority
Using floating-point loop counters can lead to unexpected behavior. CORRECTNESS FL_FLOATS_AS_LOOP_COUNTERS 144 Medium

com.bric.multislider.MultiThumbSlider

Bug Category Details Line Priority
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 285 Medium
Inconsistent synchronization of com.bric.multislider.MultiThumbSliderUI.mouseInside; locked 50% of time MT_CORRECTNESS IS2_INCONSISTENT_SYNC 1107 Medium
Inconsistent synchronization of com.bric.multislider.MultiThumbSliderUI.thumbIndications; locked 75% of time MT_CORRECTNESS IS2_INCONSISTENT_SYNC 1075 Medium
Inconsistent synchronization of com.bric.multislider.MultiThumbSliderUI.thumbPositions; locked 57% of time MT_CORRECTNESS IS2_INCONSISTENT_SYNC 894 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 271-272 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 165 Medium
org.opentrafficsim.swing.graphs.SwingContourPlot.setTimeGranularityRadioButton(double) makes inefficient use of keySet iterator instead of entrySet iterator PERFORMANCE WMI_WRONG_MAP_ITERATOR 179 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.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 57 Medium

org.opentrafficsim.swing.gui.OTSAnimationPanel

Bug Category Details Line Priority
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, OTSNetwork) invokes org.opentrafficsim.swing.gui.OTSAnimationPanel$UpdateTimer.start() MT_CORRECTNESS SC_START_IN_CTOR 232 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 1073 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
Do not catch NullPointerException like in org.opentrafficsim.swing.gui.OTSControlPanel.loadGrayscaleIcon(String) STYLE DCN_NULLPOINTER_EXCEPTION 286 Medium
Do not catch NullPointerException like in org.opentrafficsim.swing.gui.OTSControlPanel.loadIcon(String) STYLE DCN_NULLPOINTER_EXCEPTION 268 Medium
org.opentrafficsim.swing.gui.OTSControlPanel.getOtsSearchPanel() may expose internal representation by returning OTSControlPanel.otsSearchPanel MALICIOUS_CODE EI_EXPOSE_REP 204 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 341 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 340 Medium
Should org.opentrafficsim.swing.gui.OTSControlPanel$DisposeOnCloseThread be a _static_ inner class? PERFORMANCE SIC_INNER_SHOULD_BE_STATIC 340-377 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 59 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 75 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 36 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.gui.OTSSwingApplication

Bug Category Details Line Priority
Found reliance on default encoding in new org.opentrafficsim.swing.gui.OTSSwingApplication(OTSModelInterface, JPanel): new java.io.FileReader(String) I18N DM_DEFAULT_ENCODING 133 High
new org.opentrafficsim.swing.gui.OTSSwingApplication(OTSModelInterface, JPanel) may fail to clean up java.io.Reader EXPERIMENTAL OBL_UNSATISFIED_OBLIGATION 133 Medium
new org.opentrafficsim.swing.gui.OTSSwingApplication(OTSModelInterface, JPanel) may fail to close stream BAD_PRACTICE OS_OPEN_STREAM 133 Medium

org.opentrafficsim.swing.gui.OTSSwingApplication$2

Bug Category Details Line Priority
Found reliance on default encoding in org.opentrafficsim.swing.gui.OTSSwingApplication$2.windowClosing(WindowEvent): new java.io.FileWriter(File) I18N DM_DEFAULT_ENCODING 117 High
org.opentrafficsim.swing.gui.OTSSwingApplication$2.windowClosing(WindowEvent) may fail to clean up java.io.Writer EXPERIMENTAL OBL_UNSATISFIED_OBLIGATION 117 Medium
org.opentrafficsim.swing.gui.OTSSwingApplication$2.windowClosing(WindowEvent) may fail to close stream BAD_PRACTICE OS_OPEN_STREAM 117 Medium
Exceptional return value of java.io.File.mkdirs() ignored in org.opentrafficsim.swing.gui.OTSSwingApplication$2.windowClosing(WindowEvent) BAD_PRACTICE RV_RETURN_VALUE_IGNORED_BAD_PRACTICE 116 Medium

org.opentrafficsim.swing.script.AbstractSimulationScript

Bug Category Details Line Priority
org.opentrafficsim.swing.script.AbstractSimulationScript.start() invokes System.exit(...), which shuts down the entire virtual machine BAD_PRACTICE DM_EXIT 222 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getNetwork() may expose internal representation by returning AbstractSimulationScript.network MALICIOUS_CODE EI_EXPOSE_REP 296 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getSimulationTime() may expose internal representation by returning AbstractSimulationScript.simulationTime MALICIOUS_CODE EI_EXPOSE_REP 154 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getStartTime() may expose internal representation by returning AbstractSimulationScript.startTime MALICIOUS_CODE EI_EXPOSE_REP 136 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getWarmupTime() may expose internal representation by returning AbstractSimulationScript.warmupTime MALICIOUS_CODE EI_EXPOSE_REP 145 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 57 Medium
org.opentrafficsim.swing.script.IdmOptions.getATruck() may expose internal representation by returning IdmOptions.aTruck MALICIOUS_CODE EI_EXPOSE_REP 66 Medium
org.opentrafficsim.swing.script.IdmOptions.getB() may expose internal representation by returning IdmOptions.b MALICIOUS_CODE EI_EXPOSE_REP 75 Medium
org.opentrafficsim.swing.script.IdmOptions.getTMax() may expose internal representation by returning IdmOptions.tMax MALICIOUS_CODE EI_EXPOSE_REP 93 Medium
org.opentrafficsim.swing.script.IdmOptions.getTMin() may expose internal representation by returning IdmOptions.tMin MALICIOUS_CODE EI_EXPOSE_REP 84 Medium