Inline some variables

There is no point in `Type a = …; return a;`
master
jvoisin 6 years ago
parent e0ac46cf44
commit def5f854fb
  1. 3
      airsonic-main/src/main/java/org/airsonic/player/domain/TransferStatus.java
  2. 3
      airsonic-main/src/main/java/org/airsonic/player/service/playlist/XspfPlaylistExportHandler.java
  3. 3
      airsonic-main/src/main/java/org/airsonic/player/service/upnp/PlaylistUpnpProcessor.java
  4. 6
      airsonic-main/src/test/java/org/airsonic/player/TestCaseUtils.java
  5. 3
      airsonic-main/src/test/java/org/airsonic/player/dao/MusicFolderTestData.java

@ -281,9 +281,8 @@ public class TransferStatus {
@Override @Override
public String toString() { public String toString() {
String builder = "TransferStatus-" + hashCode() + " [player: " + player.getId() + ", file: " + return "TransferStatus-" + hashCode() + " [player: " + player.getId() + ", file: " +
file + ", terminated: " + terminated + ", active: " + active + "]"; file + ", terminated: " + terminated + ", active: " + active + "]";
return builder;
} }
/** /**

@ -31,8 +31,7 @@ public class XspfPlaylistExportHandler implements PlaylistExportHandler {
@Override @Override
public SpecificPlaylist handle(int id, SpecificPlaylistProvider provider) throws Exception { public SpecificPlaylist handle(int id, SpecificPlaylistProvider provider) throws Exception {
chameleon.playlist.xspf.Playlist playlist = createXsfpPlaylistFromDBId(id); return createXsfpPlaylistFromDBId(id);
return playlist;
} }
chameleon.playlist.xspf.Playlist createXsfpPlaylistFromDBId(int id) { chameleon.playlist.xspf.Playlist createXsfpPlaylistFromDBId(int id) {

@ -56,8 +56,7 @@ public class PlaylistUpnpProcessor extends UpnpContentProcessor <Playlist, Media
} }
public List<Playlist> getAllItems() { public List<Playlist> getAllItems() {
List<Playlist> playlists = getPlaylistService().getAllPlaylists(); return getPlaylistService().getAllPlaylists();
return playlists;
} }
public Playlist getItemById(String id) throws Exception { public Playlist getItemById(String id) throws Exception {

@ -79,11 +79,9 @@ public class TestCaseUtils {
"from information_schema.system_tables " + "from information_schema.system_tables " +
"where table_name not like 'SYSTEM%'" "where table_name not like 'SYSTEM%'"
, String.class); , String.class);
Map<String, Integer> nbRecords =
tableNames.stream()
.collect(Collectors.toMap(table -> table, table -> recordsInTable(table,daoHelper)));
return nbRecords; return tableNames.stream()
.collect(Collectors.toMap(table -> table, table -> recordsInTable(table,daoHelper)));
} }
/** /**

@ -12,8 +12,7 @@ public class MusicFolderTestData {
private static String baseResources = "/MEDIAS/"; private static String baseResources = "/MEDIAS/";
public static String resolveBaseMediaPath() { public static String resolveBaseMediaPath() {
String baseDir = MusicFolderTestData.class.getResource(baseResources).toString().replace("file:",""); return MusicFolderTestData.class.getResource(baseResources).toString().replace("file:","");
return baseDir;
} }
public static String resolveMusicFolderPath() { public static String resolveMusicFolderPath() {

Loading…
Cancel
Save