Skip to content

Commit 8c1041d

Browse files
committed
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
1 parent adbbdc7 commit 8c1041d

File tree

7 files changed

+14
-3
lines changed

7 files changed

+14
-3
lines changed

extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeChannelExtractor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public InfoItemsPage<StreamInfoItem> getPage(final Page page)
138138
}
139139

140140
@Override
141-
public void onFetchPage(final Downloader downloader)
141+
public void onFetchPage(@Nonnull final Downloader downloader)
142142
throws IOException, ExtractionException {
143143
final Response response = downloader.get(
144144
baseUrl + PeertubeChannelLinkHandlerFactory.API_ENDPOINT + getId());

extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeCommentsExtractor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@
2323
import static org.schabi.newpipe.extractor.services.peertube.PeertubeParsingHelper.START_KEY;
2424
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
2525

26+
import javax.annotation.Nonnull;
27+
2628
public class PeertubeCommentsExtractor extends CommentsExtractor {
2729
public PeertubeCommentsExtractor(final StreamingService service,
2830
final ListLinkHandler uiHandler) {
2931
super(service, uiHandler);
3032
}
3133

34+
@Nonnull
3235
@Override
3336
public InfoItemsPage<CommentsInfoItem> getInitialPage()
3437
throws IOException, ExtractionException {
@@ -84,6 +87,6 @@ public InfoItemsPage<CommentsInfoItem> getPage(final Page page)
8487
}
8588

8689
@Override
87-
public void onFetchPage(final Downloader downloader) {
90+
public void onFetchPage(@Nonnull final Downloader downloader) {
8891
}
8992
}

extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeSearchExtractor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public List<MetaInfo> getMetaInfo() {
6363
return Collections.emptyList();
6464
}
6565

66+
@Nonnull
6667
@Override
6768
public InfoItemsPage<InfoItem> getInitialPage() throws IOException, ExtractionException {
6869
return getPage(new Page(getUrl() + "&" + START_KEY + "=0&"

extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamExtractor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ private void collectStreamsFrom(final StreamInfoItemsCollector collector,
388388
}
389389

390390
@Override
391-
public void onFetchPage(final Downloader downloader) throws IOException, ExtractionException {
391+
public void onFetchPage(@Nonnull final Downloader downloader)
392+
throws IOException, ExtractionException {
392393
final Response response = downloader.get(
393394
baseUrl + PeertubeStreamLinkHandlerFactory.VIDEO_API_ENDPOINT + getId());
394395
if (response != null) {

extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeTrendingExtractor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ public PeertubeTrendingExtractor(final StreamingService streamingService,
3333
super(streamingService, linkHandler, kioskId);
3434
}
3535

36+
@Nonnull
3637
@Override
3738
public String getName() throws ParsingException {
3839
return getId();
3940
}
4041

42+
@Nonnull
4143
@Override
4244
public InfoItemsPage<StreamInfoItem> getInitialPage() throws IOException, ExtractionException {
4345
return getPage(new Page(getUrl() + "&" + START_KEY + "=0&"

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/ItagItem.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import org.schabi.newpipe.extractor.MediaFormat;
1414
import org.schabi.newpipe.extractor.exceptions.ParsingException;
1515

16+
import javax.annotation.Nonnull;
17+
1618
public class ItagItem {
1719
/**
1820
* List can be found here
@@ -96,6 +98,7 @@ public static boolean isSupported(final int itag) {
9698
return false;
9799
}
98100

101+
@Nonnull
99102
public static ItagItem getItag(final int itagId) throws ParsingException {
100103
for (final ItagItem item : ITAG_LIST) {
101104
if (itagId == item.id) {

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeSearchExtractor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public boolean isCorrectedSearch() {
133133
return !showingResultsForRenderer.isEmpty();
134134
}
135135

136+
@Nonnull
136137
@Override
137138
public List<MetaInfo> getMetaInfo() throws ParsingException {
138139
return YoutubeParsingHelper.getMetaInfo(

0 commit comments

Comments
 (0)