Skip to content

Commit e5f5fa5

Browse files
Rangeet PanRangeet Pan
authored andcommitted
changing toList to collect(Collectors.toList()) to support Java 11 as toList has been introduced in Java 16
1 parent 13178d5 commit e5f5fa5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/ibm/northstar/CodeAnalyzer.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.nio.file.Paths;
3737
import java.util.List;
3838
import java.util.Map;
39+
import java.util.stream.Collectors;
3940

4041
/**
4142
* The type Code analyzer.
@@ -129,8 +130,10 @@ private static void analyze() throws IOException, ClassHierarchyException, CallG
129130
analysisLevel = 1;
130131
}
131132

133+
// Previous code was pointing to toList, which has been introduced in Java 16
134+
// symbolTable = SymbolTable.extract(Paths.get(input), targetFiles.stream().map(Paths::get).toList()).getLeft();
132135
// extract symbol table for the specified files
133-
symbolTable = SymbolTable.extract(Paths.get(input), targetFiles.stream().map(Paths::get).toList()).getLeft();
136+
symbolTable = SymbolTable.extract(Paths.get(input), targetFiles.stream().map(Paths::get).collect(Collectors.toList())).getLeft();
134137

135138
// if analysis file exists, update it with new symbol table information for the specified fiels
136139
if (analysisFileExists) {

0 commit comments

Comments
 (0)