Commit 044635b2 authored by Nico Mack's avatar Nico Mack

Fixed bugs in RExecutor

parent 310cff57
......@@ -134,14 +134,19 @@ public class RExecutor extends Executor implements REngineCallbacks, REngineOutp
Object primitives = ArrayUtils.toPrimitive(parameter);
REXP instance = null;
Constructor<?> constructor;
try {
Class<?> rexpClass = R_TYPES.get(primitives.getClass());
constructor = rexpClass.getConstructor(primitives.getClass());
instance = (REXP) constructor.newInstance(primitives);
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
LOGGER.error("Failed to instantiate REXP object!", e); //$NON-NLS-1$
if (R_TYPES.containsKey(primitives.getClass())) {
Constructor<?> constructor;
try {
Class<?> rexpClass = R_TYPES.get(primitives.getClass());
constructor = rexpClass.getConstructor(primitives.getClass());
instance = (REXP) constructor.newInstance(primitives);
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
LOGGER.error("Failed to instantiate REXP object!", e); //$NON-NLS-1$
}
} else {
LOGGER.error("Don't know how to marchall java type {} for R!", primitives.getClass()); //$NON-NLS-1$
}
return instance;
}
......
......@@ -352,6 +352,12 @@ public abstract class Variable<V> implements Cloneable {
}
}
public void removeListener(InputChangeListener listener) {
if (listeners.contains(listener)) {
listeners.add(listener);
}
}
/**
* Sets the suspendNotification flag for InputChangeListeners. When suspend, InputChangeListeners
* will not be notified on value changes.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment