8263395: Incorrect use of Objects.nonNull

Reviewed-by: shade
This commit is contained in:
Erik Gahlin 2021-04-16 19:51:15 +00:00
parent 74d03abb7b
commit 4413dbfbdb
3 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -436,7 +436,7 @@ public final class Recording implements Closeable {
* @since 14
*/
/*package private*/ void setFlushInterval(Duration interval) {
Objects.nonNull(interval);
Objects.requireNonNull(interval);
if (interval.isNegative()) {
throw new IllegalArgumentException("Stream interval can't be negative");
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -159,7 +159,7 @@ public interface EventStream extends AutoCloseable {
* files in the directory.
*/
public static EventStream openRepository(Path directory) throws IOException {
Objects.nonNull(directory);
Objects.requireNonNull(directory);
AccessControlContext acc = AccessController.getContext();
return new EventDirectoryStream(acc, directory, FileAccess.UNPRIVILEGED, null, Collections.emptyList());
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -110,7 +110,7 @@ public abstract class AbstractEventStream implements EventStream {
@Override
public final void setStartTime(Instant startTime) {
Objects.nonNull(startTime);
Objects.requireNonNull(startTime);
synchronized (streamConfiguration) {
if (streamConfiguration.started) {
throw new IllegalStateException("Stream is already started");