Add @ null annotations where Android Studio suggested it

That is, basically where the overriding function was missing an annotation from the base method.

Also apply renaming of emptyDescription to EMPTY_DESCRIPTION
This commit is contained in:
Stypox 2022-03-17 16:25:49 +01:00
parent adbbdc7a5b
commit 8c1041def6
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
7 changed files with 14 additions and 3 deletions

View file

@ -138,7 +138,7 @@ public class PeertubeChannelExtractor extends ChannelExtractor {
} }
@Override @Override
public void onFetchPage(final Downloader downloader) public void onFetchPage(@Nonnull final Downloader downloader)
throws IOException, ExtractionException { throws IOException, ExtractionException {
final Response response = downloader.get( final Response response = downloader.get(
baseUrl + PeertubeChannelLinkHandlerFactory.API_ENDPOINT + getId()); baseUrl + PeertubeChannelLinkHandlerFactory.API_ENDPOINT + getId());

View file

@ -23,12 +23,15 @@ import static org.schabi.newpipe.extractor.services.peertube.PeertubeParsingHelp
import static org.schabi.newpipe.extractor.services.peertube.PeertubeParsingHelper.START_KEY; import static org.schabi.newpipe.extractor.services.peertube.PeertubeParsingHelper.START_KEY;
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty; import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
import javax.annotation.Nonnull;
public class PeertubeCommentsExtractor extends CommentsExtractor { public class PeertubeCommentsExtractor extends CommentsExtractor {
public PeertubeCommentsExtractor(final StreamingService service, public PeertubeCommentsExtractor(final StreamingService service,
final ListLinkHandler uiHandler) { final ListLinkHandler uiHandler) {
super(service, uiHandler); super(service, uiHandler);
} }
@Nonnull
@Override @Override
public InfoItemsPage<CommentsInfoItem> getInitialPage() public InfoItemsPage<CommentsInfoItem> getInitialPage()
throws IOException, ExtractionException { throws IOException, ExtractionException {
@ -84,6 +87,6 @@ public class PeertubeCommentsExtractor extends CommentsExtractor {
} }
@Override @Override
public void onFetchPage(final Downloader downloader) { public void onFetchPage(@Nonnull final Downloader downloader) {
} }
} }

View file

@ -63,6 +63,7 @@ public class PeertubeSearchExtractor extends SearchExtractor {
return Collections.emptyList(); return Collections.emptyList();
} }
@Nonnull
@Override @Override
public InfoItemsPage<InfoItem> getInitialPage() throws IOException, ExtractionException { public InfoItemsPage<InfoItem> getInitialPage() throws IOException, ExtractionException {
return getPage(new Page(getUrl() + "&" + START_KEY + "=0&" return getPage(new Page(getUrl() + "&" + START_KEY + "=0&"

View file

@ -388,7 +388,8 @@ public class PeertubeStreamExtractor extends StreamExtractor {
} }
@Override @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( final Response response = downloader.get(
baseUrl + PeertubeStreamLinkHandlerFactory.VIDEO_API_ENDPOINT + getId()); baseUrl + PeertubeStreamLinkHandlerFactory.VIDEO_API_ENDPOINT + getId());
if (response != null) { if (response != null) {

View file

@ -33,11 +33,13 @@ public class PeertubeTrendingExtractor extends KioskExtractor<StreamInfoItem> {
super(streamingService, linkHandler, kioskId); super(streamingService, linkHandler, kioskId);
} }
@Nonnull
@Override @Override
public String getName() throws ParsingException { public String getName() throws ParsingException {
return getId(); return getId();
} }
@Nonnull
@Override @Override
public InfoItemsPage<StreamInfoItem> getInitialPage() throws IOException, ExtractionException { public InfoItemsPage<StreamInfoItem> getInitialPage() throws IOException, ExtractionException {
return getPage(new Page(getUrl() + "&" + START_KEY + "=0&" return getPage(new Page(getUrl() + "&" + START_KEY + "=0&"

View file

@ -13,6 +13,8 @@ import static org.schabi.newpipe.extractor.services.youtube.ItagItem.ItagType.VI
import org.schabi.newpipe.extractor.MediaFormat; import org.schabi.newpipe.extractor.MediaFormat;
import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.exceptions.ParsingException;
import javax.annotation.Nonnull;
public class ItagItem { public class ItagItem {
/** /**
* List can be found here * List can be found here
@ -96,6 +98,7 @@ public class ItagItem {
return false; return false;
} }
@Nonnull
public static ItagItem getItag(final int itagId) throws ParsingException { public static ItagItem getItag(final int itagId) throws ParsingException {
for (final ItagItem item : ITAG_LIST) { for (final ItagItem item : ITAG_LIST) {
if (itagId == item.id) { if (itagId == item.id) {

View file

@ -133,6 +133,7 @@ public class YoutubeSearchExtractor extends SearchExtractor {
return !showingResultsForRenderer.isEmpty(); return !showingResultsForRenderer.isEmpty();
} }
@Nonnull
@Override @Override
public List<MetaInfo> getMetaInfo() throws ParsingException { public List<MetaInfo> getMetaInfo() throws ParsingException {
return YoutubeParsingHelper.getMetaInfo( return YoutubeParsingHelper.getMetaInfo(