Enable checkstyle's Indentation module

master
jvoisin 5 years ago committed by GitHub
parent fabed228da
commit 7578ee9537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/MainController.java
  2. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/SettingsController.java
  3. 4
      airsonic-main/src/main/java/org/airsonic/player/security/JWTAuthenticationProvider.java
  4. 6
      airsonic-main/src/main/java/org/airsonic/player/util/FileUtil.java
  5. 1
      checkstyle.xml

@ -171,7 +171,7 @@ public class MainController {
} }
return new ModelAndView(view, "model", map); return new ModelAndView(view, "model", map);
} }
private <T> boolean trimToSize(Boolean showAll, List<T> list, int userPaginationPreference) { private <T> boolean trimToSize(Boolean showAll, List<T> list, int userPaginationPreference) {
boolean trimmed = false; boolean trimmed = false;

@ -42,7 +42,7 @@ public class SettingsController {
@Autowired @Autowired
private SecurityService securityService; private SecurityService securityService;
@GetMapping @GetMapping
protected ModelAndView handleRequestInternal(HttpServletRequest request) throws Exception { protected ModelAndView handleRequestInternal(HttpServletRequest request) throws Exception {
User user = securityService.getCurrentUser(request); User user = securityService.getCurrentUser(request);

@ -46,9 +46,7 @@ public class JWTAuthenticationProvider implements AuthenticationProvider {
// TODO:AD This is super unfortunate, but not sure there is a better way when using JSP // TODO:AD This is super unfortunate, but not sure there is a better way when using JSP
if(StringUtils.contains(authentication.getRequestedPath(), "/WEB-INF/jsp/")) { if(StringUtils.contains(authentication.getRequestedPath(), "/WEB-INF/jsp/")) {
logger.warn("BYPASSING AUTH FOR WEB-INF page"); logger.warn("BYPASSING AUTH FOR WEB-INF page");
} else } else if(!roughlyEqual(path.asString(), authentication.getRequestedPath())) {
if(!roughlyEqual(path.asString(), authentication.getRequestedPath())) {
throw new InsufficientAuthenticationException("Credentials not valid for path " + authentication throw new InsufficientAuthenticationException("Credentials not valid for path " + authentication
.getRequestedPath() + ". They are valid for " + path.asString()); .getRequestedPath() + ". They are valid for " + path.asString());
} }

@ -140,13 +140,7 @@ public final class FileUtil {
} }
private static <T> T timed(FileTask<T> task) { private static <T> T timed(FileTask<T> task) {
// long t0 = System.nanoTime();
// try {
return task.execute(); return task.execute();
// } finally {
// long t1 = System.nanoTime();
// LOG.debug((t1 - t0) / 1000L + " microsec, " + task);
// }
} }
private abstract static class FileTask<T> { private abstract static class FileTask<T> {

@ -24,6 +24,7 @@
<module name="EmptyStatement"/> <module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/> <module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/> <module name="EqualsHashCode"/>
<module name="Indentation"/>
<module name="InnerAssignment"/> <module name="InnerAssignment"/>
<module name="RedundantImport"/> <module name="RedundantImport"/>
<module name="StringLiteralEquality"/> <module name="StringLiteralEquality"/>

Loading…
Cancel
Save