There doesn't seem to be a good reason to force implementations to define SetLength(), since it should just cascade the call to the setter of Length. We should remove this from the interface and make this method into an extension method on ICharTermAttribute (in a Lucene.Net.Analysis.TokenAttributes.Extensions namespace). It should also be made to return the type of ICharTermAttribute it is called upon rather than the interface type.
There doesn't seem to be a good reason to force implementations to define
SetLength()
, since it should just cascade the call to the setter ofLength
. We should remove this from the interface and make this method into an extension method onICharTermAttribute
(in aLucene.Net.Analysis.TokenAttributes.Extensions
namespace). It should also be made to return the type ofICharTermAttribute
it is called upon rather than the interface type._Originally posted by @NightOwl888 in https://github.com/apache/lucenenet/pull/1028#discussion_r1848165854_