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: Mark Wielaard
Subject: [commit-cp] [bugs #10447] LinkedList and Collections.binarySearch()
Date: Mon, 20 Sep 2004 19:04:05 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Galeon/1.3.15 (Debian package 1.3.15-2)

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

/**************************************************************************/
[bugs #10447] Latest Modifications:

Changes by: 
                Mark Wielaard <address@hidden>
'Date: 
                Mon 09/20/04 at 22:52 (Europe/Amsterdam)

            What     | Removed                   | Added
---------------------------------------------------------------------------
         Assigned to | None                      | mark


------------------ Additional Follow-up Comments ----------------------------
Could you test the attached patch?






/**************************************************************************/
[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/04 at 10:17

Category:  None
Severity:  5 - Average
Resolution:  None
Privacy:  Public
Assigned to:  mark
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

Follow-up Comments
------------------


-------------------------------------------------------
Date: Mon 09/20/04 at 22:52         By: Mark Wielaard <mark>
Could you test the attached patch?






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

-------------------------------------------------------
Date: Mon 09/20/04 at 22:52  Name: Collections.patch  Size: 990B   By: mark

http://savannah.gnu.org/bugs/download.php?item_id=10447&amp;item_file_id=1689

-------------------------------------------------------
Date: Mon 09/20/04 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]