import org.simantics.scl.compiler.types.Type;
import org.simantics.scl.runtime.function.Function;
import org.simantics.scl.runtime.function.Function2;
import org.simantics.scl.compiler.types.Type;
import org.simantics.scl.runtime.function.Function;
import org.simantics.scl.runtime.function.Function2;
@SuppressWarnings("unchecked")
public static CommandSerializer create(String name, Type[] parameterTypes) {
Function2<Resource,Object,String>[] stringConverters = new Function[parameterTypes.length];
@SuppressWarnings("unchecked")
public static CommandSerializer create(String name, Type[] parameterTypes) {
Function2<Resource,Object,String>[] stringConverters = new Function[parameterTypes.length];
try {
stringConverters[i] = StringConverterFactory.stringConverterFor(parameterTypes[i]);
} catch(SCLExpressionCompilationException e) {
try {
stringConverters[i] = StringConverterFactory.stringConverterFor(parameterTypes[i]);
} catch(SCLExpressionCompilationException e) {
- System.err.println("Failed to create a string converter for type " + parameterTypes[i] + ".");
- System.err.println(CompilationErrorFormatter.toString(e.getErrors()));
+ LOGGER.error("Failed to create a string converter for type " + parameterTypes[i] + ".");
+ LOGGER.error(CompilationErrorFormatter.toString(e.getErrors()), e);
- System.err.println("Failed to create a string converter for type " + parameterTypes[i] + ".");
- System.err.println("Didn't find Simantics/GShow/gshow.");
+ LOGGER.error("Failed to create a string converter for type " + parameterTypes[i] + ".");
+ LOGGER.error("Didn't find Simantics/GShow/gshow.", e);