Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Prefer lambda over anonymous class.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 8 Jan 2020 13:35:30 +0000 (14:35 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 8 Jan 2020 13:35:30 +0000 (14:35 +0100)
examples/deprecated/java/io/storage/Client.java

index 3933722..49cbe14 100644 (file)
@@ -32,11 +32,7 @@ public class Client extends Process {
    // Retrieve all mount points of current host
     Storage[] storages = getHost().getMountedStorage();
 
-    Arrays.sort(storages, new Comparator<Storage>() {
-        public int compare(Storage a, Storage b) {
-          return a.getName().compareTo(b.getName());
-        }
-      });
+    Arrays.sort(storages, (Storage a, Storage b) -> a.getName().compareTo(b.getName()));
     for (int i = 0; i < storages.length; i++) {
       // For each disk mounted on host
       Msg.info("------------------------------------");