Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ Bug Fixes
removing co-planar points to do it once after all holes are removed instead of doing it for each
removed hole.

* GITHUB#15319: Fix potential hang in initialisation of TermsEnum and BaseTermsEnum (Chris Hegarty)

Other
---------------------
* GITHUB#15237: Fix SmartChinese to only deserialize dictionary data from classpath with a native array
Expand Down
22 changes: 21 additions & 1 deletion lucene/core/src/java/org/apache/lucene/index/TermsEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,27 @@ public final PostingsEnum postings(PostingsEnum reuse) throws IOException {
* of unused Attributes does not matter.
*/
public static final TermsEnum EMPTY =
new BaseTermsEnum() {
new TermsEnum() {

private AttributeSource atts;

@Override
public AttributeSource attributes() {
if (atts == null) {
atts = new AttributeSource();
}
return atts;
}

@Override
public boolean seekExact(BytesRef text) {
return seekCeil(text) == SeekStatus.FOUND;
}

@Override
public IOBooleanSupplier prepareSeekExact(BytesRef text) {
return () -> seekExact(text);
}

@Override
public SeekStatus seekCeil(BytesRef term) {
Expand Down
Loading