Infinite loop/StackOverflow when calling configuration.setListener(null)

Description

calling config.setListener(null) will result in an infinite loop.

It's a one character problem/fix:

public void setListener(String type, Object listener) {
if ( listener == null ) {
setListener( type, null ); //infinite recursion
}

should be:

public void setListener(String type, Object listener) {
if ( listener == null ) {
setListeners( type, null ); //need the plural
}

Environment

None

Activity

Show:
Shawn Kerstetter
March 22, 2006, 10:21 PM

Actually, looking more closely, you are also going to need the cast:

setListeners( type, (Object[]) null ); //need the plural

Konstantin Ignatyev
May 19, 2006, 6:21 PM

Patch to org.hibernate.cfg.Configuration

Gail Badner
October 9, 2007, 12:31 AM

Fixed trunk / 3.2

Assignee

Gail Badner

Reporter

Shawn Kerstetter

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure