public int count() {
Session session = null;
int count = 0;
try {
session = DaoUtils.getSession();
<BUG>if (session != null) {</BUG>
count = ((Long) session.createQuery("SELECT count(*) FROM Address").uniqueResult()).intValue();
<BUG>}
} finally {</BUG>
DaoUtils.closeSession(session);

public int count() {
Session session = null;
int count = 0;
try {
session = DaoUtils.getSession();
count = ((Long) session.createQuery("SELECT count(*) FROM Address").uniqueResult()).intValue();
} catch (Exception e) {
log.error("Error in getting the count: ", e);
} finally {
DaoUtils.closeSession(session);
