builder.addln("return result;");
}
builder.end();
MethodFab methodFab = classFab.addMethod(Modifier.PUBLIC, sig, builder.toString());
builder.clear();
builder.begin();
builder.add("org.apache.hivemind.service.impl.LoggingUtils.exception(_log, ");
builder.addQuoted(methodName);
builder.addln(", $e);");
builder.addln("throw $e;");
builder.end();
String body = builder.toString();
Class[] exceptions = sig.getExceptionTypes();
int count = exceptions.length;
for (int i = 0; i < count; i++)
{
methodFab.addCatch(exceptions[i], body);
}
// Catch and log any runtime exceptions, in addition to the
// checked exceptions.
methodFab.addCatch(RuntimeException.class, body);
}