You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by "Allan, Brad (Wokingham)" <Br...@Fiserv.com> on 2013/03/19 16:28:33 UTC
AttributeSource minor defect?
I'm working on upgrading our code to use 3.0.3. A bunch of unit tests fail around some synonym filters (extend TokenFilter) we have.
I tripped over the change to AddAttribute that now uses generics, getting this message:
"AddAttribute() only accepts an interface that extends Attribute, but " + attClass.FullName + " does not fulfil this contract."
Should the message not be:
"AddAttribute() only accepts an interface that extends IAttribute, but " + attClass.FullName + " does not fulfil this contract."
For the record our code used to do this:
(TermAttribute)AddAttribute(typeof (TermAttribute));
And we now have to do this:
AddAttribute<ITermAttribute>();
________________________________
CheckFree Solutions Limited (trading as Fiserv)
Registered Office: Eversheds House, 70 Great Bridgewater Street, Manchester, M15 ES
Registered in England: No. 2694333
Re: AttributeSource minor defect?
Posted by Itamar Syn-Hershko <it...@code972.com>.
Yes, this is the way to go. I fixed the error message.
On Tue, Mar 19, 2013 at 5:28 PM, Allan, Brad (Wokingham) <
Brad.Allan@fiserv.com> wrote:
> I'm working on upgrading our code to use 3.0.3. A bunch of unit tests fail
> around some synonym filters (extend TokenFilter) we have.
>
> I tripped over the change to AddAttribute that now uses generics, getting
> this message:
>
> "AddAttribute() only accepts an interface that extends Attribute, but " +
> attClass.FullName + " does not fulfil this contract."
>
> Should the message not be:
> "AddAttribute() only accepts an interface that extends IAttribute, but " +
> attClass.FullName + " does not fulfil this contract."
>
> For the record our code used to do this:
> (TermAttribute)AddAttribute(typeof (TermAttribute));
> And we now have to do this:
> AddAttribute<ITermAttribute>();
>
>
>
> ________________________________
>
> CheckFree Solutions Limited (trading as Fiserv)
> Registered Office: Eversheds House, 70 Great Bridgewater Street,
> Manchester, M15 ES
> Registered in England: No. 2694333
>