mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Require non null (#580)
* Replace null checks with Objects.requireNonNull() * Use PMD rule instead of checkstyle rule
This commit is contained in:
committed by
Peter Johnson
parent
06321b8e87
commit
74df3fac4e
@@ -170,6 +170,7 @@ public abstract class MotorEncoderFixture<T extends SpeedController> implements
|
||||
* deallocated.
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("Regexp")
|
||||
public boolean teardown() {
|
||||
String type;
|
||||
if (m_motor != null) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.logging.LogManager;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -43,9 +44,7 @@ public class TestSuite extends AbstractTestSuite {
|
||||
// Sets up the logging output
|
||||
final InputStream inputStream = TestSuite.class.getResourceAsStream("/logging.properties");
|
||||
try {
|
||||
if (inputStream == null) {
|
||||
throw new NullPointerException("./logging.properties was not loaded");
|
||||
}
|
||||
Objects.requireNonNull(inputStream, "./logging.properties was not loaded");
|
||||
LogManager.getLogManager().readConfiguration(inputStream);
|
||||
Logger.getAnonymousLogger().info("Loaded");
|
||||
} catch (final IOException | NullPointerException ex) {
|
||||
|
||||
Reference in New Issue
Block a user