I've run across this warning, and I'm trying to figure out a way to correct it, I've tried to fix it using generics, however, I have not been able to make the warning go away.
Any feedback would be appreciated
Type safety: The method set(Object) belongs to the raw type ThreadLocal. References to generic type ThreadLocal<T> should be parameterized
public static final ThreadLocal session = new ThreadLocal();
public static Session currentSession() throws HibernateException {
Session s = (Session) session.get();
// Open a new Session, if this
Thread has none yet
if (s == null) {
s = sessionFactory.openSession();
session.set(s);
}
return s;
}