Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
asfimport opened this issue Jul 5, 2011 · 3 comments
Open

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

asfimport opened this issue Jul 5, 2011 · 3 comments

Comments

@asfimport
Copy link

asfimport commented Jul 5, 2011

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 by Robert Muir (@rmuir), updated Nov 01 2011

@asfimport
Copy link
Author

Robert Muir (@rmuir) (migrated from JIRA)

the same grow() issue happens in IntsRef.copy and LongsRef.copy.

I think we should fix this, and in general, i think these guys should have consistent APIs.

@asfimport
Copy link
Author

asfimport commented Nov 1, 2011

Robert Muir (@rmuir) (migrated from JIRA)

#4622 addresses the confusing append() issue.

@gsmiller
Copy link
Contributor

I came across a reference to this issue while working on #12305. It looks like the CharsRef family is pretty consistent with BytesRef now (including the builders). I don't see anything outstanding here, and was going to close this out, but wanted to check with @rmuir first to make sure I'm not missing something. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants