mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
= code cleanup
- for loop replaceable with enhanced 'for' loop - using diamond in generic type - collapse try catch exception - using try-with-resource - using List#sort instead of Collections#sort - replaced lambda with method reference - using native compare method to compare numbers - using switch instead of if for in ESSyncUtil
This commit is contained in:
@@ -192,7 +192,7 @@ public class CanalAdminController implements CanalAdmin {
|
||||
Collection<File> files = org.apache.commons.io.FileUtils.listFiles(new File("../logs/canal/"),
|
||||
TrueFileFilter.TRUE,
|
||||
TrueFileFilter.TRUE);
|
||||
List<String> names = files.stream().map(f -> f.getName()).collect(Collectors.toList());
|
||||
List<String> names = files.stream().map(File::getName).collect(Collectors.toList());
|
||||
return Joiner.on(",").join(names);
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ public class CanalAdminController implements CanalAdmin {
|
||||
Collection<File> files = org.apache.commons.io.FileUtils.listFiles(new File("../logs/" + destination + "/"),
|
||||
TrueFileFilter.TRUE,
|
||||
TrueFileFilter.TRUE);
|
||||
List<String> names = files.stream().map(f -> f.getName()).collect(Collectors.toList());
|
||||
List<String> names = files.stream().map(File::getName).collect(Collectors.toList());
|
||||
return Joiner.on(",").join(names);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user