From e5f5fa5796f4a0e7173f6175184bf70870a21b62 Mon Sep 17 00:00:00 2001 From: Rangeet Pan Date: Mon, 23 Sep 2024 13:00:03 -0400 Subject: [PATCH] changing toList to collect(Collectors.toList()) to support Java 11 as toList has been introduced in Java 16 --- src/main/java/com/ibm/northstar/CodeAnalyzer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ibm/northstar/CodeAnalyzer.java b/src/main/java/com/ibm/northstar/CodeAnalyzer.java index b77036d5..10ecc6f8 100644 --- a/src/main/java/com/ibm/northstar/CodeAnalyzer.java +++ b/src/main/java/com/ibm/northstar/CodeAnalyzer.java @@ -36,6 +36,7 @@ import java.nio.file.Paths; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * The type Code analyzer. @@ -129,8 +130,10 @@ private static void analyze() throws IOException, ClassHierarchyException, CallG analysisLevel = 1; } + // Previous code was pointing to toList, which has been introduced in Java 16 + // symbolTable = SymbolTable.extract(Paths.get(input), targetFiles.stream().map(Paths::get).toList()).getLeft(); // extract symbol table for the specified files - symbolTable = SymbolTable.extract(Paths.get(input), targetFiles.stream().map(Paths::get).toList()).getLeft(); + symbolTable = SymbolTable.extract(Paths.get(input), targetFiles.stream().map(Paths::get).collect(Collectors.toList())).getLeft(); // if analysis file exists, update it with new symbol table information for the specified fiels if (analysisFileExists) {