[
https://issues.apache.org/jira/browse/MINDEXER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17965431#comment-17965431
]
Olivier Lamy commented on MINDEXER-157:
---------------------------------------
This project has moved from Jira to GitHub Issues. This issue was migrated to
[apache/maven-indexer#683|https://github.com/apache/maven-indexer/issues/683].
> After import all groups and root groups are inverted in the IndexingContext
> ---------------------------------------------------------------------------
>
> Key: MINDEXER-157
> URL: https://issues.apache.org/jira/browse/MINDEXER-157
> Project: Maven Indexer (Moved to GitHub Issues)
> Issue Type: Bug
> Reporter: Matthias Bläsing
> Assignee: Tamas Cservenak
> Priority: Major
> Fix For: 6.2.1
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> I investigated a regression introduced into the NetBeans codebase by the
> update of maven indexer to 6.2.0
> ([https://github.com/apache/netbeans/issues/4102)] It turned out, that maven
> indexer after loading the index needs to explicitly rebuild the group lists
> as they are not stored with the index any longer. Rebuilding on demand is not
> an option for us, so a solution using a cached version was tried.
> The idea is, that after the index is updated, the current group lists will be
> dumped into cache files and when the index is loaded from scratch, that cache
> is used to initialize all groups and root groups. This seemed to work ok, but
> the results were strange - only the root groups were returned. Debugging
> showed, that the all groups list was very short (~950 groups for maven
> central) while the root groups list was very long (~66.000 groups for maven
> central). The opposite ratio was expected.
> The issue can be traced into _DefaultIndexUpdater#loadIndexDirectory_ where
> _IndexingContext#replace_ is called with the with the wrong order or
> parameters. The declared method:
> {code:java}
> public interface IndexingContext {
> void replace( Directory directory, Set<String> allGroups, Set<String>
> rootGroups ) throws IOException;
> }{code}
> is called as:
> {code:java}
> private Date loadIndexDirectory( final IndexUpdateRequest updateRequest,
> final ResourceFetcher fetcher,
> final boolean merge, final String
> remoteIndexFile )
> throws IOException
> {
> // ...
> updateRequest.getIndexingContext().replace( directory,
> rootGroups, allGroups );
> // ...
> }
> {code}
> The last two parameters need to be reversed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)