apache / apache/lucene

CharsRef has confusing methods/needs tests/bugs [LUCENE-3277]

Open
#4,350 3 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

While looking at #4306, i noticed a few things:
- lots of internal methods (e.g. copy) use grow(). I don't think they should do this. CharsRef should work like BytesRef, i don't think it needs to be a stringbuffer. i think its ok to expose a public grow() method like we did for bytesref though.
- the append() method is totally confusing, and doesnt make sense compared to BytesRef, copy() might also have issues.
- a lot of these methods are unused, we should at least add tests for them, or remove ones we don't need.

---
Migrated from [LUCENE-3277](https://issues.apache.org/jira/browse/LUCENE-3277) by Robert Muir (@rmuir), updated Nov 01 2011

Contributor guide

Open the contributing guide

Research direction

Locate the CharsRef and BytesRef implementations and any existing tests, then compare their append, copy, and grow behavior. Clarify which methods are needed and what matching BytesRef semantics and test coverage should count as done.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.