Skip to content

Commit

Permalink
Add @ null annotations where Android Studio suggested it
Browse files Browse the repository at this point in the history
That is, basically where the overriding function was missing an annotation from the base method.

Also apply renaming of emptyDescription to EMPTY_DESCRIPTION
  • Loading branch information
Stypox committed Mar 26, 2022
1 parent adbbdc7 commit 8c1041d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public InfoItemsPage<StreamInfoItem> getPage(final Page page)
}

@Override
public void onFetchPage(final Downloader downloader)
public void onFetchPage(@Nonnull final Downloader downloader)
throws IOException, ExtractionException {
final Response response = downloader.get(
baseUrl + PeertubeChannelLinkHandlerFactory.API_ENDPOINT + getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@
import static org.schabi.newpipe.extractor.services.peertube.PeertubeParsingHelper.START_KEY;
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;

import javax.annotation.Nonnull;

public class PeertubeCommentsExtractor extends CommentsExtractor {
public PeertubeCommentsExtractor(final StreamingService service,
final ListLinkHandler uiHandler) {
super(service, uiHandler);
}

@Nonnull
@Override
public InfoItemsPage<CommentsInfoItem> getInitialPage()
throws IOException, ExtractionException {
Expand Down Expand Up @@ -84,6 +87,6 @@ public InfoItemsPage<CommentsInfoItem> getPage(final Page page)
}

@Override
public void onFetchPage(final Downloader downloader) {
public void onFetchPage(@Nonnull final Downloader downloader) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public List<MetaInfo> getMetaInfo() {
return Collections.emptyList();
}

@Nonnull
@Override
public InfoItemsPage<InfoItem> getInitialPage() throws IOException, ExtractionException {
return getPage(new Page(getUrl() + "&" + START_KEY + "=0&"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ private void collectStreamsFrom(final StreamInfoItemsCollector collector,
}

@Override
public void onFetchPage(final Downloader downloader) throws IOException, ExtractionException {
public void onFetchPage(@Nonnull final Downloader downloader)
throws IOException, ExtractionException {
final Response response = downloader.get(
baseUrl + PeertubeStreamLinkHandlerFactory.VIDEO_API_ENDPOINT + getId());
if (response != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ public PeertubeTrendingExtractor(final StreamingService streamingService,
super(streamingService, linkHandler, kioskId);
}

@Nonnull
@Override
public String getName() throws ParsingException {
return getId();
}

@Nonnull
@Override
public InfoItemsPage<StreamInfoItem> getInitialPage() throws IOException, ExtractionException {
return getPage(new Page(getUrl() + "&" + START_KEY + "=0&"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import org.schabi.newpipe.extractor.MediaFormat;
import org.schabi.newpipe.extractor.exceptions.ParsingException;

import javax.annotation.Nonnull;

public class ItagItem {
/**
* List can be found here
Expand Down Expand Up @@ -96,6 +98,7 @@ public static boolean isSupported(final int itag) {
return false;
}

@Nonnull
public static ItagItem getItag(final int itagId) throws ParsingException {
for (final ItagItem item : ITAG_LIST) {
if (itagId == item.id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public boolean isCorrectedSearch() {
return !showingResultsForRenderer.isEmpty();
}

@Nonnull
@Override
public List<MetaInfo> getMetaInfo() throws ParsingException {
return YoutubeParsingHelper.getMetaInfo(
Expand Down

0 comments on commit 8c1041d

Please sign in to comment.