Skip to content

Commit f9003bd

Browse files
authored
use HistoryGuru#getLastHistoryEntry() in AnalyzerGuru (#4282)
fixes #4281
1 parent 0d0e73c commit f9003bd

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/AnalyzerGuru.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
import org.opengrok.indexer.configuration.Project;
113113
import org.opengrok.indexer.configuration.RuntimeEnvironment;
114114
import org.opengrok.indexer.history.Annotation;
115-
import org.opengrok.indexer.history.History;
116115
import org.opengrok.indexer.history.HistoryEntry;
117116
import org.opengrok.indexer.history.HistoryException;
118117
import org.opengrok.indexer.history.HistoryGuru;
@@ -637,13 +636,9 @@ private static void populateDocumentHistory(Document doc, File file) {
637636
HistoryReader hr = histGuru.getHistoryReader(file);
638637
if (hr != null) {
639638
doc.add(new TextField(QueryBuilder.HIST, hr));
640-
History history;
641-
if ((history = histGuru.getHistory(file)) != null) {
642-
List<HistoryEntry> historyEntries = history.getHistoryEntries(1, 0);
643-
if (!historyEntries.isEmpty()) {
644-
HistoryEntry histEntry = historyEntries.get(0);
645-
doc.add(new TextField(QueryBuilder.LASTREV, histEntry.getRevision(), Store.YES));
646-
}
639+
HistoryEntry histEntry = histGuru.getLastHistoryEntry(file, false, true);
640+
if (histEntry != null) {
641+
doc.add(new TextField(QueryBuilder.LASTREV, histEntry.getRevision(), Store.YES));
647642
}
648643
}
649644
} catch (HistoryException e) {

0 commit comments

Comments
 (0)