]
Christian Bauer updated HHH-1616:
---------------------------------
Comment: was deleted
org.hibernate.tuple.ElementWrapper has 6 Java scoping errors which
break updating a lazy-loaded DOM4J Element
-------------------------------------------------------------------------------------------------------------
Key: HHH-1616
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1616
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.0 cr1
Environment: Any
Reporter: John Spackman
Attachments: ElementWrapper.java
Original Estimate: 0 minutes
Remaining Estimate: 0 minutes
The class has a member variable called "element" which is the DOM4J element
that is being wrapped; 6 of the methods in ElementWrapper (from the Element interface)
have parameters also called "element" and the scoping is not corrected to use
the wrapped "element".
EG, calling the method "add" to add a new child element will make the child a
child of itself and *not* connect it to the wrapped element. See snippet below
public class ElementWrapper implements Element, Serializable {
private Element element;
private Element parent;
// ...snip...
public void add(Element element) {
// BUG: Should be this.element.add(..)
element.add( element );
}
// ...snip...
}
This methods affected are:
getPath
getUniquePath
asXPathResult
appendAttributes
add(Element element)
remove(Element element)
Attached is a fixed version, with comments by my changes.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: