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:
@@ -4,11 +4,10 @@
|
||||
#include <memory>
|
||||
|
||||
#include "data/indexer/IndexerBase.h"
|
||||
#include "data/parser/ParserClientImpl.h"
|
||||
#include "utility/file/FileRegister.h"
|
||||
#include "data/indexer/IndexerCommand.h"
|
||||
#include "utility/logging/logging.h"
|
||||
|
||||
template <typename IndexerCommandType, typename ParserType>
|
||||
template <typename IndexerCommandType>
|
||||
class Indexer
|
||||
: public IndexerBase
|
||||
{
|
||||
@@ -20,21 +19,25 @@ public:
|
||||
virtual std::shared_ptr<IntermediateStorage> index(
|
||||
std::shared_ptr<IndexerCommand> indexerCommand,
|
||||
std::shared_ptr<FileRegister> fileRegister);
|
||||
|
||||
virtual std::shared_ptr<IntermediateStorage> doIndex(
|
||||
std::shared_ptr<IndexerCommandType> indexerCommand,
|
||||
std::shared_ptr<FileRegister> fileRegister) = 0;
|
||||
};
|
||||
|
||||
template <typename IndexerCommandType, typename ParserType>
|
||||
Indexer<IndexerCommandType, ParserType>::~Indexer()
|
||||
template <typename IndexerCommandType>
|
||||
Indexer<IndexerCommandType>::~Indexer()
|
||||
{
|
||||
}
|
||||
|
||||
template <typename IndexerCommandType, typename ParserType>
|
||||
std::string Indexer<IndexerCommandType, ParserType>::getKindString() const
|
||||
template <typename IndexerCommandType>
|
||||
std::string Indexer<IndexerCommandType>::getKindString() const
|
||||
{
|
||||
return IndexerCommandType::getIndexerKindString();
|
||||
}
|
||||
|
||||
template <typename IndexerCommandType, typename ParserType>
|
||||
std::shared_ptr<IntermediateStorage> Indexer<IndexerCommandType, ParserType>::index(
|
||||
template <typename IndexerCommandType>
|
||||
std::shared_ptr<IntermediateStorage> Indexer<IndexerCommandType>::index(
|
||||
std::shared_ptr<IndexerCommand> indexerCommand, std::shared_ptr<FileRegister> fileRegister)
|
||||
{
|
||||
std::shared_ptr<IndexerCommandType> castedCommand = std::dynamic_pointer_cast<IndexerCommandType>(indexerCommand);
|
||||
@@ -46,33 +49,7 @@ std::shared_ptr<IntermediateStorage> Indexer<IndexerCommandType, ParserType>::in
|
||||
return std::shared_ptr<IntermediateStorage>();
|
||||
}
|
||||
|
||||
std::shared_ptr<ParserClientImpl> parserClient = std::make_shared<ParserClientImpl>();
|
||||
|
||||
std::shared_ptr<ParserType> parser = std::make_shared<ParserType>(parserClient, fileRegister);
|
||||
|
||||
std::shared_ptr<IntermediateStorage> storage = std::make_shared<IntermediateStorage>();
|
||||
parserClient->setStorage(storage);
|
||||
|
||||
parser->buildIndex(castedCommand);
|
||||
|
||||
parserClient->resetStorage();
|
||||
|
||||
if (parserClient->hasFatalErrors() || indexerCommand->preprocessorOnly())
|
||||
{
|
||||
storage->setAllFilesIncomplete();
|
||||
}
|
||||
else
|
||||
{
|
||||
storage->setFilesWithErrorsIncomplete();
|
||||
fileRegister->markIndexingFilesIndexed();
|
||||
}
|
||||
|
||||
if (interrupted())
|
||||
{
|
||||
return std::shared_ptr<IntermediateStorage>();
|
||||
}
|
||||
|
||||
return storage;
|
||||
return doIndex(castedCommand, fileRegister);
|
||||
}
|
||||
|
||||
#endif // INDEXER_H
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
#define INDEXER_BASE_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "data/indexer/IndexerCommand.h"
|
||||
#include "data/IntermediateStorage.h"
|
||||
#include <string>
|
||||
|
||||
class FileRegister;
|
||||
class IndexerCommand;
|
||||
class IntermediateStorage;
|
||||
|
||||
class IndexerBase
|
||||
{
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include "data/indexer/IndexerComposite.h"
|
||||
|
||||
#include "data/indexer/IndexerCommand.h"
|
||||
#include "utility/logging/logging.h"
|
||||
#include "data/IntermediateStorage.h"
|
||||
|
||||
IndexerComposite::~IndexerComposite()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user