use of jadx.gui.utils.search.TextSearchIndex in project jadx by skylot.
the class BackgroundWorker method doInBackground.
@Override
protected Void doInBackground() throws Exception {
try {
System.gc();
LOG.debug("Memory usage: Before decompile: {}", Utils.memoryInfo());
runJob(cache.getDecompileJob());
LOG.debug("Memory usage: Before index: {}", Utils.memoryInfo());
runJob(cache.getIndexJob());
LOG.debug("Memory usage: After index: {}", Utils.memoryInfo());
System.gc();
LOG.debug("Memory usage: After gc: {}", Utils.memoryInfo());
TextSearchIndex searchIndex = cache.getTextIndex();
if (searchIndex != null && searchIndex.getSkippedCount() > 0) {
LOG.warn("Indexing of some classes skipped, count: {}, low memory: {}", searchIndex.getSkippedCount(), Utils.memoryInfo());
}
} catch (Exception e) {
LOG.error("Exception in background worker", e);
}
return null;
}
use of jadx.gui.utils.search.TextSearchIndex in project jadx by skylot.
the class IndexService method remove.
public synchronized void remove(JavaClass cls) {
TextSearchIndex index = cache.getTextIndex();
if (index == null) {
return;
}
indexSet.remove(cls);
index.remove(cls);
}
use of jadx.gui.utils.search.TextSearchIndex in project jadx by skylot.
the class IndexService method indexCls.
/**
* Warning! Not ready for parallel execution. Use only in a single thread.
*/
public boolean indexCls(JavaClass cls) {
try {
TextSearchIndex index = cache.getTextIndex();
if (index == null) {
return false;
}
// get code from cache to avoid decompilation here
String code = getCodeFromCache(cls);
if (code == null) {
return cls.isNoCode();
}
List<StringRef> lines = splitLines(code);
CodeLinesInfo linesInfo = new CodeLinesInfo(cls);
index.indexCode(cls, linesInfo, lines);
index.indexNames(cls);
indexSet.add(cls);
return true;
} catch (Exception e) {
LOG.error("Index error in class: {}", cls.getFullName(), e);
return false;
}
}
use of jadx.gui.utils.search.TextSearchIndex in project jadx by skylot.
the class IndexService method indexResources.
public void indexResources() {
TextSearchIndex index = cache.getTextIndex();
index.indexResource();
}
use of jadx.gui.utils.search.TextSearchIndex in project jadx by skylot.
the class CommonSearchDialog method loadFinishedCommon.
void loadFinishedCommon() {
setCursor(null);
progressPane.setVisible(false);
TextSearchIndex textIndex = cache.getTextIndex();
if (textIndex == null) {
warnLabel.setText(NLS.str("msg.index_not_initialized"));
warnLabel.setVisible(true);
}
}
Aggregations