} catch (IllegalAccessException e) {
throw new EntityException(e.getMessage(), e);
} finally {
dsm.close(rs, pst, conn);
}
<BUG>if (cached) {</BUG>
addCache(sql, params, result);
<BUG>}</BUG>
return result;
}

} catch (IllegalAccessException e) {
throw new EntityException(e.getMessage(), e);
} finally {
dsm.close(rs, pst, conn);
}
addCache(sql, params, result);
return result;
}
