[MINDEXER-225] Indexer-reader handles classNames differently to JarFileContentsIndexCreator
- Dominant language
- Java
- Stars
- 74
- Forks
- 69
- Avg merge
- 14h 8m
- Merged PRs (30d)
- 6
Description
**[Emeric Werner](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=JIRAUSER305687)** opened **[MINDEXER-225](https://issues.apache.org/jira/browse/MINDEXER-225?redirect=false)** and commented
The indexer-reader RecordCompactor and RecordExpander classes separate individual entries of the `classNames` entry using the field separator `|` (see https://github.com/apache/maven-indexer/blob/87627e0e797c1b3cc5bb5f007b94b0371b97f7e0/indexer-reader/src/main/java/org/apache/maven/index/reader/RecordExpander.java#L212 ). However, the JarFileContentsIndexCreator class in indexer-core uses newlines (`\n`) as a separator between classes as seen in https://github.com/apache/maven-indexer/blob/87627e0e797c1b3cc5bb5f007b94b0371b97f7e0/indexer-core/src/main/java/org/apache/maven/index/creator/JarFileContentsIndexCreator.java#L166 . The behaviour of indexer-core with it's JarFileContentsIndexCreator is the behaviour I am empirically seeing in the wild with sample nexus-maven-repository-index.gz files.
Of course, one can still pass all the contents in a String whose elements were joined with the newline character ahead of time - but at that point it makes little sense why a String array needs to be passed as Record's value as it will almost always be a String-array of size 1 anyways (on a similar note, the documentation states that the `classNames` entry stores a value of type java.util.List\, but that is incorrect - it is a String[]).
---
**Affects:** 7.1.3
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by comparing RecordCompactor and RecordExpander in indexer-reader with JarFileContentsIndexCreator in indexer-core, using the linked locations as entry points. Trace how the classNames value is separated and represented, including the documented List type. Done means the reader and creator agree on the classNames format and the documentation matches the actual String[] representation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100