logic: fix update of Java indexer to new version of Java dependencies

* reapplied previous reverts
* added cache for TypeSolvers in Java code
This commit is contained in:
malte_langkabel
2017-05-10 17:54:21 +02:00
parent f9a6c1ac09
commit 8a92453d60
39 changed files with 231 additions and 70 deletions
+17 -1
View File
@@ -26,7 +26,7 @@ std::string JavaParser::prepareJavaEnvironment()
const std::string separator = ":";
#endif
JavaEnvironmentFactory::createInstance(
ResourcePaths::getJavaPath().str() + "guava-18.0.jar" + separator +
ResourcePaths::getJavaPath().str() + "guava-21.0.jar" + separator +
ResourcePaths::getJavaPath().str() + "java-indexer.jar" + separator +
ResourcePaths::getJavaPath().str() + "javaparser-core.jar" + separator +
ResourcePaths::getJavaPath().str() + "javaslang-2.0.3.jar" + separator +
@@ -41,6 +41,22 @@ std::string JavaParser::prepareJavaEnvironment()
return errorString;
}
void JavaParser::clearCaches()
{
std::shared_ptr<JavaEnvironmentFactory> factory = JavaEnvironmentFactory::getInstance();
if (factory)
{
std::shared_ptr<JavaEnvironment> environment = factory->createEnvironment();
if (environment)
{
environment->callStaticVoidMethod(
"com/sourcetrail/JavaIndexer",
"clearCaches"
);
}
}
}
JavaParser::JavaParser(std::shared_ptr<ParserClient> client, std::shared_ptr<FileRegister> fileRegister)
: Parser(client)
, m_id(s_nextParserId++)