Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Group: dom4j 2.0
Submitted By: Michael Pradel (mischi)
Assigned to: Nobody/Anonymous (nobody)
Summary: BeanElement throws exception whereas DefaultElement doesn't
We get a ClassCastException when using a DefaultElement that happens to be a BeanElement. The exception doesn't occur with DefaultElement. A minimal example:
The following works fine:
m(new DefaultElement(name), name);
But this fails:
m(new BeanElement(name), name);
The behavior of BeanElement diverges from the superclass behavior, which is very surprising here.
The problem is that DefaultElement initializes its 'attributes' field with a LazyList, but BeanElement expects the field to be a BeanAttributeList. Am I right when guessing that BeanElement should initialize the field with a BeanAttributeList?