during rwi search result processing worddistance calculation is effected
by concurrent update (normalization) of min/max ranking parameter for
wordpositions. On update of min/max the exception is raised in distance calc
and now catched.
This concurrent update and change of ranking results is needed for speed
but should be further checked for optimization
@ -128,7 +129,15 @@ public abstract class AbstractReference implements Reference {
}
// despite first line checks for size < 2 Arithmetic exception div by zero occured (1.91/9278 2016-10-19)
// added d == 0 condition as protection for this (which was in all above tests the case)
returnd==0?0:d/(positions().size()-1);
try{
returnd==0?0:d/(positions().size()-1);
}catch(ArithmeticExceptionex){
// TODO: in peer to peer normalization of rwi queue modifies concurrently positions resulting in div by 0 exception
// with effect of above check position() < 2 is false but now true, it also results in changing ranking results until normalization is finished
// see related/causing code ReferenceOrder.normalizewith() and WordReferenceVars.max()/WordReferenceVars.min() -> refacturing of posintext, distance, min, max needed