From 09585402e3de0485a64dd36fbc0278fd6f7b44f7 Mon Sep 17 00:00:00 2001 From: Will Hedgecock Date: Mon, 13 Jun 2022 11:36:22 -0500 Subject: [PATCH] Remove unused exception constructors --- .../com/fazecast/jSerialComm/SerialPort.java | 2 +- .../jSerialComm/SerialPortIOException.java | 33 ------------------- .../SerialPortInvalidPortException.java | 30 ----------------- .../SerialPortTimeoutException.java | 9 ----- 4 files changed, 1 insertion(+), 73 deletions(-) diff --git a/src/main/java/com/fazecast/jSerialComm/SerialPort.java b/src/main/java/com/fazecast/jSerialComm/SerialPort.java index 95b87f7f..73a7917f 100644 --- a/src/main/java/com/fazecast/jSerialComm/SerialPort.java +++ b/src/main/java/com/fazecast/jSerialComm/SerialPort.java @@ -1328,7 +1328,7 @@ public final synchronized boolean setParity(int newParity) * @param delayAfterSendMicroseconds The time to wait after sending the last data bit before disabling transmit mode (effective only on Linux). * @return Whether the port configuration is valid or disallowed on this system (only meaningful after the port is already opened). */ - public final synchronized boolean setRs485ModeParameters(boolean useRS485Mode, boolean rs485RtsActiveHigh, int delayBeforeSendMicroseconds, int delayAfterSendMicroseconds) + public final boolean setRs485ModeParameters(boolean useRS485Mode, boolean rs485RtsActiveHigh, int delayBeforeSendMicroseconds, int delayAfterSendMicroseconds) { return setRs485ModeParameters(useRS485Mode, rs485RtsActiveHigh, false, false, delayBeforeSendMicroseconds, delayAfterSendMicroseconds); } diff --git a/src/main/java/com/fazecast/jSerialComm/SerialPortIOException.java b/src/main/java/com/fazecast/jSerialComm/SerialPortIOException.java index cc6d6343..d5f71fb5 100644 --- a/src/main/java/com/fazecast/jSerialComm/SerialPortIOException.java +++ b/src/main/java/com/fazecast/jSerialComm/SerialPortIOException.java @@ -36,14 +36,6 @@ public final class SerialPortIOException extends IOException { private static final long serialVersionUID = 3353684802475494674L; - /** - * Constructs a {@link SerialPortIOException} with {@code null} as its error detail message. - */ - public SerialPortIOException() - { - super(); - } - /** * Constructs a {@link SerialPortIOException} with the specified detail message. * @@ -53,29 +45,4 @@ public SerialPortIOException(String message) { super(message); } - - /** - * Constructs a {@link SerialPortIOException} with the specified detail message and cause. - *

- * Note that the detail message associated with {@link cause} is not automatically incorporated into this exception's detail message. - * - * @param message message The detail message (which is saved for later retrieval by the {@link getMessage()} method). - * @param cause The cause (which is saved for later retrieval by the {@link getCause()} method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.) - */ - public SerialPortIOException(String message, Throwable cause) - { - super(message, cause); - } - - /** - * Constructs a {@link SerialPortIOException} with the specified cause and a detail message of {@code (cause==null ? null : cause.toString()) } - * (which typically contains the class and detail message of {@code cause}). This constructor is useful for IO exceptions that are little more - * than wrappers for other throwables. - * - * @param cause The cause (which is saved for later retrieval by the {@link getCause()} method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.) - */ - public SerialPortIOException(Throwable cause) - { - super(cause); - } } diff --git a/src/main/java/com/fazecast/jSerialComm/SerialPortInvalidPortException.java b/src/main/java/com/fazecast/jSerialComm/SerialPortInvalidPortException.java index 19a45cd9..e5d2ec04 100644 --- a/src/main/java/com/fazecast/jSerialComm/SerialPortInvalidPortException.java +++ b/src/main/java/com/fazecast/jSerialComm/SerialPortInvalidPortException.java @@ -34,24 +34,6 @@ public final class SerialPortInvalidPortException extends RuntimeException { private static final long serialVersionUID = 3420177672598538224L; - /** - * Constructs a {@link SerialPortInvalidPortException} with {@code null} as its error detail message. - */ - public SerialPortInvalidPortException() - { - super(); - } - - /** - * Constructs a {@link SerialPortInvalidPortException} with the specified detail message. - * - * @param message The detail message (which is saved for later retrieval by the {@link getMessage()} method). - */ - public SerialPortInvalidPortException(String message) - { - super(message); - } - /** * Constructs a {@link SerialPortInvalidPortException} with the specified detail message and cause. *

@@ -64,16 +46,4 @@ public SerialPortInvalidPortException(String message, Throwable cause) { super(message, cause); } - - /** - * Constructs a {@link SerialPortInvalidPortException} with the specified cause and a detail message of {@code (cause==null ? null : cause.toString()) } - * (which typically contains the class and detail message of {@code cause}). This constructor is useful for exceptions that are little more - * than wrappers for other throwables. - * - * @param cause The cause (which is saved for later retrieval by the {@link getCause()} method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.) - */ - public SerialPortInvalidPortException(Throwable cause) - { - super(cause); - } } diff --git a/src/main/java/com/fazecast/jSerialComm/SerialPortTimeoutException.java b/src/main/java/com/fazecast/jSerialComm/SerialPortTimeoutException.java index 9e0d109c..0100cb51 100644 --- a/src/main/java/com/fazecast/jSerialComm/SerialPortTimeoutException.java +++ b/src/main/java/com/fazecast/jSerialComm/SerialPortTimeoutException.java @@ -36,15 +36,6 @@ public final class SerialPortTimeoutException extends InterruptedIOException { private static final long serialVersionUID = 3209035213903386044L; - /** - * Constructs a {@link SerialPortTimeoutException} with {@code null} as its error detail message. - */ - public SerialPortTimeoutException() - { - super(); - bytesTransferred = 0; - } - /** * Constructs a {@link SerialPortTimeoutException} with the specified detail message. *