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. 24
      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). // 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) { private MediaFile createMediaFile(File file) {

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

@ -42,7 +42,7 @@ public class CustomThemeSource extends ResourceBundleThemeSource {
// Create parent theme recursively. // Create parent theme recursively.
for (Theme theme : settingsService.getAvailableThemes()) { 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(); String parent = basenamePrefix + theme.getParent();
messageSource.setParentMessageSource(createMessageSource(parent)); messageSource.setParentMessageSource(createMessageSource(parent));
break; break;

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

Loading…
Cancel
Save