Hi,<div><br></div><div>I am a bit confused by GenBookBackend.contains(key). Here is some test code, btw HodgeSysTheo is from Xiphos repo:</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Book book = getBook("HodgeSysTheo");</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>Key volume1Key = book.getKey("Volume I"); // that is a capital I (<i>eye</i>) not a number one on the end</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>assertNotNull("Vol 1 not found", volume1Key);</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if (!book.contains(volume1Key)) {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>System.out.println("Book does not contain a valid key");</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div></div><div><br></div><div>So you can see that I am getting a key from a GenBook but when I check to see if the same GenBook contains the key then I get false if the key does not contain anything. Maybe this is correct but I thought I would ask just in case it is a bug.</div>
<div><br></div><div>The bit of code that implements contains() is</div><div><br></div><div><div> TreeNode node = find(key); // this returns true</div><div> // Is there an entry?</div><div> if (node == null) {</div>
<div> return false;</div><div> }</div><div><br></div><div> // Is it non-empty?</div><div> byte[] userData = node.getUserData();</div><div><br></div><div> // Some entries may be empty.</div>
<div> return userData.length == 8; // this is false for the test key being used i.e. 'Volume I'</div></div><div><br></div><div>Either way I can make And Bible work but I just want to check the above is correct because it surprised me a bit.</div>
<div><br></div><div>Thanks</div><div>Martin</div>