Skip to content

Expressions.ifThenElse does not work #15

@vlsi

Description

@vlsi

Here's the exception when trying to print such an expression

Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
    at java.util.ArrayList.rangeCheck(ArrayList.java:604)
    at java.util.ArrayList.get(ArrayList.java:382)
    at net.hydromatic.linq4j.expressions.ConditionalStatement.accept0(ConditionalStatement.java:55)

This might be a fix:

  void accept0(ExpressionWriter writer) {
    int ifBranches = expressionList.size();
    ifBranches -= ifBranches & 1;
    for (int i = 0; i < ifBranches; i += 2) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions