[Bug 62040] New: Quotient.evaluate function does not accept cell refences

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 62040] New: Quotient.evaluate function does not accept cell refences

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=62040

            Bug ID: 62040
           Summary: Quotient.evaluate function does not accept cell
                    refences
           Product: POI
           Version: 3.17-FINAL
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SS Common
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

I think adding OperandResolver.getSingleValue for the numerator and denominator
might solvce the problem.


    @Override
        public ValueEval evaluate(int srcRowIndex, int srcColumnIndex,
ValueEval venumerator, ValueEval vedenominator) {

        double enumerator = 0;
        try {
                        ValueEval ve =
OperandResolver.getSingleValue(venumerator, srcRowIndex, srcColumnIndex); //
added this line
            enumerator = OperandResolver.coerceValueToDouble(ve);
        } catch (EvaluationException e) {
            return ErrorEval.VALUE_INVALID;
        }

        double denominator = 0;
        try {
                        ValueEval ve =
OperandResolver.getSingleValue(vedenominator, srcRowIndex, srcColumnIndex); //
added this line
            denominator = OperandResolver.coerceValueToDouble(ve);
        } catch (EvaluationException e) {
            return ErrorEval.VALUE_INVALID;
        }

        if (denominator == 0) {
            return ErrorEval.DIV_ZERO;
        }

        return new NumberEval((int)(enumerator / denominator));
    }

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 62040] Quotient.evaluate function does not accept cell refences

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=62040

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Dominik Stadler <[hidden email]> ---
Do you have a code-sample that shows the problem? Ideally a self-standing
unit-test? Would make it much easier to reproduce and ensure it stays fixed in
the future.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 62040] Quotient.evaluate function does not accept cell refences

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=62040

--- Comment #2 from [hidden email] ---
(In reply to Dominik Stadler from comment #1)
> Do you have a code-sample that shows the problem? Ideally a self-standing
> unit-test? Would make it much easier to reproduce and ensure it stays fixed
> in the future.

I'm not at all familiar with your testing methods. What I did was load an Excel
spreadsheet evaluate it and compare the results visually and with poi. I could
write a simple Excel file and the POI unit test to show fail on the error. Is
that OK?

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 62040] Quotient.evaluate function does not accept cell refences

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=62040

--- Comment #3 from Dominik Stadler <[hidden email]> ---
That would be perfekt!

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]