Skip to content

Commit 53f8415

Browse files
committed
Use @SuppressWarnings for checkstyle suppressions & warnings
It's better to use @SuppressWarnings instead of the suppressions file, so that the warning suppression is at the place where it acts.
1 parent 710964b commit 53f8415

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

app/src/main/java/org/schabi/newpipe/local/LocalItemListAdapter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ public int getItemCount() {
228228
return count;
229229
}
230230

231+
@SuppressWarnings("FinalParameters")
231232
@Override
232233
public int getItemViewType(int position) {
233234
if (DEBUG) {
@@ -300,6 +301,7 @@ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull final ViewGroup paren
300301
}
301302
}
302303

304+
@SuppressWarnings("FinalParameters")
303305
@Override
304306
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int position) {
305307
if (DEBUG) {

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,7 @@ public void seek(final boolean forward) {
682682
//////////////////////////////////////////////////////////////////////////*/
683683
//region Playback initialization via intent
684684

685+
@SuppressWarnings("MethodLength")
685686
public void handleIntent(@NonNull final Intent intent) {
686687
// fail fast if no play queue was provided
687688
final String queueCache = intent.getStringExtra(PLAY_QUEUE_KEY);

app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueueItem.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public class PlayQueueItem implements Serializable {
5252
item.getUploaderUrl(), item.getStreamType());
5353
}
5454

55+
@SuppressWarnings("ParameterNumber")
5556
private PlayQueueItem(@Nullable final String name, @Nullable final String url,
5657
final int serviceId, final long duration,
5758
@Nullable final String thumbnailUrl, @Nullable final String uploader,

app/src/main/java/org/schabi/newpipe/streams/Mp4FromDashWriter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public void close() throws IOException {
142142
outStream = null;
143143
}
144144

145+
@SuppressWarnings("MethodLength")
145146
public void build(final SharpStream output) throws IOException {
146147
if (done) {
147148
throw new RuntimeException("already done");

app/src/main/java/org/schabi/newpipe/streams/WebMWriter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public void close() {
121121
clustersOffsetsSizes = null;
122122
}
123123

124+
@SuppressWarnings("MethodLength")
124125
public void build(final SharpStream out) throws IOException, RuntimeException {
125126
if (!out.canRewind()) {
126127
throw new IOException("The output stream must be allow seek");

checkstyle/suppressions.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
44
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
55
<suppressions>
6-
<suppress checks="FinalParameters"
7-
files="LocalItemListAdapter.java"
8-
lines="232,304"/>
9-
10-
<suppress checks="EmptyBlock"
11-
files="ContentSettingsFragment.java"
12-
lines="227,245"/>
6+
<!-- Use @SuppressWarnings("...") if it is possible, only use this file if it is not -->
137

148
<suppress checks="FileLength"
159
files="Player.java"/>

0 commit comments

Comments
 (0)