Review QL.require and QL.ensure messages

Bug #1209982 reported by Richard Gomes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
JQuantLib
New
Medium
Unassigned

Bug Description

I've added some more methods in class QL which allow more flexibility to validations without incurring on performance penalties.

In a nutshell, you can pass a format string and a variable list of arguments to QL.require and QL.ensure. The message will only be built when the condition fails.

This task is about a complete code review, intending to rewrite error messages which where simplified or had useful information suppressed. There are several other messages which are being composed during the call when they should't, due to performance reasons.

Because reviewing all QL.require and QL.ensure by hand is not practical, we should think about tools or shortcuts which lead us to identify those calls which really need review. At this point, it's not determined how we could speed up this very boring task.

This is an example:

QuantLib/C++:
        QL_REQUIRE(n >= Interpolator::requiredPoints,
                   "not enough instruments: " << n << " provided, " <<
                   Interpolator::requiredPoints << " required");

JQuantLib/Java:
        QL.require(n >= ts.interpolator().requiredPoints(),
                "not enough instruments: %d provided, %d required",
                n, ts.interpolator().requiredPoints());

Tags: code-review
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.