Enabled more checkstyle rules

This commit is contained in:
ByteHamster 2020-03-18 20:13:09 +01:00
parent dd5234cd2f
commit 9e99b81f1e
6 changed files with 23 additions and 12 deletions

View File

@ -70,8 +70,7 @@ public class EspressoTestUtils {
} }
uiController.loopMainThreadForAtLeast(50); uiController.loopMainThreadForAtLeast(50);
} } while (System.currentTimeMillis() < endTime);
while (System.currentTimeMillis() < endTime);
// timeout happens // timeout happens
throw new PerformException.Builder() throw new PerformException.Builder()

View File

@ -62,7 +62,7 @@ public class UserInterfacePreferencesFragment extends PreferenceFragmentCompat {
final Context context = getActivity(); final Context context = getActivity();
final String[] navTitles = context.getResources().getStringArray(R.array.back_button_go_to_pages); final String[] navTitles = context.getResources().getStringArray(R.array.back_button_go_to_pages);
final String[] navTags = context.getResources().getStringArray(R.array.back_button_go_to_pages_tags); final String[] navTags = context.getResources().getStringArray(R.array.back_button_go_to_pages_tags);
final String choice[] = { UserPreferences.getBackButtonGoToPage() }; final String[] choice = { UserPreferences.getBackButtonGoToPage() };
AlertDialog.Builder builder = new AlertDialog.Builder(context); AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(R.string.back_button_go_to_page_title); builder.setTitle(R.string.back_button_go_to_page_title);

View File

@ -33,8 +33,14 @@
<property name="tokens" <property name="tokens"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/> value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module> </module>
<module name="RightCurly">
<property name="id" value="RightCurlySame"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
</module>
<module name="OneStatementPerLine"/> <module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/> <module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>
<module name="FallThrough"/> <module name="FallThrough"/>
<module name="UpperEll"/> <module name="UpperEll"/>
<module name="ModifierOrder"/> <module name="ModifierOrder"/>
@ -74,6 +80,11 @@
<message key="name.invalidPattern" <message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/> value="Type name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="LambdaParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="CatchParameterName"> <module name="CatchParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/> <property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern" <message key="name.invalidPattern"
@ -121,6 +132,11 @@
<property name="tokens" value="VARIABLE_DEF"/> <property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/> <property name="allowSamelineMultipleAnnotations" value="true"/>
</module> </module>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="MethodName"> <module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/> <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern" <message key="name.invalidPattern"

View File

@ -58,7 +58,7 @@ public class ExoPlayerWrapper implements IPlayer {
bufferingUpdateDisposable = Observable.interval(2, TimeUnit.SECONDS) bufferingUpdateDisposable = Observable.interval(2, TimeUnit.SECONDS)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(aLong -> { .subscribe(tickNumber -> {
if (bufferingUpdateListener != null) { if (bufferingUpdateListener != null) {
bufferingUpdateListener.onBufferingUpdate(null, mExoPlayer.getBufferedPercentage()); bufferingUpdateListener.onBufferingUpdate(null, mExoPlayer.getBufferedPercentage());
} }

View File

@ -40,8 +40,7 @@ public class RewindAfterPauseUtils {
int newPosition = currentPosition - (int) rewindTime; int newPosition = currentPosition - (int) rewindTime;
return newPosition > 0 ? newPosition : 0; return newPosition > 0 ? newPosition : 0;
} } else {
else {
return currentPosition; return currentPosition;
} }
} }

View File

@ -89,14 +89,11 @@ public class HtmlToPlainText {
String name = node.nodeName(); String name = node.nodeName();
if (node instanceof TextNode) { if (node instanceof TextNode) {
append(((TextNode) node).text()); // TextNodes carry all user-readable text in the DOM. append(((TextNode) node).text()); // TextNodes carry all user-readable text in the DOM.
} } else if (name.equals("li")) {
else if (name.equals("li")) {
append("\n * "); append("\n * ");
} } else if (name.equals("dt")) {
else if (name.equals("dt")) {
append(" "); append(" ");
} } else if (StringUtil.in(name, "p", "h1", "h2", "h3", "h4", "h5", "tr")) {
else if (StringUtil.in(name, "p", "h1", "h2", "h3", "h4", "h5", "tr")) {
append("\n"); append("\n");
} }
} }