if (!a2.unify(toPrologTerm(instance), engine.trail)) {
return engine.fail();
}
return cont;
} catch (ClassNotFoundException e) { // Class.forName(..)
throw new JavaException(this, 1, e);
} catch (InstantiationException e) { // Class.forName(..) or
// Constructor.newInstance()
throw new JavaException(this, 1, e);
} catch (IllegalAccessException e) { // Class.forName(..) or
// Constructor.newInstance()
throw new JavaException(this, 1, e);
} catch (NoSuchMethodException e) { // Class.getDeclaredConstructor()
throw new JavaException(this, 1, e);
} catch (SecurityException e) { // Class.getDeclaredConstructors()
throw new JavaException(this, 1, e);
} catch (IllegalArgumentException e) { // Constructor.newInstance()
throw new JavaException(this, 1, e);
} catch (InvocationTargetException e) { // Constructor.newInstance()
throw new JavaException(this, 1, e);
}
}