Bug 329227 - Usage of broken quicksort algorithm in jdt.internal.compiler.util.Util
Summary: Usage of broken quicksort algorithm in jdt.internal.compiler.util.Util
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-01 18:04 EDT by daolaf CLA
Modified: 2011-01-25 10:35 EST (History)
3 users (show)

See Also:


Attachments
The patch (1.02 KB, patch)
2010-11-01 18:04 EDT, daolaf CLA
no flags Details | Diff
patch to commit (4.13 KB, patch)
2010-12-23 08:11 EST, Ayushman Jain CLA
amj87.iitr: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description daolaf CLA 2010-11-01 18:04:06 EDT
Build Identifier: 

The broken quicksort algorithm which got removed in this bug: (https://bugs.eclipse.org/bugs/show_bug.cgi?id=158258) is used in jdt.internal.compiler.util.Util in the method reverseQuickSort.

I will attach a patch where the algorithm is fixed.

Reproducible: Always
Comment 1 daolaf CLA 2010-11-01 18:04:59 EDT
Created attachment 182179 [details]
The patch
Comment 2 Ayushman Jain CLA 2010-11-08 06:22:09 EST
(In reply to comment #1)
> Created an attachment (id=182179) [details] [diff]
> The patch

Thanks for the patch. Can you please provide a copyright statement (or your name and email id) to be added in your patch (or add it yourself and submit a new patch). 

It should be of the form
Name <email id> - Contribution for bug 3292227.

Also, please use 

mid = left + ((right-left)/2)

instead of the right shift operator. This is what has been used elsewhere in JDT/Core.

I will also fix the quicksort in org.eclipse.jdt.core.tests.model.CompletionTestsRequestor.quickSort(String[], int, int) and org.eclipse.jdt.core.tests.model.CompletionTestsRequestor2.quickSort(CompletionProposal[], int, int)
Comment 3 Ayushman Jain CLA 2010-11-15 01:44:30 EST
(In reply to comment #2)
> (In reply to comment #1)
> > Created an attachment (id=182179) [details] [diff] [details] [diff]
> > The patch
> 
> Thanks for the patch. Can you please provide a copyright statement (or your
> name and email id) to be added in your patch (or add it yourself and submit a
> new patch). 
> 
> It should be of the form
> Name <email id> - Contribution for bug 3292227.
> 
> Also, please use 
> 
> mid = left + ((right-left)/2)
> 
> instead of the right shift operator. This is what has been used elsewhere in
> JDT/Core.
> 
> I will also fix the quicksort in
> org.eclipse.jdt.core.tests.model.CompletionTestsRequestor.quickSort(String[],
> int, int) and
> org.eclipse.jdt.core.tests.model.CompletionTestsRequestor2.quickSort(CompletionProposal[],
> int, int)

Hi, please add atleast your copyright information as soon as possible so that the patch can be released. Thanks!
Comment 4 Ayushman Jain CLA 2010-12-10 00:36:29 EST
Olivier, we don't have the copyright info for this yet. Should the patch be released without it?
Comment 5 Olivier Thomann CLA 2010-12-10 13:19:59 EST
(In reply to comment #4)
> Olivier, we don't have the copyright info for this yet. Should the patch be
> released without it?
Ayushman, please update the copyright with the following information.

* daolaf@gmail.com - Contribution for bug 3292227.

And then release it.
Set the iplog tag on the attached patch.

Thanks.
Comment 6 Ayushman Jain CLA 2010-12-23 08:11:57 EST
Created attachment 185767 [details]
patch to commit
Comment 7 Ayushman Jain CLA 2010-12-23 11:26:08 EST
Released in HEAD for 3.7M5
Comment 8 Markus Keller CLA 2011-01-03 10:47:22 EST
(In reply to comment #5)
> Set the iplog tag on the attached patch.

This has not been done. Reopening to make sure this doesn't get forgotten.
Comment 9 Ayushman Jain CLA 2011-01-06 02:01:33 EST
(In reply to comment #8)
> (In reply to comment #5)
> > Set the iplog tag on the attached patch.
> 
> This has not been done. Reopening to make sure this doesn't get forgotten.

Sorry for missing this out. Done now.
Comment 10 Srikanth Sankaran CLA 2011-01-25 10:35:25 EST
Verified for 3.7 M5 via code inspection.