Skip to content
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

ion generate produces incorrect Java code for multi-dimensional lists #167

Open
popematt opened this issue Oct 30, 2024 · 0 comments
Open
Labels
bug Something isn't working code generation Improvements for code generation subcommand `generate`

Comments

@popematt
Copy link
Contributor

Given ISL such as

type: {
  name: Matrix,
  type: list,
  element: {
    type: list,
    element: int
  }
}

The read method for the resulting Matrix class looks like this:

    public static Matrix readFrom(IonReader reader) {
        java.util.ArrayList<java.util.ArrayList<Integer>> value = new java.util.ArrayList<java.util.ArrayList<Integer>>();
        if(reader.getType() != IonType.LIST) {
            throw new IonException("Expected List, found " + reader.getType() + " while reading value.");
        }
        reader.stepIn();
        while (reader.hasNext()) {
            reader.next();
            value.add(java.util.ArrayList<Integer>.readFrom(reader));
        }
        reader.stepOut();
        Matrix matrix = new Matrix();
        matrix.value = value;
        return  matrix;
    }

There is no such method java.util.ArrayList<Integer>.readFrom().

@popematt popematt added bug Something isn't working code generation Improvements for code generation subcommand `generate` labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code generation Improvements for code generation subcommand `generate`
Projects
None yet
Development

No branches or pull requests

1 participant