commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commit-cp] [bugs #10447] LinkedList and Collections.binarySearch()


From: David Gilbert
Subject: [commit-cp] [bugs #10447] LinkedList and Collections.binarySearch()
Date: Mon, 20 Sep 2004 06:23:31 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114 Epiphany/1.0.7

This mail is an automated notification from the bugs tracker
 of the project: classpath.




/**************************************************************************/
[bugs #10447] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10447>
Project: classpath
Submitted by: David Gilbert
On: Mon 09/20/2004 at 10:17

Category:  None
Severity:  5 - Average
Resolution:  None
Privacy:  Public
Assigned to:  None
Status:  Open
Platform Version:  None


Summary:  LinkedList and Collections.binarySearch()

Original Submission:  While running a performance test on something unrelated, 
I noticed a problem with the Collections.binarySearch() method on a LinkedList:

0 --> 18 (239928 / 1048568)
1 --> 62 (235528 / 1048568)
java.util.NoSuchElementException
   at java.util.LinkedList$LinkedListItr.next (LinkedList.java:861)
   at java.util.Collections.binarySearch (Collections.java:581)
   at java.util.Collections.binarySearch (Collections.java:535)
   at org.jfree.data.time.TimeSeries.add (TimeSeries.java:443)
   at org.jfree.data.time.TimeSeries.add (TimeSeries.java:476)
   at demo.PerformanceTest1.main (PerformanceTest1.java:145)

The problem disappears if I switch to using an ArrayList.  I put together a 
Mauve test to illustrate the bug - from trial and error, it *seems* to require 
>16 items in the list to trigger the bug (I didn't look into the LinkedList 
source code yet).

I'll also post the test to the mauve-patches mailing list.

Regards,

Dave Gilbert
www.jfree.org





File Attachments
-------------------

-------------------------------------------------------
Date: Mon 09/20/2004 at 10:17  Name: binarySearch.java  Size: 2.77KB   By: 
trebligd
Mauve test
http://savannah.gnu.org/bugs/download.php?item_id=10447&amp;item_file_id=1687






For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10447>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]