Skip to content
Permalink
Browse files

Remove unnecessary @SuppressWarnings

  • Loading branch information...
bobjacobsen committed Sep 20, 2018
1 parent 1adfc4b commit c7960fc547ee2bedd64b3cba27bd283ac295762b
Showing with 8 additions and 95 deletions.
  1. +0 −1 java/src/jmri/configurexml/TransitManagerXml.java
  2. +0 −1 java/src/jmri/implementation/SensorGroupConditional.java
  3. +0 −1 java/src/jmri/jmrit/display/configurexml/SlipTurnoutIconXml.java
  4. +0 −1 java/src/jmri/jmrit/display/configurexml/TurnoutIconXml.java
  5. +0 −1 java/src/jmri/jmrit/mailreport/ReportContext.java
  6. +0 −1 java/src/jmri/jmrit/operations/automation/Automation.java
  7. +0 −1 java/src/jmri/jmrit/operations/automation/AutomationManager.java
  8. +0 −1 java/src/jmri/jmrit/operations/locations/LocationManager.java
  9. +0 −1 java/src/jmri/jmrit/operations/locations/schedules/Schedule.java
  10. +0 −1 java/src/jmri/jmrit/operations/rollingstock/RollingStockAttribute.java
  11. +0 −2 java/src/jmri/jmrit/operations/rollingstock/cars/CarLoads.java
  12. +0 −2 java/src/jmri/jmrit/operations/rollingstock/cars/CarManager.java
  13. +0 −2 java/src/jmri/jmrit/operations/rollingstock/engines/EngineManager.java
  14. +0 −1 java/src/jmri/jmrit/operations/routes/Route.java
  15. +0 −1 java/src/jmri/jmrit/operations/routes/RouteManager.java
  16. +0 −1 java/src/jmri/jmrit/operations/trains/TrainBuilder.java
  17. +0 −3 java/src/jmri/jmrit/operations/trains/TrainManager.java
  18. +0 −1 java/src/jmri/jmrit/operations/trains/timetable/TrainScheduleManager.java
  19. +0 −1 java/src/jmri/jmrit/roster/PrintRosterEntry.java
  20. +0 −1 java/src/jmri/jmrit/roster/RosterSpeedProfile.java
  21. +0 −3 java/src/jmri/jmrit/roster/swing/speedprofile/SpeedProfilePanel.java
  22. +0 −1 java/src/jmri/jmrit/symbolicprog/QualifierAdder.java
  23. +0 −1 java/src/jmri/jmrit/throttle/AddressPanel.java
  24. +0 −1 java/src/jmri/jmrit/throttle/FunctionPanel.java
  25. +0 −1 java/src/jmri/jmrit/throttle/LoadXmlThrottlesLayoutAction.java
  26. +0 −1 java/src/jmri/jmrit/throttle/ThrottleFrame.java
  27. +0 −1 java/src/jmri/jmrit/throttle/ThrottleWindow.java
  28. +0 −1 java/src/jmri/jmrit/vsdecoder/SoundEvent.java
  29. +0 −1 java/src/jmri/jmrix/AbstractMRTrafficController.java
  30. +0 −1 java/src/jmri/jmrix/AbstractStreamConnectionConfig.java
  31. +0 −1 java/src/jmri/jmrix/AbstractUsbConnectionConfig.java
  32. +0 −1 java/src/jmri/jmrix/bachrus/SpeedoConsoleFrame.java
  33. +0 −1 java/src/jmri/jmrix/bachrus/SpeedoReply.java
  34. +0 −2 java/src/jmri/jmrix/can/CanMessage.java
  35. +0 −2 java/src/jmri/jmrix/can/CanReply.java
  36. +0 −1 java/src/jmri/jmrix/can/ConfigurationManager.java
  37. +0 −1 java/src/jmri/jmrix/dcc4pc/Dcc4PcMessage.java
  38. +0 −1 java/src/jmri/jmrix/dcc4pc/Dcc4PcReply.java
  39. +0 −1 java/src/jmri/jmrix/dccpp/dccppovertcp/ClientRxHandler.java
  40. +1 −1 java/src/jmri/jmrix/dccpp/dccppovertcp/DCCppOverTcpPacketizer.java
  41. +1 −1 java/src/jmri/jmrix/dccpp/serial/SerialDCCppPacketizer.java
  42. +0 −1 java/src/jmri/jmrix/dccpp/simulator/DCCppSimulatorAdapter.java
  43. +0 −3 java/src/jmri/jmrix/dccpp/swing/ConfigBaseStationFrame.java
  44. +0 −1 java/src/jmri/jmrix/direct/simulator/SimulatorAdapter.java
  45. +0 −1 java/src/jmri/jmrix/easydcc/simulator/SimulatorAdapter.java
  46. +0 −2 java/src/jmri/jmrix/ecos/EcosPreferences.java
  47. +0 −1 java/src/jmri/jmrix/grapevine/simulator/SimulatorAdapter.java
  48. +4 −4 java/src/jmri/jmrix/lenz/swing/stackmon/StackMonFrame.java
  49. +0 −1 java/src/jmri/jmrix/lenz/xnetsimulator/XNetSimulatorAdapter.java
  50. +1 −2 java/src/jmri/jmrix/loconet/duplexgroup/swing/LnDplxGrpInfoImpl.java
  51. +0 −1 java/src/jmri/jmrix/loconet/loconetovertcp/ClientRxHandler.java
  52. +1 −1 java/src/jmri/jmrix/loconet/loconetovertcp/LnOverTcpPacketizer.java
  53. +0 −1 java/src/jmri/jmrix/maple/simulator/SimulatorAdapter.java
  54. +0 −1 java/src/jmri/jmrix/nce/NceClockControl.java
  55. +0 −1 java/src/jmri/jmrix/oaktree/simulator/SimulatorAdapter.java
  56. +0 −1 java/src/jmri/jmrix/roco/z21/simulator/Z21SimulatorAdapter.java
  57. +0 −1 java/src/jmri/jmrix/roco/z21/simulator/Z21XNetSimulatorAdapter.java
  58. +0 −1 java/src/jmri/jmrix/secsi/simulator/SimulatorAdapter.java
  59. +0 −1 java/src/jmri/jmrix/sprog/SprogMessage.java
  60. +0 −1 java/src/jmri/jmrix/sprog/SprogReply.java
  61. +0 −1 java/src/jmri/jmrix/sprog/SprogSlot.java
  62. +0 −1 java/src/jmri/jmrix/sprog/simulator/SimulatorAdapter.java
  63. +0 −1 java/src/jmri/jmrix/srcp/SRCPSystemConnectionMemo.java
  64. +0 −1 java/src/jmri/jmrix/tams/swing/locodatabase/LocoDataModel.java
  65. +0 −1 java/src/jmri/jmrix/tmcc/simulator/SimulatorAdapter.java
  66. +0 −1 java/src/jmri/jmrix/xpa/XpaMessage.java
  67. +0 −2 java/src/jmri/jmrix/xpa/XpaTrafficController.java
  68. +0 −2 java/src/jmri/managers/DefaultIdTagManager.java
  69. +0 −1 java/src/jmri/managers/configurexml/AbstractAudioManagerConfigXML.java
  70. +0 −1 java/src/jmri/managers/configurexml/AbstractLightManagerConfigXML.java
  71. +0 −1 java/src/jmri/managers/configurexml/AbstractMemoryManagerConfigXML.java
  72. +0 −1 java/src/jmri/managers/configurexml/AbstractReporterManagerConfigXML.java
  73. +0 −1 java/src/jmri/managers/configurexml/AbstractSensorManagerConfigXML.java
  74. +0 −1 java/src/jmri/managers/configurexml/AbstractTurnoutManagerConfigXML.java
  75. +0 −1 java/src/jmri/profile/AddProfileDialog.java
  76. +0 −2 java/src/jmri/util/com/dictiography/collections/IndexedTreeMap.java
@@ -150,7 +150,6 @@ public boolean load(Element sharedTransits, Element perNodeTransits) {
* @param perNodeTransits Per-node Element containing the Transit elements
* to load.
*/
@SuppressWarnings("null")
public void loadTransits(Element sharedTransits, Element perNodeTransits) {
List<Element> transitList = sharedTransits.getChildren("transit");
if (log.isDebugEnabled()) {
@@ -31,7 +31,6 @@ public SensorGroupConditional(String systemName, String userName) {
super(systemName, userName);
}

@SuppressWarnings("null")
@Override
public int calculate(boolean enabled, PropertyChangeEvent evt) {
int currentState = super.calculate(false, evt);
@@ -96,7 +96,6 @@ Element storeIcon(String elemName, NamedIcon icon, String text) {
* @param element Top level Element to unpack.
* @param o Editor as an Object
*/
@SuppressWarnings("null")
@Override
public void load(Element element, Object o) {
// create the objects
@@ -72,7 +72,6 @@ public Element store(Object o) {
* @param element Top level Element to unpack.
* @param o Editor as an Object
*/
@SuppressWarnings("null")
@Override
public void load(Element element, Object o) {
// create the objects
@@ -289,7 +289,6 @@ private void addNetworkInfo() {
* Add communication port information
*/
private void addCommunicationPortInfo() {
@SuppressWarnings("unchecked")
Enumeration<CommPortIdentifier> portIDs = CommPortIdentifier.getPortIdentifiers();

ArrayList<CommPortIdentifier> ports = new ArrayList<>();
@@ -538,7 +538,6 @@ public Automation(Element e) {
_comment = a.getValue();
}
if (e.getChildren(Xml.ITEM) != null) {
@SuppressWarnings("unchecked")
List<Element> eAutomationItems = e.getChildren(Xml.ITEM);
log.debug("automation: {} has {} items", getName(), eAutomationItems.size());
for (Element eAutomationItem : eAutomationItems) {
@@ -230,7 +230,6 @@ public Automation copyAutomation(Automation automation, String newName) {
*/
public void load(Element root) {
if (root.getChild(Xml.AUTOMATIONS) != null) {
@SuppressWarnings("unchecked")
List<Element> eAutomations = root.getChild(Xml.AUTOMATIONS).getChildren(Xml.AUTOMATION);
log.debug("readFile sees {} automations", eAutomations.size());
for (Element eAutomation : eAutomations) {
@@ -416,7 +416,6 @@ private void calculateMaxNameLengths() {

public void load(Element root) {
if (root.getChild(Xml.LOCATIONS) != null) {
@SuppressWarnings("unchecked")
List<Element> locs = root.getChild(Xml.LOCATIONS).getChildren(Xml.LOCATION);
log.debug("readFile sees {} locations", locs.size());
for (Element loc : locs) {
@@ -322,7 +322,6 @@ public Schedule(Element e) {
_comment = a.getValue();
}
if (e.getChildren(Xml.ITEM) != null) {
@SuppressWarnings("unchecked")
List<Element> eScheduleItems = e.getChildren(Xml.ITEM);
log.debug("schedule: {} has {} items", getName(), eScheduleItems.size());
for (Element eScheduleItem : eScheduleItems) {
@@ -175,7 +175,6 @@ public void store(Element root, String eNames, String eName, String oldName) {
public void load(Element root, String eNames, String eName, String oldName) {
// new format using elements starting version 3.3.1
if (root.getChild(eNames) != null) {
@SuppressWarnings("unchecked")
List<Element> l = root.getChild(eNames).getChildren(eName);
Attribute a;
String[] names = new String[l.size()];
@@ -542,7 +542,6 @@ public void load(Element e) {
_emptyName = a.getValue();
}
}
@SuppressWarnings("unchecked")
List<Element> eLoads = e.getChild(Xml.LOADS).getChildren(Xml.LOAD);
log.debug("readFile sees {} car loads", eLoads.size());
for (Element eLoad : eLoads) {
@@ -561,7 +560,6 @@ public void load(Element e) {
}
}
// new style load and comments
@SuppressWarnings("unchecked")
List<Element> eCarLoads = eLoad.getChildren(Xml.CAR_LOAD);
log.debug("{} car loads for type: {}", eCarLoads.size(), type);
for (Element eCarLoad : eCarLoads) {
@@ -568,7 +568,6 @@ public void replaceLoad(String type, String oldLoadName, String newLoadName) {
public void load(Element root) {
// new format using elements starting version 3.3.1
if (root.getChild(Xml.NEW_KERNELS) != null) {
@SuppressWarnings("unchecked")
List<Element> eKernels = root.getChild(Xml.NEW_KERNELS).getChildren(Xml.KERNEL);
log.debug("Car manager sees {} kernels", eKernels.size());
Attribute a;
@@ -590,7 +589,6 @@ else if (root.getChild(Xml.KERNELS) != null) {
}

if (root.getChild(Xml.CARS) != null) {
@SuppressWarnings("unchecked")
List<Element> eCars = root.getChild(Xml.CARS).getChildren(Xml.CAR);
log.debug("readFile sees {} cars", eCars.size());
for (Element eCar : eCars) {
@@ -274,7 +274,6 @@ public void dispose() {
public void load(Element root) {
// new format using elements starting version 3.3.1
if (root.getChild(Xml.NEW_CONSISTS) != null) {
@SuppressWarnings("unchecked")
List<Element> consists = root.getChild(Xml.NEW_CONSISTS).getChildren(Xml.CONSIST);
log.debug("Engine manager sees {} consists", consists.size());
Attribute a;
@@ -296,7 +295,6 @@ else if (root.getChild(Xml.CONSISTS) != null) {
}

if (root.getChild(Xml.ENGINES) != null) {
@SuppressWarnings("unchecked")
List<Element> engines = root.getChild(Xml.ENGINES).getChildren(Xml.ENGINE);
log.debug("readFile sees {} engines", engines.size());
for (Element e : engines) {
@@ -467,7 +467,6 @@ public Route(Element e) {
_comment = a.getValue();
}
if (e.getChildren(Xml.LOCATION) != null) {
@SuppressWarnings("unchecked")
List<Element> eRouteLocations = e.getChildren(Xml.LOCATION);
log.debug("route: ({}) has {} locations", getName(), eRouteLocations.size());
for (Element eRouteLocation : eRouteLocations) {
@@ -284,7 +284,6 @@ public int numEntries() {
public void load(Element root) {
// decode type, invoke proper processing routine if a decoder file
if (root.getChild(Xml.ROUTES) != null) {
@SuppressWarnings("unchecked")
List<Element> eRoutes = root.getChild(Xml.ROUTES).getChildren(Xml.ROUTE);
log.debug("readFile sees {} routes", eRoutes.size());
for (Element eRoute : eRoutes) {
@@ -2771,7 +2771,6 @@ private boolean checkTrainLength(Car car, RouteLocation rl, RouteLocation rld) {
private final boolean ignoreTrainDirectionIfLastLoc = false;

// FIXME: ignoreTrainDirectionIfLastLoc has no way to become true, hence the if statement using it below cannot ever be true
@SuppressWarnings("unused")
private boolean checkDropTrainDirection(RollingStock rs, RouteLocation rld, Track track) {
// local?
if (_train.isLocalSwitcher()) {
@@ -1026,14 +1026,12 @@ public void load(Element root) {
}
// check for scripts
if (options.getChild(Xml.SCRIPTS) != null) {
@SuppressWarnings("unchecked")
List<Element> lm = options.getChild(Xml.SCRIPTS).getChildren(Xml.START_UP);
for (Element es : lm) {
if ((a = es.getAttribute(Xml.NAME)) != null) {
addStartUpScript(a.getValue());
}
}
@SuppressWarnings("unchecked")
List<Element> lt = options.getChild(Xml.SCRIPTS).getChildren(Xml.SHUT_DOWN);
for (Element es : lt) {
if ((a = es.getAttribute(Xml.NAME)) != null) {
@@ -1043,7 +1041,6 @@ public void load(Element root) {
}
}
if (root.getChild(Xml.TRAINS) != null) {
@SuppressWarnings("unchecked")
List<Element> eTrains = root.getChild(Xml.TRAINS).getChildren(Xml.TRAIN);
log.debug("readFile sees {} trains", eTrains.size());
for (Element eTrain : eTrains) {
@@ -276,7 +276,6 @@ public void store(Element root) {
public void load(Element root) {
Element e = root.getChild(Xml.SCHEDULES);
if (e != null) {
@SuppressWarnings("unchecked")
List<Element> eSchedules = root.getChild(Xml.SCHEDULES).getChildren(Xml.SCHEDULE);
log.debug("TrainScheduleManager sees {} train schedules", eSchedules.size());
for (Element eSchedule : eSchedules) {
@@ -127,7 +127,6 @@ public PrintRosterEntry(RosterEntry rosterEntry, JmriJFrame parent, String filen
d.loadVariableModel(decoderRoot.getChild("decoder"), variableModel);
d.loadResetModel(decoderRoot.getChild("decoder"), resetModel);

@SuppressWarnings("unchecked")
List<Element> rawPaneList = base.getChildren("pane");
log.debug("rawPaneList size = {}", rawPaneList.size());
for (Element elPane : rawPaneList) {
@@ -839,7 +839,6 @@ public void store(Element e) {
e.addContent(d);
}

@SuppressWarnings({"unchecked"})
public void load(Element e) {
try {
setOverRunTimeForward(Float.parseFloat(e.getChild("overRunTimeForward").getText()));
@@ -1079,7 +1079,6 @@ private void doLoad() {

// First read configuration
if (root.getChild("configuration") != null) {
@SuppressWarnings("unchecked")
List<Element> l = root.getChild("configuration").getChildren();
if (log.isDebugEnabled()) {
log.debug("readFile sees {} configurations", l.size());
@@ -1100,7 +1099,6 @@ private void doLoad() {
}
// Now read sensor information
if (root.getChild("sensors") != null) {
@SuppressWarnings("unchecked")
List<Element> l = root.getChild("sensors").getChildren("sensor");
if (log.isDebugEnabled()) {
log.debug("readFile sees {} sensors", l.size());
@@ -1125,7 +1123,6 @@ private void doLoad() {
}
}
if (root.getChild("steps") != null) {
@SuppressWarnings("unchecked")
List<Element> l = root.getChild("steps").getChildren();
for (int i = 0; i < l.size(); i++) {
Element e = l.get(i);
@@ -49,7 +49,6 @@ public void processModifierElements(Element e, VariableTableModel model) {
if (el.getName().equals("pane")) {
break; // stop when we get to an enclosing pane element
}
@SuppressWarnings("unchecked")
List<Element> le2 = el.getChildren("qualifier"); // we assign to this to allow us to suppress unchecked error
processList(le2, lq, model);
}
@@ -596,7 +596,6 @@ public Element getXml() {
*
* @param e The Element containing prefs as defined in DTD/throttle-config
*/
@SuppressWarnings("unchecked")
public void setXml(Element e) {
Element window = e.getChild("window");
WindowPreferences.setPreferences(this, window);
@@ -621,7 +621,6 @@ public Element getXml() {
*
* @param e The Element for this object.
*/
@SuppressWarnings("unchecked")
public void setXml(Element e) {
Element window = e.getChild("window");
WindowPreferences.setPreferences(this, window);
@@ -87,7 +87,6 @@ public void actionPerformed(ActionEvent e) {
*
* @param f The XML file containing throttles.
*/
@SuppressWarnings("unchecked")
public boolean loadThrottlesLayout(java.io.File f) throws java.io.IOException {
try {
ThrottlePrefs prefs = new ThrottlePrefs();
@@ -754,7 +754,6 @@ public Element getXmlFile() {
*
* @param e The Element for this object.
*/
@SuppressWarnings("unchecked")
public void setXml(Element e) {
if (e == null) {
return;
@@ -746,7 +746,6 @@ public Element getXml() {
return me;
}

@SuppressWarnings("unchecked")
public void setXml(Element e) {
if (e.getAttribute("title") != null) {
setTitle(e.getAttribute("title").getValue());
@@ -209,7 +209,6 @@ public void setXml(Element el) {
this.setXml(el, null);
}

@SuppressWarnings("cast")
protected void addXmlTrigger(Element te, VSDFile vf) {
String tts;
Trigger.TriggerType tt;
@@ -920,7 +920,6 @@ protected void reportReceiveLoopException(Exception e) {
* Dummy routine, to be filled by protocols that have to skip some
* start-of-message characters.
*/
@SuppressWarnings("unused")
protected void waitForStartOfReply(DataInputStream istream) throws IOException {
}

@@ -49,7 +49,6 @@ public AbstractStreamConnectionConfig() {

protected boolean init = false;

@SuppressWarnings("unchecked")
@Override
protected void checkInitDone() {
log.debug("init called for {}", name());
@@ -57,7 +57,6 @@ public UsbPortAdapter getAdapter() {

protected boolean init = false;

@SuppressWarnings("unchecked")
@Override
protected void checkInitDone() {
if (log.isDebugEnabled()) {
@@ -269,7 +269,6 @@ public void dispose() {
}

// FIXME: Why does the if statement in this method include a direct false?
@SuppressWarnings("unused")
@Override
public void initComponents() {
prefs = jmri.InstanceManager.getDefault(jmri.UserPreferencesManager.class);
@@ -18,7 +18,6 @@ public SpeedoReply() {
}

// copy one
@SuppressWarnings("null")
public SpeedoReply(SpeedoReply m) {
this();
if (m == null) {
@@ -73,7 +73,6 @@ public CanMessage(byte[] d, int header) {
}

// copy one
@SuppressWarnings("null")
public CanMessage(@Nonnull CanMessage m) {
_header = m._header;
_isExtended = m._isExtended;
@@ -87,7 +86,6 @@ public CanMessage(@Nonnull CanMessage m) {
}

// copy type
@SuppressWarnings("null")
public CanMessage(@Nonnull CanReply m) {
_header = m._header;
_isExtended = m._isExtended;
@@ -47,7 +47,6 @@ public CanReply(int[] d) {
}

// copy one
@SuppressWarnings("null")
public CanReply(@Nonnull CanReply m) {
_header = m._header;
_isExtended = m._isExtended;
@@ -61,7 +60,6 @@ public CanReply(@Nonnull CanReply m) {
}

// copy type
@SuppressWarnings("null")
public CanReply(@Nonnull CanMessage m) {
_header = m._header;
_isExtended = m._isExtended;
@@ -58,7 +58,6 @@ public ConfigurationManager(CanSystemConnectionMemo memo) {
*/
abstract public boolean provides(Class<?> type);

@SuppressWarnings("unchecked")
abstract public <T> T get(Class<?> T);

abstract public void dispose();
@@ -58,7 +58,6 @@ public Dcc4PcMessage(String s) {
}

// copy one
@SuppressWarnings("null")
public Dcc4PcMessage(Dcc4PcMessage m) {
if (m == null) {
log.error("copy ctor of null message");
@@ -45,7 +45,6 @@ protected int skipPrefix(int index) {
*
* @param m the Dcc4PcReply to copy
*/
@SuppressWarnings("null")
public Dcc4PcReply(Dcc4PcReply m) {
this();
if (m == null) {
@@ -49,7 +49,6 @@ public ClientRxHandler(String newRemoteAddress, Socket newSocket) {
start();
}

@SuppressWarnings("null")
@Override
public void run() {

@@ -206,7 +206,7 @@ public RcvHandler(DCCppOverTcpPacketizer lt) {

// readline is deprecated, but there are no problems
// with multi-byte characters here.
@SuppressWarnings({"deprecation", "null"})
@SuppressWarnings("deprecation")
@Override
public void run() {

0 comments on commit c7960fc

Please sign in to comment.
You can’t perform that action at this time.