New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expressions.ifThenElse does not work #15

vlsi opened this Issue Apr 9, 2014 · 0 comments


None yet
1 participant

vlsi commented Apr 9, 2014

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(
    at java.util.ArrayList.get(
    at net.hydromatic.linq4j.expressions.ConditionalStatement.accept0(

This might be a fix:

  void accept0(ExpressionWriter writer) {
    int ifBranches = expressionList.size();
    ifBranches -= ifBranches & 1;
    for (int i = 0; i < ifBranches; i += 2) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment