setInteger/etc. cause reset in some parameter

Issue #171 resolved
Former user created an issue

Original issue 171 created by @ysavourel on 2011-04-01T11:57:23.000Z:

When using setInteger() or related functions after a Parameters object has been setup may cause some info to be reset at the middle of the pipeline causing error.
For example the segmentation step resets the parameters of the regex filter causing the rules to not be compiled anymore and causing a null exception.

The solution is to implement setInteger/etc. in a way reset() is not called.

Comments (5)

  1. Former user Account Deleted

    Comment 2. originally posted by @ysavourel on 2013-10-25T00:09:05.000Z:

    Yves, did you ever have a concrete test case for this (like if I wanted to try to tweak it and then check for regressions)? I was trying to write an unrelated unittest and was wondering why the BaseParameters was so weird, and I found this issue. I don't see a unittest with the checkin.

  2. Former user Account Deleted

    Comment 3. originally posted by @ysavourel on 2013-10-25T11:33:43.000Z:

    Yes, I didn't add a unit test reproducing the problem when I worked on that one: not a very smart idea.
    It looks like the idea was to avoid using fromString() to update a single value because that was also updating other values that had been changed.
    I'll see if I can reproduce this.

  3. Former user Account Deleted

    Comment 4. originally posted by @ysavourel on 2013-10-25T12:16:47.000Z:

    I've tried to reproduce the issue: having a new unit test and temporarily changing the BaseParameters code back to use fromString(), but the test passed. So I'm not sure how the original issue was triggered. Something to do with reset() being called from fromString() that was resetting fields without preserving changes.
    I'll try to think about it more.
    If you can write simpler code for BaseParameters and ParametersString (and stay compatible)... I'd like that.

  4. Former user Account Deleted

    Comment 5. originally posted by @ysavourel on 2013-10-25T18:29:09.000Z:

    Ok, I'll see what I can do.

  5. Log in to comment