Added SingleSpaceSeparator checkstyle

master
Evan Harris 5 years ago
parent f476fd7c33
commit 510314a9d8
No known key found for this signature in database
GPG Key ID: FF3BD4DA59FF9EDC
  1. 4
      airsonic-main/src/main/java/org/airsonic/player/ajax/LyricsService.java
  2. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/AvatarUploadController.java
  3. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/ChangeCoverArtController.java
  4. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/CoverArtController.java
  5. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/EditTagsController.java
  6. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/GeneralSettingsController.java
  7. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/HomeController.java
  8. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/LeftController.java
  9. 4
      airsonic-main/src/main/java/org/airsonic/player/controller/M3UController.java
  10. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/MainController.java
  11. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/MoreController.java
  12. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/PersonalSettingsController.java
  13. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/PlayerSettingsController.java
  14. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/PodcastController.java
  15. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/ProxyController.java
  16. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/RightController.java
  17. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/SettingsController.java
  18. 2
      airsonic-main/src/main/java/org/airsonic/player/controller/ShareManagementController.java
  19. 2
      airsonic-main/src/main/java/org/airsonic/player/dao/AbstractDao.java
  20. 2
      airsonic-main/src/main/java/org/airsonic/player/domain/MediaFileComparator.java
  21. 4
      airsonic-main/src/main/java/org/airsonic/player/monitor/MetricsManager.java
  22. 2
      airsonic-main/src/main/java/org/airsonic/player/service/NetworkService.java
  23. 2
      airsonic-main/src/main/java/org/airsonic/player/service/search/DocumentFactory.java
  24. 4
      airsonic-main/src/main/java/org/airsonic/player/service/search/SearchServiceImpl.java
  25. 2
      airsonic-main/src/main/java/org/airsonic/player/service/upnp/AlbumUpnpProcessor.java
  26. 2
      airsonic-main/src/main/java/org/airsonic/player/service/upnp/ArtistUpnpProcessor.java
  27. 2
      airsonic-main/src/main/java/org/airsonic/player/service/upnp/GenreUpnpProcessor.java
  28. 2
      airsonic-main/src/main/java/org/airsonic/player/service/upnp/UpnpContentProcessor.java
  29. 2
      airsonic-main/src/main/java/org/airsonic/player/spring/RegisterPrecompiledJSPInitializer.java
  30. 2
      airsonic-main/src/test/java/org/airsonic/player/MissingTranslations.java
  31. 2
      airsonic-main/src/test/java/org/airsonic/player/domain/VersionTestCase.java
  32. 2
      airsonic-main/src/test/java/org/airsonic/player/service/search/QueryFactoryTestCase.java
  33. 2
      airsonic-main/src/test/java/org/airsonic/player/validator/PasswordSettingsValidatorTestCase.java
  34. 1
      checkstyle.xml

@ -97,8 +97,8 @@ public class LyricsService {
Namespace ns = root.getNamespace(); Namespace ns = root.getNamespace();
String lyric = StringUtils.trimToNull(root.getChildText("Lyric", ns)); String lyric = StringUtils.trimToNull(root.getChildText("Lyric", ns));
String song = root.getChildText("LyricSong", ns); String song = root.getChildText("LyricSong", ns);
String artist = root.getChildText("LyricArtist", ns); String artist = root.getChildText("LyricArtist", ns);
return new LyricsInfo(lyric, artist, song); return new LyricsInfo(lyric, artist, song);
} }

@ -56,7 +56,7 @@ import java.util.Map;
*/ */
@Controller @Controller
@RequestMapping("/avatarUpload") @RequestMapping("/avatarUpload")
public class AvatarUploadController { public class AvatarUploadController {
private static final Logger LOG = LoggerFactory.getLogger(AvatarUploadController.class); private static final Logger LOG = LoggerFactory.getLogger(AvatarUploadController.class);
private static final int MAX_AVATAR_SIZE = 64; private static final int MAX_AVATAR_SIZE = 64;

@ -42,7 +42,7 @@ import java.util.Map;
*/ */
@Controller @Controller
@RequestMapping("/changeCoverArt") @RequestMapping("/changeCoverArt")
public class ChangeCoverArtController { public class ChangeCoverArtController {
@Autowired @Autowired
private MediaFileService mediaFileService; private MediaFileService mediaFileService;

@ -300,7 +300,7 @@ public class CoverArtController implements LastModified {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} else { } else {
is = new FileInputStream(file); is = new FileInputStream(file);
mimeType = StringUtil.getMimeType(FilenameUtils.getExtension(file.getName())); mimeType = StringUtil.getMimeType(FilenameUtils.getExtension(file.getName()));
} }
return Pair.of(is, mimeType); return Pair.of(is, mimeType);

@ -47,7 +47,7 @@ import java.util.Map;
*/ */
@Controller @Controller
@RequestMapping("/editTags") @RequestMapping("/editTags")
public class EditTagsController { public class EditTagsController {
@Autowired @Autowired
private MetaDataParserFactory metaDataParserFactory; private MetaDataParserFactory metaDataParserFactory;

@ -40,7 +40,7 @@ import java.util.Locale;
*/ */
@Controller @Controller
@RequestMapping("/generalSettings") @RequestMapping("/generalSettings")
public class GeneralSettingsController { public class GeneralSettingsController {
@Autowired @Autowired
private SettingsService settingsService; private SettingsService settingsService;

@ -42,7 +42,7 @@ import static org.springframework.web.bind.ServletRequestUtils.getStringParamete
*/ */
@Controller @Controller
@RequestMapping("/home") @RequestMapping("/home")
public class HomeController { public class HomeController {
private static final int LIST_SIZE = 40; private static final int LIST_SIZE = 40;

@ -45,7 +45,7 @@ import java.util.*;
*/ */
@Controller @Controller
@RequestMapping("/left") @RequestMapping("/left")
public class LeftController { public class LeftController {
// Update this time if you want to force a refresh in clients. // Update this time if you want to force a refresh in clients.
private static final Calendar LAST_COMPATIBILITY_TIME = Calendar.getInstance(); private static final Calendar LAST_COMPATIBILITY_TIME = Calendar.getInstance();

@ -46,7 +46,7 @@ import java.util.List;
*/ */
@Controller @Controller
@RequestMapping("/play.m3u") @RequestMapping("/play.m3u")
public class M3UController { public class M3UController {
@Autowired @Autowired
private PlayerService playerService; private PlayerService playerService;
@ -89,7 +89,7 @@ public class M3UController {
} }
out.println("#EXTINF:" + duration + "," + mediaFile.getArtist() + " - " + mediaFile.getTitle()); out.println("#EXTINF:" + duration + "," + mediaFile.getArtist() + " - " + mediaFile.getTitle());
String urlNoAuth = url + "player=" + player.getId() + "&id=" + mediaFile.getId() + "&suffix=." + String urlNoAuth = url + "player=" + player.getId() + "&id=" + mediaFile.getId() + "&suffix=." +
transcodingService.getSuffix(player, mediaFile, null); transcodingService.getSuffix(player, mediaFile, null);
String urlWithAuth = jwtSecurityService.addJWTToken(urlNoAuth); String urlWithAuth = jwtSecurityService.addJWTToken(urlNoAuth);
out.println(urlWithAuth); out.println(urlWithAuth);

@ -44,7 +44,7 @@ import java.util.stream.Collectors;
*/ */
@Controller @Controller
@RequestMapping("/main") @RequestMapping("/main")
public class MainController { public class MainController {
@Autowired @Autowired
private SecurityService securityService; private SecurityService securityService;

@ -48,7 +48,7 @@ import java.util.Map;
*/ */
@Controller @Controller
@RequestMapping("/more") @RequestMapping("/more")
public class MoreController { public class MoreController {
@Autowired @Autowired
private SettingsService settingsService; private SettingsService settingsService;

@ -45,7 +45,7 @@ import java.util.Locale;
*/ */
@Controller @Controller
@RequestMapping("/personalSettings") @RequestMapping("/personalSettings")
public class PersonalSettingsController { public class PersonalSettingsController {
@Autowired @Autowired
private SettingsService settingsService; private SettingsService settingsService;

@ -49,7 +49,7 @@ import java.util.List;
*/ */
@Controller @Controller
@RequestMapping("/playerSettings") @RequestMapping("/playerSettings")
public class PlayerSettingsController { public class PlayerSettingsController {
@Autowired @Autowired
private PlayerService playerService; private PlayerService playerService;

@ -45,7 +45,7 @@ import java.util.*;
*/ */
@Controller @Controller
@RequestMapping("/podcast") @RequestMapping("/podcast")
public class PodcastController { public class PodcastController {
private static final DateFormat RSS_DATE_FORMAT = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.US); private static final DateFormat RSS_DATE_FORMAT = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.US);
@Autowired @Autowired

@ -46,7 +46,7 @@ import static org.springframework.http.HttpStatus.OK;
*/ */
@Controller @Controller
@RequestMapping("/proxy") @RequestMapping("/proxy")
public class ProxyController { public class ProxyController {
@GetMapping @GetMapping
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {

@ -41,7 +41,7 @@ import java.util.Map;
*/ */
@Controller @Controller
@RequestMapping("/right") @RequestMapping("/right")
public class RightController { public class RightController {
@Autowired @Autowired
private SettingsService settingsService; private SettingsService settingsService;

@ -37,7 +37,7 @@ import javax.servlet.http.HttpServletRequest;
*/ */
@Controller @Controller
@RequestMapping("/settings") @RequestMapping("/settings")
public class SettingsController { public class SettingsController {
@Autowired @Autowired
private SecurityService securityService; private SecurityService securityService;

@ -44,7 +44,7 @@ import java.util.*;
*/ */
@Controller @Controller
@RequestMapping("/createShare") @RequestMapping("/createShare")
public class ShareManagementController { public class ShareManagementController {
@Autowired @Autowired
private MediaFileService mediaFileService; private MediaFileService mediaFileService;

@ -60,7 +60,7 @@ public class AbstractDao {
} }
protected String questionMarks(String columns) { protected String questionMarks(String columns) {
int numberOfColumns = StringUtils.countMatches(columns, ",") + 1; int numberOfColumns = StringUtils.countMatches(columns, ",") + 1;
return StringUtils.repeat("?", ", ", numberOfColumns); return StringUtils.repeat("?", ", ", numberOfColumns);
} }

@ -74,7 +74,7 @@ public class MediaFileComparator implements Comparator<MediaFile> {
return a.getPath().compareToIgnoreCase(b.getPath()); return a.getPath().compareToIgnoreCase(b.getPath());
} }
private <T extends Comparable<T>> int nullSafeCompare(T a, T b, boolean nullIsSmaller) { private <T extends Comparable<T>> int nullSafeCompare(T a, T b, boolean nullIsSmaller) {
if (a == null && b == null) { if (a == null && b == null) {
return 0; return 0;
} }

@ -99,7 +99,7 @@ public class MetricsManager {
public Timer timer(Class clazz, String name) { public Timer timer(Class clazz, String name) {
com.codahale.metrics.Timer t = metrics.timer(MetricRegistry.name(clazz,name)); com.codahale.metrics.Timer t = metrics.timer(MetricRegistry.name(clazz,name));
com.codahale.metrics.Timer.Context tContext = t.time(); com.codahale.metrics.Timer.Context tContext = t.time();
return new Timer(tContext); return new Timer(tContext);
} }
@ -143,7 +143,7 @@ public class MetricsManager {
} }
@Override @Override
public void close() { public void close() {
// Does nothing // Does nothing
} }
} }

@ -53,7 +53,7 @@ public class NetworkService {
} }
String baseUrl = uri.toString() + "/"; String baseUrl = uri.toString() + "/";
LOG.debug("Calculated base url to " + baseUrl); LOG.debug("Calculated base url to " + baseUrl);
return baseUrl; return baseUrl;
} catch (MalformedURLException | URISyntaxException e) { } catch (MalformedURLException | URISyntaxException e) {
throw new RuntimeException("Could not calculate base url: " + e.getMessage()); throw new RuntimeException("Could not calculate base url: " + e.getMessage());

@ -97,7 +97,7 @@ public class DocumentFactory {
doc.add(new StoredField(field, value, TYPE_KEY)); doc.add(new StoredField(field, value, TYPE_KEY));
}; };
private BiConsumer<@NonNull Document, @NonNull String> fieldMediatype = (doc, value) -> private BiConsumer<@NonNull Document, @NonNull String> fieldMediatype = (doc, value) ->
fieldKey.accept(doc, FieldNames.MEDIA_TYPE, value); fieldKey.accept(doc, FieldNames.MEDIA_TYPE, value);
private BiConsumer<@NonNull Document, @NonNull String> fieldFolderPath = (doc, value) -> private BiConsumer<@NonNull Document, @NonNull String> fieldFolderPath = (doc, value) ->

@ -44,9 +44,9 @@ public class SearchServiceImpl implements SearchService {
private static final Logger LOG = LoggerFactory.getLogger(SearchServiceImpl.class); private static final Logger LOG = LoggerFactory.getLogger(SearchServiceImpl.class);
@Autowired @Autowired
private QueryFactory queryFactory; private QueryFactory queryFactory;
@Autowired @Autowired
private IndexManager indexManager; private IndexManager indexManager;
@Autowired @Autowired
private SearchServiceUtilities util; private SearchServiceUtilities util;

@ -117,7 +117,7 @@ public class AlbumUpnpProcessor extends UpnpContentProcessor <Album, MediaFile>
List<Album> albumList = null; List<Album> albumList = null;
if (album.getComment().startsWith(ALL_BY_ARTIST)) { if (album.getComment().startsWith(ALL_BY_ARTIST)) {
ArtistUpnpProcessor ap = getDispatcher().getArtistProcessor(); ArtistUpnpProcessor ap = getDispatcher().getArtistProcessor();
albumList = ap.getChildren(ap.getItemById(album.getComment().replaceAll(ALL_BY_ARTIST + "_", ""))); albumList = ap.getChildren(ap.getItemById(album.getComment().replaceAll(ALL_BY_ARTIST + "_", "")));
} else if (album.getComment().equalsIgnoreCase(ALL_RECENT)) { } else if (album.getComment().equalsIgnoreCase(ALL_RECENT)) {
albumList = getDispatcher().getRecentAlbumProcessor().getAllItems(); albumList = getDispatcher().getRecentAlbumProcessor().getAllItems();
} else { } else {

@ -73,7 +73,7 @@ public class ArtistUpnpProcessor extends UpnpContentProcessor <Artist, Album> {
return getArtistDao().getArtist(Integer.parseInt(id)); return getArtistDao().getArtist(Integer.parseInt(id));
} }
public List<Album> getChildren(Artist artist) { public List<Album> getChildren(Artist artist) {
List<MusicFolder> allFolders = getDispatcher().getSettingsService().getAllMusicFolders(); List<MusicFolder> allFolders = getDispatcher().getSettingsService().getAllMusicFolders();
List<Album> allAlbums = getAlbumProcessor().getAlbumDao().getAlbumsForArtist(artist.getName(), allFolders); List<Album> allAlbums = getAlbumProcessor().getAlbumDao().getAlbumsForArtist(artist.getName(), allFolders);
if (allAlbums.size() > 1) { if (allAlbums.size() > 1) {

@ -93,7 +93,7 @@ public class GenreUpnpProcessor extends UpnpContentProcessor <Genre, MediaFile>
return null; return null;
} }
public List<MediaFile> getChildren(Genre item) { public List<MediaFile> getChildren(Genre item) {
List<MusicFolder> allFolders = getDispatcher().getSettingsService().getAllMusicFolders(); List<MusicFolder> allFolders = getDispatcher().getSettingsService().getAllMusicFolders();
return getDispatcher().getMediaFileProcessor().getMediaFileDao().getSongsByGenre(item.getName(), 0, Integer.MAX_VALUE, allFolders); return getDispatcher().getMediaFileProcessor().getMediaFileDao().getSongsByGenre(item.getName(), 0, Integer.MAX_VALUE, allFolders);
} }

@ -125,7 +125,7 @@ public abstract class UpnpContentProcessor<T extends Object, U extends Object> {
SortCriterion[] orderBy) { SortCriterion[] orderBy) {
DIDLContent didl = new DIDLContent(); DIDLContent didl = new DIDLContent();
Class clazz = (Class) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0]; Class clazz = (Class) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
try { try {
List<MusicFolder> allFolders = getDispatchingContentDirectory().getSettingsService().getAllMusicFolders(); List<MusicFolder> allFolders = getDispatchingContentDirectory().getSettingsService().getAllMusicFolders();

@ -38,7 +38,7 @@ public class RegisterPrecompiledJSPInitializer implements ServletContextInitiali
private static void registerPrecompiledJSPs(ServletContext servletContext) { private static void registerPrecompiledJSPs(ServletContext servletContext) {
WebApp webApp = parseXmlFragment(); WebApp webApp = parseXmlFragment();
for (ServletDef def : webApp.getServletDefs()) { for (ServletDef def : webApp.getServletDefs()) {
LOG.trace("Registering precompiled JSP: {} -> {}", def.getName(), def.getSclass()); LOG.trace("Registering precompiled JSP: {} -> {}", def.getName(), def.getSclass());
ServletRegistration.Dynamic reg = servletContext.addServlet(def.getName(), def.getSclass()); ServletRegistration.Dynamic reg = servletContext.addServlet(def.getName(), def.getSclass());
// Need to set loadOnStartup somewhere between 0 and 128. 0 is highest priority. 99 should be fine // Need to set loadOnStartup somewhere between 0 and 128. 0 is highest priority. 99 should be fine

@ -6,7 +6,7 @@ import java.util.Properties;
import java.util.SortedMap; import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
public class MissingTranslations { public class MissingTranslations {
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
String[] locales = {"da", "de", "es", "pt", "fi", "fr", "is", "it", "ja_JP", "mk", "nl", "no", "pl", "ru", "sl", "sv", "zh_CN", "zh_TW"}; String[] locales = {"da", "de", "es", "pt", "fi", "fr", "is", "it", "ja_JP", "mk", "nl", "no", "pl", "ru", "sl", "sv", "zh_CN", "zh_TW"};

@ -31,7 +31,7 @@ public class VersionTestCase extends TestCase {
/** /**
* Tests that equals(), hashCode(), toString() and compareTo() works. * Tests that equals(), hashCode(), toString() and compareTo() works.
*/ */
public void testVersion() { public void testVersion() {
doTestVersion("0.0", "0.1"); doTestVersion("0.0", "0.1");
doTestVersion("1.5", "2.3"); doTestVersion("1.5", "2.3");
doTestVersion("2.3", "2.34"); doTestVersion("2.3", "2.34");

@ -69,7 +69,7 @@ public class QueryFactoryTestCase {
new MusicFolder(FID2, new File(PATH2), "music2", true, new java.util.Date()); new MusicFolder(FID2, new File(PATH2), "music2", true, new java.util.Date());
private static final List<MusicFolder> SINGLE_FOLDERS = Arrays.asList(MUSIC_FOLDER1); private static final List<MusicFolder> SINGLE_FOLDERS = Arrays.asList(MUSIC_FOLDER1);
private static final List<MusicFolder> MULTI_FOLDERS = Arrays.asList(MUSIC_FOLDER1, MUSIC_FOLDER2); private static final List<MusicFolder> MULTI_FOLDERS = Arrays.asList(MUSIC_FOLDER1, MUSIC_FOLDER2);
/* /*

@ -21,7 +21,7 @@ public class PasswordSettingsValidatorTestCase extends TestCase {
PasswordSettingsValidator psv = new PasswordSettingsValidator(); PasswordSettingsValidator psv = new PasswordSettingsValidator();
Errors errors = new BeanPropertyBindingResult(psc, "psv"); Errors errors = new BeanPropertyBindingResult(psc, "psv");
psv.validate(psc, errors); psv.validate(psc, errors);
return errors; return errors;
} }
public void testValidateEmptyPassword() { public void testValidateEmptyPassword() {

@ -57,6 +57,7 @@
<module name="RequireThis"/> <module name="RequireThis"/>
<module name="SimplifyBooleanExpression"/> <module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/> <module name="SimplifyBooleanReturn"/>
<module name="SingleSpaceSeparator"/>
<module name="StringLiteralEquality"/> <module name="StringLiteralEquality"/>
<module name="SuperClone"/> <module name="SuperClone"/>
<module name="SuperFinalize"/> <module name="SuperFinalize"/>

Loading…
Cancel
Save