Fabian Hueske created FLINK-39952:
-------------------------------------

             Summary: CallContextMock.isArgumentNull() does not correctly 
implement interface contract
                 Key: FLINK-39952
                 URL: https://issues.apache.org/jira/browse/FLINK-39952
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner, Tests
            Reporter: Fabian Hueske


`CallContextMock` is being used forĀ 
`InputTypeStrategiesTestBase`, but does not correctly implement the interface 
`CallContext`.

Specifically, `isArgumentNull()` is not correct
{code:java}
/**
 * Returns {@code true} if the argument at the given position is a literal and 
{@code null},
 * {@code false} otherwise. If the argument is declared as optional and has no 
value, true is
 * returned.
 *
 * <p>Use {@link #isArgumentLiteral(int)} before to check if the argument is 
actually a literal.
 */
boolean isArgumentNull(int pos); {code}

The method should return `true` for optional arguments that are not set. 
However, the mock throws an IndexOutOfBoundsException.
In order to implement the method correctly, the CallContextMock would need 
additional information about the function under test (number of args, optional 
args, etc.).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to