Why was this done?
Code:
public void submitLogic(final Runnable runnable) {
logicService.submit(new Runnable() {
public void run() {
try {
runnable.run();
} catch (Throwable t) {
System.err.println(t.getMessage());
}
}
});
}
instead of
Code:
public void submitLogic(final Runnable runnable) {
logicService.submit(runnable);
}
Am I overlooking something?
I know it's not to try and catch as it already does that in the run method.
So is it just to print the message when it catches the throwable?
Code:
try {
final Task task = tasks.take();
submitLogic(new Runnable() {
@Override
public void run() {
task.execute(Engine.this);
}
});
} catch (InterruptedException e) {
continue;
}