ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | xmlc List | September 2006 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [xmlc] Re: [enhydra] java.lang.StackOverflowError (on too many 'else if' statements) [SOLVED?]


I agree with Petr!!!

Keep it simple :)

Regards,
 Slobodan Vujasinovic
Enhydra Development Team



Petr Stehlik wrote:

Jacob Kjome wrote:

        String id = ((Element)node).getAttribute("id");
String fName = "$element_" + id.substring(0, 1).toUpperCase() + id.substring(1);
        try {
                Field f = this.getClass().getDeclaredField(fName);
                f.setAccessible(true);
                f.set(this, node);
        } catch (Exception e) {}
}


This is the simplest, most succinct, solution I can come up with and it doesn't require modifying interfaces. Anyway, comments welcome.


I'd just say that simplest solutions tend to be the best ones and if this fixes the StackOverflowError then go for it.

Petr

P.S. final code should handle id.length < 2 :-)

------------------------------------------------------------------------


--
You receive this message as a subscriber of the xmlc@xxxxxxxxxxxxx mailing 
list.
To unsubscribe: mailto:xmlc-unsubscribe@xxxxxxxxxxxxx
For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.