diff --git a/util/src/main/java/org/killbill/billing/util/dao/DefaultNonEntityDao.java b/util/src/main/java/org/killbill/billing/util/dao/DefaultNonEntityDao.java
index d758e18..043805e 100644
--- a/util/src/main/java/org/killbill/billing/util/dao/DefaultNonEntityDao.java
+++ b/util/src/main/java/org/killbill/billing/util/dao/DefaultNonEntityDao.java
@@ -175,7 +175,7 @@ public class DefaultNonEntityDao implements NonEntityDao {
private TypeOut withCaching(final OperationRetrieval<TypeIn, TypeOut> op, @Nullable final TypeIn objectOrRecordId, final ObjectType objectType, final TableName tableName, @Nullable final CacheController<Object, Object> cache) {
- final Profiling<TypeOut> prof = new Profiling<TypeOut>();
+ final Profiling<TypeOut, RuntimeException> prof = new Profiling<TypeOut, RuntimeException>();
if (objectOrRecordId == null) {
return null;
}
@@ -186,18 +186,13 @@ public class DefaultNonEntityDao implements NonEntityDao {
return (TypeOut) cache.get(key, new CacheLoaderArgument(objectType));
}
final TypeOut result;
- try {
- result = prof.executeWithProfiling(ProfilingFeatureType.DAO_DETAILS, "NonEntityDao (type = " + objectType + ") cache miss", new WithProfilingCallback<TypeOut>() {
- @Override
- public <ExceptionType extends Throwable> TypeOut execute() throws ExceptionType {
- return op.doRetrieve(objectOrRecordId, objectType);
- }
- });
- return result;
- } catch (final Throwable throwable) {
- // This is only because WithProfilingCallback throws a Throwable...
- throw new RuntimeException(throwable);
- }
+ result = prof.executeWithProfiling(ProfilingFeatureType.DAO_DETAILS, "NonEntityDao (type = " + objectType + ") cache miss", new WithProfilingCallback<TypeOut, RuntimeException>() {
+ @Override
+ public TypeOut execute() throws RuntimeException {
+ return op.doRetrieve(objectOrRecordId, objectType);
+ }
+ });
+ return result;
}
}
}
diff --git a/util/src/main/java/org/killbill/billing/util/entity/dao/EntitySqlDaoWrapperInvocationHandler.java b/util/src/main/java/org/killbill/billing/util/entity/dao/EntitySqlDaoWrapperInvocationHandler.java
index d128899..9793364 100644
--- a/util/src/main/java/org/killbill/billing/util/entity/dao/EntitySqlDaoWrapperInvocationHandler.java
+++ b/util/src/main/java/org/killbill/billing/util/entity/dao/EntitySqlDaoWrapperInvocationHandler.java
@@ -104,7 +104,7 @@ public class EntitySqlDaoWrapperInvocationHandler<S extends EntitySqlDao<M, E>,
this.clock = clock;
this.cacheControllerDispatcher = cacheControllerDispatcher;
this.nonEntityDao = nonEntityDao;
- this.prof = new Profiling<Object>();
+ this.prof = new Profiling<Object, Throwable>();
}
@Override
diff --git a/util/src/main/java/org/killbill/billing/util/glue/KillbillApiAopModule.java b/util/src/main/java/org/killbill/billing/util/glue/KillbillApiAopModule.java
index 82f2467..68c6c04 100644
--- a/util/src/main/java/org/killbill/billing/util/glue/KillbillApiAopModule.java
+++ b/util/src/main/java/org/killbill/billing/util/glue/KillbillApiAopModule.java
@@ -42,7 +42,7 @@ public class KillbillApiAopModule extends AbstractModule {
public static class ProfilingMethodInterceptor implements MethodInterceptor {
- private final Profiling prof = new Profiling<Object>();
+ private final Profiling prof = new Profiling<Object, Throwable>();
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {