<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Windows-1252">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.4417.0">
<TITLE>Bug in PartialList?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hi,</FONT>
</P>
<P><FONT SIZE=2>I just received the latest CVS version, and well - is it possible that the bug fix Alex Rosen sent in 3rd of May was not integrated in PartialList? For reference (excerpt from Alex' mail):</FONT></P>
<P><FONT SIZE=2>START</FONT>
<BR><FONT SIZE=2>Here's a patch for the bug I mentioned a while back. Without it, this will fail:</FONT>
</P>
<P><FONT SIZE=2>Element e = new Element("test");</FONT>
<BR><FONT SIZE=2>Element e2 = new Element("test2");</FONT>
<BR><FONT SIZE=2>List list = e.getChildren();</FONT>
<BR><FONT SIZE=2>list.add(0, e2); </FONT>
</P>
<P><FONT SIZE=2>==============================================================================</FONT>
<BR><FONT SIZE=2>RCS file: /home/cvspublic/jdom/src/java/org/jdom/PartialList.java,v</FONT>
<BR><FONT SIZE=2>retrieving revision 1.9</FONT>
<BR><FONT SIZE=2>diff -u -r1.9 PartialList.java</FONT>
<BR><FONT SIZE=2>--- PartialList.java 2001/04/27 18:21:20 1.9</FONT>
<BR><FONT SIZE=2>+++ PartialList.java 2001/05/03 04:53:26</FONT>
<BR><FONT SIZE=2>@@ -143,6 +143,11 @@</FONT>
<BR><FONT SIZE=2> * Inserts the given element at the beginning of this list.</FONT>
<BR><FONT SIZE=2> */</FONT>
<BR><FONT SIZE=2> public void addFirst(Object o) {</FONT>
<BR><FONT SIZE=2>+ if (size() == 0) {</FONT>
<BR><FONT SIZE=2>+ add(o);</FONT>
<BR><FONT SIZE=2>+ return;</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2> int index = backingList.indexOf(getFirst());</FONT>
<BR><FONT SIZE=2> super.addFirst(o);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>@@ -162,6 +167,11 @@</FONT>
<BR><FONT SIZE=2> * function to the <tt>add</tt> method; included only for consistency.)</FONT>
<BR><FONT SIZE=2> */</FONT>
<BR><FONT SIZE=2> public void addLast(Object o) {</FONT>
<BR><FONT SIZE=2>+ if (size() == 0) {</FONT>
<BR><FONT SIZE=2>+ add(o);</FONT>
<BR><FONT SIZE=2>+ return;</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2> int index = backingList.indexOf(getLast());</FONT>
<BR><FONT SIZE=2> super.addLast(o);</FONT>
</P>
<P><FONT SIZE=2>END</FONT>
</P>
<P><FONT SIZE=2>Regards,</FONT>
</P>
<P><FONT SIZE=2>Falk Fraikin</FONT>
</P>
</BODY>
</HTML>