They do the same thing. According to the docs, sometimes the type of the variable can't be determined, so you will have to use the setVariable() method. Under normal circumstances, the setX() method(s) will be generated. You are better off using the generated methods.