Enable EqualsAvoidNull in checkstyle

master
jvoisin 5 years ago committed by GitHub
parent 3c5735e03e
commit fabed228da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      airsonic-main/src/main/java/org/airsonic/player/service/MediaFileService.java
  2. 22
      airsonic-main/src/main/java/org/airsonic/player/service/metadata/JaudiotaggerParser.java
  3. 2
      airsonic-main/src/main/java/org/airsonic/player/theme/CustomThemeSource.java
  4. 1
      checkstyle.xml

@ -459,7 +459,7 @@ public class MediaFileService {
}
// Exclude all hidden files starting with a single "." or "@eaDir" (thumbnail dir created on Synology devices).
return (name.startsWith(".") && !name.startsWith("..")) || name.startsWith("@eaDir") || name.equals("Thumbs.db");
return (name.startsWith(".") && !name.startsWith("..")) || name.startsWith("@eaDir") || "Thumbs.db".equals(name);
}
private MediaFile createMediaFile(File file) {

@ -360,17 +360,17 @@ public class JaudiotaggerParser extends MetaDataParser {
String format = FilenameUtils.getExtension(file.getName()).toLowerCase();
return format.equals("mp3") ||
format.equals("m4a") ||
format.equals("m4b") ||
format.equals("aac") ||
format.equals("ogg") ||
format.equals("flac") ||
format.equals("wav") ||
format.equals("mpc") ||
format.equals("mp+") ||
format.equals("ape") ||
format.equals("wma");
return "mp3".equals(format) ||
"m4a".equals(format) ||
"m4b".equals(format) ||
"aac".equals(format) ||
"ogg".equals(format) ||
"flac".equals(format) ||
"wav".equals(format) ||
"mpc".equals(format) ||
"mp+".equals(format) ||
"ape".equals(format) ||
"wma".equals(format);
}
/**

@ -42,7 +42,7 @@ public class CustomThemeSource extends ResourceBundleThemeSource {
// Create parent theme recursively.
for (Theme theme : settingsService.getAvailableThemes()) {
if (basename.equals(basenamePrefix + theme.getId()) && theme.getParent() != null) {
if ((basenamePrefix + theme.getId()).equals(basename) && theme.getParent() != null) {
String parent = basenamePrefix + theme.getParent();
messageSource.setParentMessageSource(createMessageSource(parent));
break;

@ -22,6 +22,7 @@
</module>
<module name="DefaultComesLast"/>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/>
<module name="InnerAssignment"/>
<module name="RedundantImport"/>

Loading…
Cancel
Save