Skip to content

Commit 7b7acb3

Browse files
committed
cleanup
Signed-off-by: Olivier Lamy <[email protected]>
1 parent 5f641bb commit 7b7acb3

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/main/java/org/eclipse/jetty/toolchain/modifysources/ModifyEE9ToEE8.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
import com.github.javaparser.JavaParser;
5-
import com.github.javaparser.ParseProblemException;
65
import com.github.javaparser.ParseResult;
76
import com.github.javaparser.ParserConfiguration;
87
import com.github.javaparser.ast.CompilationUnit;
@@ -45,12 +44,12 @@
4544

4645
import java.io.File;
4746
import java.io.IOException;
48-
import java.nio.file.FileVisitOption;
4947
import java.nio.file.Files;
5048
import java.nio.file.Path;
51-
import java.util.Arrays;
49+
import java.util.Collection;
5250
import java.util.Comparator;
5351
import java.util.List;
52+
import java.util.Set;
5453
import java.util.stream.Collectors;
5554

5655
/**
@@ -96,7 +95,7 @@ public class ModifyEE9ToEE8
9695
* this is a list of String to not translate if starting with
9796
*/
9897
@Parameter
99-
protected List<String> notTranslateStartsWith = Arrays.asList("https://jakarta.ee/xml/ns/", "http://jakarta.ee/xml/ns/");
98+
protected Set<String> notTranslateStartsWith = Set.of("https://jakarta.ee/xml/ns/", "http://jakarta.ee/xml/ns/");
10099

101100

102101
public void execute()
@@ -376,7 +375,7 @@ public Visitable visit(ClassOrInterfaceType n, Void arg) {
376375
File ee8Directory = new File(outputDirectory, "org/eclipse/jetty/ee8");
377376
FileUtils.moveDirectory(ee9Directory, ee8Directory);
378377
List<Path> pathsEndedJakarta = Files.walk(ee8Directory.toPath())
379-
.filter(path -> Files.isDirectory(path))
378+
.filter(Files::isDirectory)
380379
.filter(path -> path.getFileName().endsWith("jakarta"))
381380
.collect(Collectors.toList());
382381
pathsEndedJakarta.forEach(path -> {
@@ -447,8 +446,8 @@ public static String changeEE9TypeToEE8(String currentType) {
447446
return null;
448447
}
449448

450-
private boolean startsWith(String str, List<String> startList) {
451-
return startList.stream().filter(s -> str.startsWith(s)).findAny().isPresent();
449+
private boolean startsWith(String str, Collection<String> startList) {
450+
return startList.stream().anyMatch(str::startsWith);
452451
}
453452

454453
protected void setSourceProjectLocation(File sourceProjectLocation) {

0 commit comments

Comments
 (0)