Enable several more checkstyle modules

* Enable checkstyle ParenPadCheck
* Enable checkstyle EmptyLineSeparator
* Enable checkstyle TypecastParenPad
master
Evan Harris 5 years ago committed by jvoisin
parent 7578ee9537
commit 153ad19b6b
  1. 1
      airsonic-main/src/main/java/org/airsonic/player/ajax/TransferService.java
  2. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/ControllerUtils.java
  3. 1
      airsonic-main/src/main/java/org/airsonic/player/i18n/LocaleResolver.java
  4. 2
      airsonic-main/src/main/java/org/airsonic/player/service/PlayerService.java
  5. 2
      airsonic-main/src/main/java/org/airsonic/player/service/SettingsService.java
  6. 1
      airsonic-main/src/main/java/org/airsonic/player/service/metadata/DefaultMetaDataParser.java
  7. 2
      airsonic-main/src/main/java/org/airsonic/player/util/StringUtil.java
  8. 7
      checkstyle.xml

@ -25,6 +25,7 @@ import org.directwebremoting.WebContextFactory;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpSession;
/**
* Provides AJAX-enabled services for retrieving the status of ongoing transfers.
* This class is used by the DWR framework (http://getahead.ltd.uk/dwr/).

@ -15,7 +15,7 @@ public class ControllerUtils {
String path = (String) request.getAttribute(
HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
String bestMatchPattern = (String ) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE);
String bestMatchPattern = (String) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE);
AntPathMatcher apm = new AntPathMatcher();

@ -32,6 +32,7 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
/**
* Locale resolver implementation which returns the locale selected in the settings.
*

@ -341,7 +341,7 @@ public class PlayerService {
// Create player if necessary.
Player player = new Player();
if (request != null ) {
if (request != null) {
player.setIpAddress(request.getRemoteAddr());
}
player.setUsername(User.USERNAME_GUEST);

@ -252,7 +252,7 @@ public class SettingsService {
private void removeObsoleteProperties() {
OBSOLETE_KEYS.forEach( oKey -> {
OBSOLETE_KEYS.forEach(oKey -> {
if(configurationService.containsKey(oKey)) {
LOG.info("Removing obsolete property [" + oKey + ']');
configurationService.clearProperty(oKey);

@ -40,6 +40,7 @@ public class DefaultMetaDataParser extends MetaDataParser {
public DefaultMetaDataParser(SettingsService settingsService) {
this.settingsService = settingsService;
}
/**
* Parses meta data for the given file.
*

@ -201,7 +201,7 @@ public final class StringUtil {
// More than 1 TB?
if (byteCount >= 1024L * 1024 * 1024 * 1024) {
NumberFormat teraByteFormat = new DecimalFormat("0.00 TB", new DecimalFormatSymbols(locale));
return teraByteFormat.format( byteCount / ((double) 1024 * 1024 * 1024 * 1024));
return teraByteFormat.format(byteCount / ((double) 1024 * 1024 * 1024 * 1024));
}
// More than 1 GB?

@ -21,13 +21,20 @@
<property name="separateLineBetweenGroups" value="true"/>
</module>
<module name="DefaultComesLast"/>
<module name="EmptyLineSeparator">
<!-- Enable all except PACKAGE_DEF, METHOD_DEF, VARIABLE_DEF -->
<property name="tokens"
value="IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF, STATIC_INIT, INSTANCE_INIT, CTOR_DEF"/>
</module>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/>
<module name="Indentation"/>
<module name="InnerAssignment"/>
<module name="ParenPadCheck"/>
<module name="RedundantImport"/>
<module name="StringLiteralEquality"/>
<module name="TypecastParenPad"/>
<module name="UnusedImports"/>
</module>
</module>

Loading…
Cancel
Save