Use Objects.requireNonNull().
This commit is contained in:
parent
0cdd866393
commit
14a2171035
6 changed files with 16 additions and 25 deletions
|
|
@ -22,6 +22,7 @@ import java.net.SocketTimeoutException;
|
|||
import java.net.URL;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.channels.ClosedByInterruptException;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.net.ssl.SSLException;
|
||||
|
||||
|
|
@ -154,8 +155,8 @@ public class DownloadMission extends Mission {
|
|||
public transient Thread init = null;
|
||||
|
||||
public DownloadMission(String[] urls, StoredFileHelper storage, char kind, Postprocessing psInstance) {
|
||||
if (urls == null) throw new NullPointerException("urls is null");
|
||||
if (urls.length < 1) throw new IllegalArgumentException("urls is empty");
|
||||
if (Objects.requireNonNull(urls).length < 1)
|
||||
throw new IllegalArgumentException("urls array is empty");
|
||||
this.urls = urls;
|
||||
this.kind = kind;
|
||||
this.offsets = new long[urls.length];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue