Skip to content
Permalink
Browse files

refactor to validBaudNumber_s_

  • Loading branch information...
silverailscolo committed Jun 16, 2019
1 parent 19debb3 commit d3d6db896eadf778094df3007fb2585be4a3f51b
Showing with 96 additions and 96 deletions.
  1. +6 −6 java/src/jmri/jmrix/AbstractSerialPortController.java
  2. +1 −1 java/src/jmri/jmrix/SerialPortAdapter.java
  3. +2 −2 java/src/jmri/jmrix/acela/serialdriver/SerialDriverAdapter.java
  4. +1 −1 java/src/jmri/jmrix/bachrus/serialdriver/SerialDriverAdapter.java
  5. +1 −1 java/src/jmri/jmrix/can/adapters/gridconnect/GcSerialDriverAdapter.java
  6. +1 −1 java/src/jmri/jmrix/can/adapters/gridconnect/can2usbino/serialdriver/SerialDriverAdapter.java
  7. +1 −1 java/src/jmri/jmrix/can/adapters/gridconnect/canusb/serialdriver/SerialDriverAdapter.java
  8. +1 −1 java/src/jmri/jmrix/can/adapters/gridconnect/lccbuffer/serialdriver/SerialDriverAdapter.java
  9. +1 −1 java/src/jmri/jmrix/can/adapters/lawicell/SerialDriverAdapter.java
  10. +1 −1 java/src/jmri/jmrix/can/adapters/lawicell/canusb/serialdriver/CanUsbDriverAdapter.java
  11. +1 −1 java/src/jmri/jmrix/can/adapters/loopback/Port.java
  12. +1 −1 java/src/jmri/jmrix/cmri/serial/serialdriver/SerialDriverAdapter.java
  13. +1 −1 java/src/jmri/jmrix/dcc4pc/serialdriver/SerialDriverAdapter.java
  14. +1 −1 java/src/jmri/jmrix/dccpp/serial/DCCppAdapter.java
  15. +1 −1 java/src/jmri/jmrix/dccpp/simulator/DCCppSimulatorAdapter.java
  16. +1 −1 java/src/jmri/jmrix/direct/serial/SerialDriverAdapter.java
  17. +1 −1 java/src/jmri/jmrix/direct/simulator/SimulatorAdapter.java
  18. +1 −1 java/src/jmri/jmrix/easydcc/serialdriver/SerialDriverAdapter.java
  19. +1 −1 java/src/jmri/jmrix/easydcc/simulator/SimulatorAdapter.java
  20. +1 −1 java/src/jmri/jmrix/grapevine/serialdriver/SerialDriverAdapter.java
  21. +1 −1 java/src/jmri/jmrix/grapevine/simulator/SimulatorAdapter.java
  22. +1 −1 java/src/jmri/jmrix/ieee802154/serialdriver/SerialDriverAdapter.java
  23. +1 −1 java/src/jmri/jmrix/ieee802154/xbee/XBeeAdapter.java
  24. +1 −1 java/src/jmri/jmrix/internal/InternalAdapter.java
  25. +1 −1 java/src/jmri/jmrix/lenz/XNetSimulatorPortController.java
  26. +1 −1 java/src/jmri/jmrix/lenz/hornbyelite/EliteAdapter.java
  27. +1 −1 java/src/jmri/jmrix/lenz/li100/LI100Adapter.java
  28. +1 −1 java/src/jmri/jmrix/lenz/li100f/LI100fAdapter.java
  29. +1 −1 java/src/jmri/jmrix/lenz/li101/LI101Adapter.java
  30. +1 −1 java/src/jmri/jmrix/lenz/liusb/LIUSBAdapter.java
  31. +1 −1 java/src/jmri/jmrix/lenz/ztc640/ZTC640Adapter.java
  32. +1 −1 java/src/jmri/jmrix/loconet/Intellibox/IntelliboxAdapter.java
  33. +1 −1 java/src/jmri/jmrix/loconet/bluetooth/LocoNetBluetoothAdapter.java
  34. +1 −1 java/src/jmri/jmrix/loconet/hexfile/LnHexFilePort.java
  35. +1 −1 java/src/jmri/jmrix/loconet/locobuffer/LocoBufferAdapter.java
  36. +1 −1 java/src/jmri/jmrix/loconet/locobufferii/LocoBufferIIAdapter.java
  37. +3 −3 java/src/jmri/jmrix/loconet/locobufferusb/LocoBufferUsbAdapter.java
  38. +1 −1 java/src/jmri/jmrix/loconet/ms100/MS100Adapter.java
  39. +3 −3 java/src/jmri/jmrix/loconet/pr2/PR2Adapter.java
  40. +3 −3 java/src/jmri/jmrix/loconet/pr3/PR3Adapter.java
  41. +3 −3 java/src/jmri/jmrix/loconet/pr4/PR4Adapter.java
  42. +1 −1 java/src/jmri/jmrix/loconet/uhlenbrock/UhlenbrockAdapter.java
  43. +3 −3 java/src/jmri/jmrix/loconet/usb_dcs240/UsbDcs240Adapter.java
  44. +3 −3 java/src/jmri/jmrix/loconet/usb_dcs52/UsbDcs52Adapter.java
  45. +1 −1 java/src/jmri/jmrix/maple/serialdriver/SerialDriverAdapter.java
  46. +1 −1 java/src/jmri/jmrix/maple/simulator/SimulatorAdapter.java
  47. +1 −1 java/src/jmri/jmrix/mrc/serialdriver/SerialDriverAdapter.java
  48. +1 −1 java/src/jmri/jmrix/mrc/simulator/SimulatorAdapter.java
  49. +1 −1 java/src/jmri/jmrix/nce/serialdriver/SerialDriverAdapter.java
  50. +1 −1 java/src/jmri/jmrix/nce/simulator/SimulatorAdapter.java
  51. +1 −1 java/src/jmri/jmrix/nce/usbdriver/UsbDriverAdapter.java
  52. +1 −1 java/src/jmri/jmrix/oaktree/serialdriver/SerialDriverAdapter.java
  53. +1 −1 java/src/jmri/jmrix/oaktree/simulator/SimulatorAdapter.java
  54. +1 −1 java/src/jmri/jmrix/powerline/cm11/SpecificDriverAdapter.java
  55. +1 −1 java/src/jmri/jmrix/powerline/cp290/SpecificDriverAdapter.java
  56. +1 −1 java/src/jmri/jmrix/powerline/insteon2412s/SpecificDriverAdapter.java
  57. +1 −1 java/src/jmri/jmrix/powerline/serialdriver/SerialDriverAdapter.java
  58. +1 −1 java/src/jmri/jmrix/powerline/simulator/SimulatorAdapter.java
  59. +1 −1 java/src/jmri/jmrix/qsi/serialdriver/SerialDriverAdapter.java
  60. +1 −1 java/src/jmri/jmrix/rfid/serialdriver/SerialDriverAdapter.java
  61. +1 −1 java/src/jmri/jmrix/rps/serial/SerialAdapter.java
  62. +1 −1 java/src/jmri/jmrix/secsi/serialdriver/SerialDriverAdapter.java
  63. +1 −1 java/src/jmri/jmrix/secsi/simulator/SimulatorAdapter.java
  64. +1 −1 java/src/jmri/jmrix/serialsensor/SerialSensorAdapter.java
  65. +1 −1 java/src/jmri/jmrix/sprog/pi/pisprognano/PiSprogNanoSerialDriverAdapter.java
  66. +1 −1 java/src/jmri/jmrix/sprog/pi/pisprogone/PiSprogOneSerialDriverAdapter.java
  67. +1 −1 java/src/jmri/jmrix/sprog/pi/pisprogonecs/PiSprogOneCSSerialDriverAdapter.java
  68. +1 −1 java/src/jmri/jmrix/sprog/serialdriver/SerialDriverAdapter.java
  69. +1 −1 java/src/jmri/jmrix/sprog/simulator/SimulatorAdapter.java
  70. +1 −1 java/src/jmri/jmrix/tams/serialdriver/SerialDriverAdapter.java
  71. +1 −1 java/src/jmri/jmrix/tams/simulator/SimulatorAdapter.java
  72. +1 −1 java/src/jmri/jmrix/tmcc/serialdriver/SerialDriverAdapter.java
  73. +1 −1 java/src/jmri/jmrix/tmcc/simulator/SimulatorAdapter.java
  74. +1 −1 java/src/jmri/jmrix/wangrow/serialdriver/SerialDriverAdapter.java
  75. +1 −1 java/src/jmri/jmrix/xpa/serialdriver/SerialDriverAdapter.java
  76. +1 −1 java/src/jmri/jmrix/zimo/mx1/Mx1Adapter.java
  77. +1 −1 java/src/jmri/jmrix/zimo/mxulf/SerialDriverAdapter.java
  78. +1 −1 java/src/jmri/jmrix/ztc/ztc611/ZTC611Adapter.java
@@ -150,7 +150,7 @@ public void configureBaudNumber(String indexString) {
int baudNum;
int index = 0;
String[] rates = validBaudRates();
int[] numbers = validBaudNumber(); // TODO refactor method name to validBaudNumbers() - multiple values
int[] numbers = validBaudNumbers();
if (numbers == null) { // simulators return null
mBaudRate = null;
log.warn("no serial port speed values received, OK for simulator");
@@ -210,8 +210,8 @@ public void configureBaudNumber(String indexString) {
@Override
public void configureBaudIndex(int index) {
int baud = 0; // represents "(none)"
if (validBaudNumber() != null) {
for (int i = 0; i < validBaudNumber().length; i++) {
if (validBaudNumbers() != null) {
for (int i = 0; i < validBaudNumbers().length; i++) {
if (validBaudRates()[i].equals(mBaudRate)) {
mBaudRate = validBaudRates()[i];
break;
@@ -238,7 +238,7 @@ public String getCurrentBaudRate() {
@Override
public String getCurrentBaudNumber() {
if (mBaudRate != null) {
int[] numbers = validBaudNumber(); // TODO refactor to validBaudNumbers() - multiple
int[] numbers = validBaudNumbers();
String[] rates = validBaudRates();
String baudNumString = "";
// find the configured baud rate value
@@ -275,7 +275,7 @@ public int getCurrentBaudIndex() {
*/
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "PZLA_PREFER_ZERO_LENGTH_ARRAYS",
justification = "null signal incorrect implementation of portcontroller")
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
log.error("default validBaudNumber implementation should not be used", new Exception());
return null;
}
@@ -290,7 +290,7 @@ public int getCurrentBaudIndex() {
*/
public int currentBaudNumber(String currentBaudRate) {
String[] rates = validBaudRates();
int[] numbers = validBaudNumber();
int[] numbers = validBaudNumbers();

// return if arrays invalid
if (numbers == null) {
@@ -56,7 +56,7 @@
/**
* Get an array of valid baud rates; used to display valid options.
*/
public int[] validBaudNumber();
public int[] validBaudNumbers();

/**
* Set the baud rate. Only to be used after construction, but before the
@@ -152,8 +152,8 @@ public boolean status() {
* Return array of valid baud rates as integers.
*/
@Override
public int[] validBaudNumber() {
// Really just want 9600 Baud for Acela
public int[] validBaudNumbers() {
// Only 9600 Baud for Acela
return new int[]{9600};
}

@@ -177,7 +177,7 @@ public boolean status() {
* Return array of valid baud rates as integers.
*/
@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return new int[]{9600};
}

@@ -339,7 +339,7 @@ public boolean status() {
* TODO refactor validBaudValues() to validBaudNumber(s)
*/
@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return validBaudValues();
}

@@ -50,7 +50,7 @@ public SerialDriverAdapter() {
* TODO refactor validBaudValues() to validBaudNumber(s)
*/
@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return validBaudValues();
}

@@ -34,7 +34,7 @@
* TODO refactor validBaudValues() to validBaudNumber(s)
*/
@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return validBaudValues();
}

@@ -34,7 +34,7 @@
* TODO refactor validBaudValues() to validBaudNumber(s)
*/
@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return validBaudValues();
}

@@ -170,7 +170,7 @@ public boolean status() {
* TODO refactor validBaudValues() to validBaudNumber(s)
*/
@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return validBaudValues();
}

@@ -35,7 +35,7 @@
* TODO refactor validBaudValues() to validBaudNumber(s)
*/
@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return validBaudValues();
}

@@ -60,7 +60,7 @@ public DataOutputStream getOutputStream() {
} // is hidden from user in connection config UI

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return new int[]{};
}

@@ -178,7 +178,7 @@ protected void setSerialPort() throws UnsupportedCommOperationException {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -175,7 +175,7 @@ public DataOutputStream getOutputStream() {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return new int[]{115200};
}

@@ -194,7 +194,7 @@ protected void setSerialPort() throws UnsupportedCommOperationException {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -177,7 +177,7 @@ public boolean status() {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return null;
}

@@ -178,7 +178,7 @@ public boolean status() {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return new int[]{19200};
}

@@ -180,7 +180,7 @@ public boolean status() {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return null;
}

@@ -158,7 +158,7 @@ public boolean status() {
* Return array of valid baud rates as integers.
*/
@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return new int[]{9600};
}

@@ -172,7 +172,7 @@ public boolean status() {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return null;
}

@@ -193,7 +193,7 @@ protected void setSerialPort() throws UnsupportedCommOperationException {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -196,7 +196,7 @@ public boolean status() {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return null;
}

@@ -171,7 +171,7 @@ protected void setSerialPort() throws UnsupportedCommOperationException {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -207,7 +207,7 @@ public void configure() {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -54,7 +54,7 @@ public boolean status() {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return null;
}

@@ -97,7 +97,7 @@ public XNetSystemConnectionMemo getSystemConnectionMemo() {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return null;
}

@@ -184,7 +184,7 @@ protected void setSerialPort() throws UnsupportedCommOperationException {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -191,7 +191,7 @@ protected void setSerialPort() throws UnsupportedCommOperationException {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -180,7 +180,7 @@ protected void setSerialPort() throws UnsupportedCommOperationException {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -179,7 +179,7 @@ protected void setSerialPort() throws UnsupportedCommOperationException {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -176,7 +176,7 @@ protected void setSerialPort() throws UnsupportedCommOperationException {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -180,7 +180,7 @@ protected void setSerialPort() throws UnsupportedCommOperationException {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -60,7 +60,7 @@ public void configure() {
* Get an array of valid baud rates as integers.
*/
@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -239,7 +239,7 @@ public boolean status() {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return null;
}

@@ -246,7 +246,7 @@ public void configure() {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return null;
}

@@ -256,7 +256,7 @@ protected void setSerialPort(SerialPort activeSerialPort) throws UnsupportedComm
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return Arrays.copyOf(validSpeedValues, validSpeedValues.length);
}

@@ -24,7 +24,7 @@ public LocoBufferIIAdapter() {
/**
* Get an array of valid baud rates. This is modified to have different
* comments. Because the speeds are the same as the parent class (19200 and
* 57600), we don't override validBaudNumber().
* 57600), we don't override validBaudNumbers().
*/
@Override
public String[] validBaudRates() {
@@ -26,9 +26,9 @@ public LocoBufferUsbAdapter() {
protected void setSerialPort(SerialPort activeSerialPort) throws UnsupportedCommOperationException {
// find the baud rate value, configure comm options
int baud = 19200; // default, but also defaulted in the initial value of selectedSpeed
for (int i = 0; i < validBaudNumber().length; i++) {
for (int i = 0; i < validBaudNumbers().length; i++) {
if (validBaudRates()[i].equals(mBaudRate)) {
baud = validBaudNumber()[i];
baud = validBaudNumbers()[i];
}
}
activeSerialPort.setSerialPortParams(baud, SerialPort.DATABITS_8,
@@ -58,7 +58,7 @@ protected void setSerialPort(SerialPort activeSerialPort) throws UnsupportedComm
* change the arrays of speeds.
*/
@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return new int[]{57600};
}

@@ -181,7 +181,7 @@ public boolean status() {
}

@Override
public int[] validBaudNumber() {
public int[] validBaudNumbers() {
return new int[]{16600};
}

0 comments on commit d3d6db8

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