Hello, Looks like a good idea. First variant looks nicer to me too
Thanks On Sun, Jul 16, 2017 at 3:13 PM, Felix Schumacher < [email protected]> wrote: > While looking for easy enhancements and bugs I stumbled upon: > > https://bz.apache.org/bugzilla/show_bug.cgi?id=56862 > > I have to admit, that the error messages for wrong values are not always > that helpful. Especially, when those values are used very late. > > To help things, we could either add a validate function (lambda?) to the > JMeterUtils#getPropDefault family of functions, or surround those calls by > a validator. > > I was thinking of something like > > private static int TIMEOUT = JMeterUtils.getPropDefault("some.timeout", > 5 * 1000, i -> i >= 0); > > private static int TIMEOUT = JMeterUtils.getPropDefault("some.timeout", > 5 * 1000, Validator::notNegative); > > or > > private static int TIMEOUT = Validator.notNegative(JMeterUt > ils.getPropDefault("some.timeout", 5 * 1000), "some.timeout must not be > negative"); > > At the moment I prefer the first variants. > > What do you think? > > Felix > > -- Cordialement. Philippe Mouawad.
