Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Identity transform tjavarow, reflection fields

I'm trying to just trying to copy input fields to output fields, using tJavarow, and I'm getting the error java.lang.IllegalArgumentException: Can not set boolean field.

This is my code,

        Field[] input_row_f = input_row.getClass().getDeclaredFields();
        Field[] output_row_f = input_row.getClass().getDeclaredFields();

        for (int i = 0; i < input_row_f.length; i++) {
            Field input_field = input_row_f[i];
            Field output_field = output_row_f[i];

            int mod = input_field.getModifiers();
            if (!Modifier.isStatic(mod) && Modifier.isPublic(mod)) {
            
	           output_field.set(output_row, input_field.get(input_row));
	        }
        }

Shouldn't this work?  

I'm not even changing the values from one to the other, and the schema is the same in both directions.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Oops, used input_row twice.. it worked after I fixed it

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Oops, used input_row twice.. it worked after I fixed it