Skip to content

Commit 70d9a77

Browse files
authored
Merge pull request #8073 from Stypox/bump-checkstyle
Update checkstyle to 10.0 and fix various related issues
2 parents 6d2b5d9 + 53f8415 commit 70d9a77

9 files changed

Lines changed: 22 additions & 37 deletions

File tree

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ android {
9898
}
9999

100100
ext {
101-
checkstyleVersion = '9.3'
101+
checkstyleVersion = '10.0'
102102

103103
androidxLifecycleVersion = '2.3.1'
104104
androidxRoomVersion = '2.4.2'
@@ -121,7 +121,7 @@ configurations {
121121
}
122122

123123
checkstyle {
124-
getConfigDirectory().set(rootProject.file("."))
124+
getConfigDirectory().set(rootProject.file("checkstyle"))
125125
ignoreFailures false
126126
showViolations true
127127
toolVersion = checkstyleVersion

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: 0 additions & 27 deletions
This file was deleted.

checkstyle.xml renamed to checkstyle/checkstyle.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
2424
<module name="SuppressionFilter">
25-
<property name="file" value="${config_loc}/checkstyle-suppressions.xml" />
25+
<property name="file" value="${config_loc}/suppressions.xml" />
2626
<property name="optional" value="true"/>
2727
</module>
2828

@@ -180,12 +180,5 @@
180180
<module name="UpperEll"/>
181181

182182
<module name="SuppressWarningsHolder" />
183-
184-
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
185-
<module name="SuppressionXpathFilter">
186-
<property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
187-
default="checkstyle-xpath-suppressions.xml" />
188-
<property name="optional" value="true"/>
189-
</module>
190183
</module>
191184
</module>

checkstyle/suppressions.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE suppressions PUBLIC
3+
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
4+
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
5+
<suppressions>
6+
<!-- Use @SuppressWarnings("...") if it is possible, only use this file if it is not -->
7+
8+
<suppress checks="FileLength"
9+
files="Player.java"/>
10+
11+
<suppress checks="FileLength"
12+
files="VideoDetailFragment.java"/>
13+
</suppressions>

0 commit comments

Comments
 (0)