Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
Indexer.index()
method used to returnClassInfo
, whichassumes that no whole-index post-processing is not necessarsy.
Indeed Jandex doesn't do any such post-processing at the moment,
but it seems pretty obvious that it is necessary. Thus, as a first
step, this commit changes this method to return
void
, so thatall
Indexer
callers are forced to callcomplete()
beforebeing able to access any kind of indexed information.
There are 2 kinds of usages of the
Indexer.index()
result ofthe
ClassInfo
type in the Jandex project itself: showing somesummary during batch indexing and creating a single-class index
for tests.
For the first use case, a method
indexWithSummary
is addedthat returns
ClassSummary
. This is fine and doesn't affect futureindex post-processing, because the summary contains very high-level
information (just a name and number of annotations).
For the second use case, the
IndexingUtil
class is added whichcontains utility methods for the most common cases of creating
a single-class index.
Additionally, the
IndexingUtil
class has arountrip
methodthat serializes the index in memory and deserializes it back.
This is used in several tests, which usually had their own
variation of this code (one even serialized the index to a file).
This commit changes all such places to use this
roundtrip
method.Fixes #132