Skip to content

Commit c57016b

Browse files
committed
Make getCommentText @nonnull
1 parent adcc1f1 commit c57016b

6 files changed

Lines changed: 9 additions & 2 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItem.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
public class CommentsInfoItem extends InfoItem {
1414

1515
private String commentId;
16-
private Description commentText;
16+
@Nonnull
17+
private Description commentText = Description.EMPTY_DESCRIPTION;
1718
private String uploaderName;
1819
@Nonnull
1920
private List<Image> uploaderAvatars = List.of();
@@ -50,11 +51,12 @@ public void setCommentId(final String commentId) {
5051
this.commentId = commentId;
5152
}
5253

54+
@Nonnull
5355
public Description getCommentText() {
5456
return commentText;
5557
}
5658

57-
public void setCommentText(final Description commentText) {
59+
public void setCommentText(@Nonnull final Description commentText) {
5860
this.commentText = commentText;
5961
}
6062

extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItemExtractor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ default String getTextualLikeCount() throws ParsingException {
4545
/**
4646
* The text of the comment
4747
*/
48+
@Nonnull
4849
default Description getCommentText() throws ParsingException {
4950
return Description.EMPTY_DESCRIPTION;
5051
}

extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampCommentsInfoItemExtractor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public List<Image> getThumbnails() throws ParsingException {
3838
return getUploaderAvatars();
3939
}
4040

41+
@Nonnull
4142
@Override
4243
public Description getCommentText() throws ParsingException {
4344
return new Description(review.getString("why"), Description.PLAIN_TEXT);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public DateWrapper getUploadDate() throws ParsingException {
7777
return new DateWrapper(parseDateFrom(textualUploadDate));
7878
}
7979

80+
@Nonnull
8081
@Override
8182
public Description getCommentText() throws ParsingException {
8283
final String htmlText = JsonUtils.getString(item, "text");

extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudCommentsInfoItemExtractor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public String getCommentId() {
2929
return Objects.toString(json.getLong("id"), null);
3030
}
3131

32+
@Nonnull
3233
@Override
3334
public Description getCommentText() {
3435
return new Description(json.getString("body"), Description.PLAIN_TEXT);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ public String getTextualLikeCount() throws ParsingException {
184184
}
185185
}
186186

187+
@Nonnull
187188
@Override
188189
public Description getCommentText() throws ParsingException {
189190
try {

0 commit comments

Comments
 (0)