Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an ArrayList object in an User Defined Java Class in Kettle?

I am trying to declare an ArrayList object in an User Defined Java Class object in pentaho kettle. I am trying a simple code inside the User Defined Java Class:

import java.util.List;
import java.util.ArrayList;

List<String> where = new ArrayList<String>();

public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
{    

    return true;

}

But when I test this class, I get an error:

Line 4, Column 6: Identifier expected

What can be the issue? If I comment out the line List<String> where = new ArrayList<String>(); the code works well.

like image 533
psr Avatar asked May 30 '26 19:05

psr


1 Answers

As mentioned on the Pentaho wiki Janino doesn't support generics.

Another thing to note is that Janino, essentially a Java byte-code generator only supports a sub-set of the Java 1.5 specification. To see a complete list of the features and limitations, please go to the Janino homepage. At the time of writing the most apparent limitation is the absence of generics.

So, you should use a simple List like this :

List where;

instead of using generics.

like image 155
Ashish Ranjan Avatar answered Jun 01 '26 08:06

Ashish Ranjan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!