apache / apache/lucene

fix mockanalyzer to not use asserts [LUCENE-6127]

Open
#7,189 5 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Major type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Currently MockAnalyzer's checks are implemented with assert. But this is just for convenience, we should not rely upon asserts being turned on: this is the whole point of the class.

---
Migrated from [LUCENE-6127](https://issues.apache.org/jira/browse/LUCENE-6127) by Robert Muir (@rmuir)
Attachments: [LUCENE-6127.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-6127/LUCENE-6127.patch)

Contributor guide

Open the contributing guide

Research direction

Locate MockAnalyzer in the Lucene source and inspect how its checks are currently implemented. Review the attached LUCENE-6127.patch for context, then verify that the checks remain effective without relying on assertions; the issue is done when MockAnalyzer enforces them regardless of assertion settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.