Skip to content

Commit

Permalink
Use Objects.requireNonNull().
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Dec 11, 2020
1 parent 4c19a88 commit 57be1f1
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.Objects;

public abstract class Extractor {
/**
Expand All @@ -29,12 +30,9 @@ public abstract class Extractor {
private final Downloader downloader;

public Extractor(final StreamingService service, final LinkHandler linkHandler) {
if (service == null) throw new NullPointerException("service is null");
if (linkHandler == null) throw new NullPointerException("LinkHandler is null");
this.service = service;
this.linkHandler = linkHandler;
this.downloader = NewPipe.getDownloader();
if (downloader == null) throw new NullPointerException("downloader is null");
this.service = Objects.requireNonNull(service, "service is null");
this.linkHandler = Objects.requireNonNull(linkHandler, "LinkHandler is null");
this.downloader = Objects.requireNonNull(NewPipe.getDownloader(), "downloader is null");
}

/**
Expand Down

0 comments on commit 57be1f1

Please sign in to comment.