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?]


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 :-)



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

Reply via email to:

Powered by MHonArc.

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