Skip to content

Commit 187033b

Browse files
author
Dennis Labordus
committed
Fixed sonar code smells.
Signed-off-by: Dennis Labordus <[email protected]>
1 parent c972808 commit 187033b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

riseclipse/validator-riseclipse/src/main/java/org/lfenergy/compas/scl/validator/collector/AbstractFileCollector.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import java.util.Collections;
1616
import java.util.List;
1717
import java.util.function.Predicate;
18-
import java.util.stream.Collectors;
1918

2019
import static org.lfenergy.compas.scl.validator.exception.SclValidatorErrorCode.LOADING_CUSTOM_OCL_FILES_FAILED;
2120
import static org.lfenergy.compas.scl.validator.exception.SclValidatorErrorCode.LOADING_OCL_FILES_FAILED;
@@ -54,7 +53,7 @@ protected List<URI> getDefaultOclFilesFromClasspath() {
5453
try (var walk = Files.walk(oclDirectoryPath)) {
5554
return walk.filter(filter)
5655
.map(path -> URI.createURI(path.toUri().toString()))
57-
.collect(Collectors.toList());
56+
.toList();
5857
}
5958
}
6059
} else {
@@ -64,7 +63,7 @@ protected List<URI> getDefaultOclFilesFromClasspath() {
6463
.map(Path::toFile)
6564
.filter(File::isFile)
6665
.map(file -> URI.createFileURI(file.getAbsolutePath()))
67-
.collect(Collectors.toList());
66+
.toList();
6867
}
6968
}
7069
} else {
@@ -93,7 +92,7 @@ protected List<URI> getFilesFromDirectory(String directoryName, Predicate<Path>
9392
.map(Path::toFile)
9493
.filter(File::isFile)
9594
.map(file -> URI.createFileURI(file.getAbsolutePath()))
96-
.collect(Collectors.toList());
95+
.toList();
9796
}
9897
}
9998
return Collections.emptyList();

service/src/main/java/org/lfenergy/compas/scl/validator/common/NsdocFinder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public Collection<NsdocFile> getNsdocFiles() {
7676
return nsdocFiles.values()
7777
.stream()
7878
.sorted(Comparator.comparing(NsdocFile::getNsdocId))
79-
.collect(Collectors.toList());
79+
.toList();
8080
}
8181

8282
public String getNsdocFile(UUID id) {

0 commit comments

Comments
 (0)