Bug 13723 fixed: No way to insert a single double in double[][]
[scilab.git] / scilab / modules / external_objects_java / src / java / org / scilab / modules / external_objects_java / FunctionArguments.java
index 671dd16..4496237 100644 (file)
@@ -153,6 +153,19 @@ public final class FunctionArguments {
                 return to.isArray() && from == to.getComponentType();
             }
         });
+
+        // Converter to convert Double to double[]
+        registerConverter(new Converter() {
+            @Override
+            public Object convert(Object original, Class<?> to) {
+                return ScilabJavaArray.singleToOneDim(to.getComponentType(), original);
+            }
+
+            @Override
+            public boolean canConvert(Class<?> from, Class<?> to) {
+                return to.isArray() && ScilabJavaArray.mappings.get(from) == to.getComponentType();
+            }
+        });
     }
 
     /**