data: update Java dependencies to add support for Java 13, 14 and 15 (#1152)

* updated java indexer dependencies
* replaced old gradle tooling jar that is shipped with Sourcetrail because it is not working for new JRE versions anymore
* fixed crash in Java indexer
* added language standard sleection for Java 13, 14 and 15
* fixed console logging for recent jdk versions
This commit is contained in:
Malte Langkabel
2021-02-25 18:28:17 +01:00
committed by GitHub
parent 7cb232af86
commit 220ac82681
40 changed files with 84 additions and 62 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+35 -35
View File
@@ -28,12 +28,12 @@
<repository>
<id>mvnrepository</id>
<name>mvnrepository</name>
<url>http://www.mvnrepository.com</url>
<url>https://www.mvnrepository.com</url>
</repository>
<repository>
<id>repo_gradle</id>
<name>repo_gradle</name>
<url>http://repo.gradle.org/gradle/libs-releases-local</url>
<url>https://repo.gradle.org/gradle/libs-releases-local</url>
</repository>
</repositories>
@@ -41,121 +41,121 @@
<dependency>
<groupId>org.gradle</groupId>
<artifactId>gradle-tooling-api</artifactId>
<version>4.2</version>
<version>6.7.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/gradle-tooling-api-4.2.jar</systemPath>
<systemPath>${basedir}/lib/gradle-tooling-api-6.7.1.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.commands</artifactId>
<version>3.9.500</version>
<version>3.9.800</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.core.commands-3.9.500.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.core.commands-3.9.800.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.contenttype</artifactId>
<version>3.7.400</version>
<version>3.7.800</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.core.contenttype-3.7.400.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.core.contenttype-3.7.800.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.expressions</artifactId>
<version>3.6.500</version>
<version>3.7.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.core.expressions-3.6.500.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.core.expressions-3.7.0.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.filesystem</artifactId>
<version>1.7.500</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.core.filesystem-1.7.500.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.core.filesystem-1.7.700.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.jobs</artifactId>
<version>3.10.500</version>
<version>3.10.1000</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.core.jobs-3.10.500.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.core.jobs-3.10.1000.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.resources</artifactId>
<version>3.13.500</version>
<version>3.13.900</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.core.resources-3.13.500.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.core.resources-3.13.900.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.runtime</artifactId>
<version>3.16.0</version>
<version>3.20.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.core.runtime-3.16.0.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.core.runtime-3.20.0.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.app</artifactId>
<version>1.4.300</version>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.equinox.app-1.4.300.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.equinox.app-1.5.0.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
<version>3.10.500</version>
<version>3.14.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.equinox.common-3.10.500.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.equinox.common-3.14.0.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.preferences</artifactId>
<version>3.7.500</version>
<version>3.8.100</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.equinox.preferences-3.7.500.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.equinox.preferences-3.8.100.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.registry</artifactId>
<version>3.8.500</version>
<version>3.10.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.equinox.registry-3.8.500.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.equinox.registry-3.10.0.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<version>3.19.0</version>
<version>3.24.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.jdt.core-3.19.0.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.jdt.core-3.24.0.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>org.eclipse.osgi</artifactId>
<version>3.15.0</version>
<version>3.16.100</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.osgi-3.15.0.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.osgi-3.16.100.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>org.eclipse.text</artifactId>
<version>3.9.0</version>
<version>3.10.400</version>
<scope>system</scope>
<systemPath>${basedir}/lib/org.eclipse.text-3.9.0.jar</systemPath>
<systemPath>${basedir}/lib/org.eclipse.text-3.10.400.jar</systemPath>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.10</version>
<version>1.7.28</version>
<scope>system</scope>
<systemPath>${basedir}/lib/slf4j-api-1.7.10.jar</systemPath>
<systemPath>${basedir}/lib/slf4j-api-1.7.28.jar</systemPath>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.10</version>
<version>1.7.30</version>
<scope>system</scope>
<systemPath>${basedir}/lib/slf4j-simple-1.7.10.jar</systemPath>
<systemPath>${basedir}/lib/slf4j-simple-1.7.30.jar</systemPath>
</dependency>
</dependencies>
</project>
@@ -410,7 +410,7 @@ public abstract class AstVisitor extends ASTVisitor
{
DeclName symbolName = DeclName.unsolved();
IBinding binding = node.resolveBinding();
if (!binding.isRecovered())
if (binding != null && !binding.isRecovered())
{
if (binding instanceof IPackageBinding)
{
@@ -58,7 +58,7 @@ public class JavaIndexer
Path path = Paths.get(filePath);
ASTParser parser = ASTParser.newParser(AST.JLS12);
ASTParser parser = ASTParser.newParser(AST.JLS_Latest);
parser.setResolveBindings(
true); // solve "bindings" like the declaration of the type used in a var decl
@@ -73,7 +73,7 @@ public class JavaIndexer
astVisitorClient.logInfo("using language standard " + convertedLanguageStandard);
Hashtable<String, String> options = JavaCore.getOptions();
options.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
options.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.DISABLED);
options.put(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
options.put(JavaCore.COMPILER_SOURCE, convertedLanguageStandard);
options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, convertedLanguageStandard);
@@ -164,7 +164,7 @@ public class JavaIndexer
{
String packageName = "";
ASTParser parser = ASTParser.newParser(AST.JLS12);
ASTParser parser = ASTParser.newParser(AST.JLS_Latest);
parser.setKind(
ASTParser.K_COMPILATION_UNIT); // specify to parse the entire compilation unit
parser.setSource(fileContent.toCharArray());
@@ -209,8 +209,14 @@ public class JavaIndexer
case "11":
return JavaCore.VERSION_11;
case "12":
default:
return JavaCore.VERSION_12;
case "13":
return JavaCore.VERSION_13;
case "14":
return JavaCore.VERSION_14;
case "15":
default:
return JavaCore.VERSION_15;
}
}
@@ -4,7 +4,7 @@
std::wstring SourceGroupSettingsWithJavaStandard::getDefaultJavaStandardStatic()
{
return L"12";
return L"15";
}
std::wstring SourceGroupSettingsWithJavaStandard::getJavaStandard() const
@@ -23,7 +23,22 @@ void SourceGroupSettingsWithJavaStandard::setJavaStandard(const std::wstring& st
std::vector<std::wstring> SourceGroupSettingsWithJavaStandard::getAvailableJavaStandards() const
{
return {L"12", L"11", L"10", L"9", L"8", L"7", L"6", L"5", L"4", L"3", L"2", L"1"};
return {
L"15",
L"14",
L"13",
L"12",
L"11",
L"10",
L"9",
L"8",
L"7",
L"6",
L"5",
L"4",
L"3",
L"2",
L"1"};
}
bool SourceGroupSettingsWithJavaStandard::equals(const SourceGroupSettingsBase* other) const
+3 -2
View File
@@ -2,6 +2,8 @@
#include <iostream>
#include "utilityString.h"
ConsoleLogger::ConsoleLogger(): Logger("ConsoleLogger") {}
void ConsoleLogger::logInfo(const LogMessage& message)
@@ -29,6 +31,5 @@ void ConsoleLogger::logMessage(const std::string& type, const LogMessage& messag
<< "() | ";
}
std::cout << type << ": ";
std::wcout << message.message << std::endl;
std::cout << type << ": " << utility::encodeToUtf8(message.message) << std::endl;
}
+17 -17
View File
@@ -18,24 +18,24 @@ namespace utility
std::vector<std::wstring> getRequiredJarNames()
{
return {
L"gradle-tooling-api-4.2.jar",
L"gradle-tooling-api-6.7.1.jar",
L"java-indexer.jar",
L"org.eclipse.core.commands-3.9.500.jar",
L"org.eclipse.core.contenttype-3.7.400.jar",
L"org.eclipse.core.expressions-3.6.500.jar",
L"org.eclipse.core.filesystem-1.7.500.jar",
L"org.eclipse.core.jobs-3.10.500.jar",
L"org.eclipse.core.resources-3.13.500.jar",
L"org.eclipse.core.runtime-3.16.0.jar",
L"org.eclipse.equinox.app-1.4.300.jar",
L"org.eclipse.equinox.common-3.10.500.jar",
L"org.eclipse.equinox.preferences-3.7.500.jar",
L"org.eclipse.equinox.registry-3.8.500.jar",
L"org.eclipse.jdt.core-3.19.0.jar",
L"org.eclipse.osgi-3.15.0.jar",
L"org.eclipse.text-3.9.0.jar",
L"slf4j-api-1.7.10.jar",
L"slf4j-simple-1.7.10.jar"};
L"org.eclipse.core.commands-3.9.800.jar",
L"org.eclipse.core.contenttype-3.7.800.jar",
L"org.eclipse.core.expressions-3.7.0.jar",
L"org.eclipse.core.filesystem-1.7.700.jar",
L"org.eclipse.core.jobs-3.10.1000.jar",
L"org.eclipse.core.resources-3.13.900.jar",
L"org.eclipse.core.runtime-3.20.0.jar",
L"org.eclipse.equinox.app-1.5.0.jar",
L"org.eclipse.equinox.common-3.14.0.jar",
L"org.eclipse.equinox.preferences-3.8.100.jar",
L"org.eclipse.equinox.registry-3.10.0.jar",
L"org.eclipse.jdt.core-3.24.0.jar",
L"org.eclipse.osgi-3.16.100.jar",
L"org.eclipse.text-3.10.400.jar",
L"slf4j-api-1.7.28.jar",
L"slf4j-simple-1.7.30.jar"};
}
std::string prepareJavaEnvironment()
+1 -1
View File
@@ -1655,7 +1655,7 @@ TEST_CASE("java parser finds bound type of type parameter")
client->typeUses, L"A<T>.T -> java.lang.Void <1:27 1:30>"));
}
TEST_CASE("java parsersupports java 12 switch expression")
TEST_CASE("java parsersupports java 14 switch expression")
{
std::shared_ptr<TestStorage> client = parseCode(
"package foo;\n"