#1 Infinite loop in ValueFactory.findConverterForClass

open
nobody
None
5
2004-03-14
2004-03-14
Doug
No

An infinitite loop will occur if an attribute with a
non-primitive type is set.

The cause of this is the following code:

Class superClass = theClass.getSuperclass();
if (superClass != null) {
converter = findConverterForClass(theClass);
}

which incorrectly recursively calls
findConverterForClass with the same class that just
failed - hence it will continuously call itself until
it runs out of stack space.

The fix is simple enough:

Class superClass = theClass.getSuperclass();
if (superClass != null) {
converter = findConverterForClass(superClass);
}

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks