[ https://issues.apache.org/jira/browse/LUCENE-1616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12703157#action_12703157 ]
Earwin Burrfoot commented on LUCENE-1616: ----------------------------------------- bq. removing separate looks a bit better for me as it forces users to think "attomic" about offset <=> {start, end}. And if it's not atomic by design? bq. If you separate start and end offset too far in your code, probability that you do not see mistake somewhere is higher compared to the case where you manage start and end on your own in these cases (this is then rather "explicit" in you code)... Instead of having one field for Term, which you build incrementally, you now have to keep another field for startOffset. Imho, that's starting to cross into another meaning of 'explicit' :) And while you're trying to prevent bugs of using setStartOffset and forgetting about its 'End' counterpart, you introduce another set of bugs - overwriting one end of interval, when you only need to update another. bq. And in general I prefer one clear way to do something And force everyone who has slightly different use-case to jump through the hoops. Span*Query api is a perfect example. Well, whatever. > add one setter for start and end offset to OffsetAttribute > ---------------------------------------------------------- > > Key: LUCENE-1616 > URL: https://issues.apache.org/jira/browse/LUCENE-1616 > Project: Lucene - Java > Issue Type: Improvement > Components: Analysis > Reporter: Eks Dev > Priority: Trivial > Fix For: 2.9 > > Attachments: LUCENE-1616.patch > > > add OffsetAttribute. setOffset(startOffset, endOffset); > trivial change, no JUnit needed > Changed CharTokenizer to use it -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org