Skip to content

Commit

Permalink
javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
silverailscolo authored and bobjacobsen committed Jun 20, 2019
1 parent 6ae9647 commit 4fea42c
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 20 deletions.
10 changes: 6 additions & 4 deletions java/src/jmri/jmrix/AbstractNetworkPortController.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public boolean getMdnsConfigure() {

/*
* Set the server's host name and port
* using mdns autoconfiguration.
* using MDNS autoconfiguration.
* Default implementation does nothing.
*/
@Override
Expand Down Expand Up @@ -295,7 +295,7 @@ public void recover() {
}

/**
* Attempts to reconnect to a failed Server
* Attempts to reconnect to a failed Server.
*/
public void reconnect() {

Expand Down Expand Up @@ -383,7 +383,8 @@ public void run() {
* Set the connection timeout to the specified value.
* If the socket is not null, set the SO_TIMEOUT option on the
* socket as well.
* @param t timeout value in milliseconds.
*
* @param t timeout value in milliseconds
*/
protected void setConnectionTimeout(int t) {
connTimeout = t;
Expand All @@ -398,7 +399,8 @@ protected void setConnectionTimeout(int t) {

/*
* Get the connection timeout value.
* @return timeout value in milliseconds.
*
* @return timeout value in milliseconds
*/
protected int getConnectionTimeout() {
return connTimeout;
Expand Down
7 changes: 4 additions & 3 deletions java/src/jmri/jmrix/AbstractSerialPortController.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ public void configureBaudRate(String rate) {
public void configureBaudNumber(String indexString) {
int baudNum;
int index = 0;
String[] rates = validBaudRates();
int[] numbers = validBaudNumbers();
final String[] rates = validBaudRates();
final int[] numbers = validBaudNumbers();
if ((numbers == null) || (numbers.length == 0)) { // simulators return null TODO for SpotBugs make that into an empty array
mBaudRate = null;
log.debug("no serial port speed values received (OK for simulator)");
Expand Down Expand Up @@ -278,6 +278,7 @@ public int getCurrentBaudIndex() {
*/
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "PZLA_PREFER_ZERO_LENGTH_ARRAYS",
justification = "null signals incorrect implementation of portcontroller")
@Override
public int[] validBaudNumbers() {
log.error("default validBaudNumber implementation should not be used", new Exception());
return null;
Expand All @@ -288,7 +289,7 @@ public int[] validBaudNumbers() {
* <p>
* Uses the validBaudNumbers() and validBaudRates() methods to do this.
*
* @param currentBaudRate a rate from validBaudRates
* @param currentBaudRate a rate from validBaudRates()
* @return -1 if no match (configuration system should prevent this)
*/
public int currentBaudNumber(String currentBaudRate) {
Expand Down
2 changes: 1 addition & 1 deletion java/src/jmri/jmrix/SerialPortAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public interface SerialPortAdapter extends PortAdapter {
public String getCurrentPortName();

/**
* Get an array of valid baud rates; used to display valid options in Connections Preferences.
* Get an array of valid baud rate strings; used to display valid options in Connections Preferences.
*
* @return array of I18N display strings of port speed settings valid for this serial adapter,
* must match order and values from {@link #validBaudNumbers()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import jmri.jmrix.can.CanSystemConnectionMemo;

/**
* Abstract base for classes representing a LAWICELL communications port
* Abstract base for classes representing a LAWICELL communications port.
*
* @author Bob Jacobsen Copyright (C) 2001, 2008
* @author Andrew Crosland 2008
Expand Down Expand Up @@ -35,5 +35,6 @@ protected PortController(SystemConnectionMemo connectionMemo) {
public CanSystemConnectionMemo getSystemConnectionMemo() {
return (CanSystemConnectionMemo) super.getSystemConnectionMemo();
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
* @author Andrew Crosland Copyright (C) 2008
* @author Bob Jacobsen Copyright (C) 2008, 2010
*/
public class CanUsbDriverAdapter
extends jmri.jmrix.can.adapters.lawicell.SerialDriverAdapter
public class CanUsbDriverAdapter extends jmri.jmrix.can.adapters.lawicell.SerialDriverAdapter
implements jmri.jmrix.SerialPortAdapter {

/**
Expand All @@ -23,7 +22,7 @@ public String[] validBaudRates() {
}

/**
* And the corresponding values.
* {@inheritDoc}
*/
@Override
public int[] validBaudValues() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import jmri.jmrix.cmri.serial.SerialTrafficController;

/**
* Implements SerialPortAdapter for a network connection.
* Implements SerialNetworkPortAdapter for a network connection.
* <p>
* This connects via a telnet connection. Normally
* controlled by the NetworkDriverFrame class.
Expand All @@ -20,7 +20,7 @@ public NetworkDriverAdapter() {
}

/**
* set up all of the other objects to operate connected to this port
* Set up all of the other objects to operate connected to this port.
*/
@Override
public void configure() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.slf4j.LoggerFactory;

/**
* Implements SerialPortAdapter for the DCCppOverTcp system network
* Implements DCCppPortController for the DCCppOverTcp system network
* connection.
* <p>
* This connects a DCC++ via a telnet connection. Normally controlled by the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.slf4j.LoggerFactory;

/**
* Implements SerialPortAdapter for the ECOS system network connection.
* Implements NetworkPortAdapter for the ECOS system network connection.
* <p>
* This connects an ECOS command station via a telnet connection. Normally
* controlled by the NetworkDriverFrame class.
Expand Down
2 changes: 0 additions & 2 deletions java/src/jmri/jmrix/loconet/uhlenbrock/UhlenbrockAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ public String[] validBaudRates() {

/**
* {@inheritDoc}
*
* @return list of value baud rates
*/
@Override
public int[] validBaudNumbers() {
Expand Down
3 changes: 2 additions & 1 deletion java/src/jmri/jmrix/sprog/simulator/SimulatorAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ public String getCurrentBaudRate() {
*/
@Override
public int[] validBaudNumbers() {
return null;
int[] numbers = {0};
return numbers;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion java/test/jmri/jmrix/qsi/QsiTrafficControllerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public String[] validBaudRates() {
return null;
}

//@Override
@Override
public int[] validBaudNumbers() {
return null;
}
Expand Down

0 comments on commit 4fea42c

Please sign in to comment.