lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Koji Sekiguchi <k...@r.email.ne.jp>
Subject Re: contrib/fast-vector-highlighter classes: package-private fields
Date Sat, 20 Nov 2010 00:54:52 GMT
(10/11/19 15:20), Gregor Heinrich wrote:
> Dear list -- I was wondering why in the fast-vector-highlighter some fields are set package-private
> and at the same time don't have accessor methods. Are subclasses supposed to be put in
the same
> package then?
>
> Example: Subclassing ScoreOrderFragmentsBuilder with a new method like this:
>
> @Override
> public List<WeightedFragInfo> getWeightedFragInfoList(List<WeightedFragInfo>
src) {
> Collections.sort(src, new ScoreComparator());
> super(src);
> for (int i = 0; i < src.size(); i++) {
> // ??? every field package private in FieldFragList.WeightedFragInfo
> WeightedFragInfo u = src.get(i);
> u.startOffset -= 20;
> u.endOffset += 20;
> src.set(i, u);
> }
> return src;
> }
>
> I'd vote for protected access for all those fields in the 11 classes where this issue
applies. IMO,
> the package is worth having this extra flexibility. Then it really deserves its attribute
"fast"
> also in terms of developing with it.

I think it's ok to have accessor methods.
Please open a jira ticket and attach a patch if possible.

Koji

-- 
http://www.rondhuit.com/en/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message