Funz / funz-client

Funz user side
BSD 2-Clause "Simplified" License
0 stars 2 forks source link

Issue with "AnythingND" output function expression #17

Closed Arnaud-Trouche closed 3 years ago

Arnaud-Trouche commented 3 years ago

The initialisation of this class seems to have issues in Funz:


java.lang.NoSuchMethodException: org.funz.parameter.OutputFunctionExpression$AnythingND.<init>(java.lang.String)
    at java.lang.Class.getConstructor0(Class.java:3082)
    at java.lang.Class.getConstructor(Class.java:1825)
    at org.funz.parameter.OutputFunctionExpression.newInstanceOfType(OutputFunctionExpression.java:978)
    ...
...
Arnaud-Trouche commented 3 years ago

The issue comes from the following line in OutputFunctionExpression newInstanceOfType():

        return (OutputFunctionExpression) klass.getConstructor(args.length == 1 ? String.class : new String[args.length].getClass()).newInstance(args.length == 1 ? args[0] : (Object) args);

When we want to create a "AnythingND" with only one parameter, the line call a AnythingND(String) constructor that does not exists, only the AnythingNd(String []) exists