DESCRIPTION

Bug 517052 - Provide a way to set relevance for marker to sort quick fix
resolutions 

Change-Id: I91030f8a51ef9aafbf8c86f3c0900af8955a68d2
Signed-off-by: Tyrese Hall xxx@xxx.xxx

COMMENTS

author: Tyrese Hall
date: 2017-07-17 09:27:00.000000000

Uploaded patch set 11.

-------------------------------------
author: Tyrese Hall
date: 2017-07-17 09:32:54.000000000

Patch Set 11:

Updated patch-11 which incorporates comment from review of patch-10.
>>Can you explain that choice? For JDT we have 0..1000. So, if the intent with -1000 was to provide more space, then it should be done in both directions.

In JDT althought it says [0,1000], it uses negative number in the code. I have provided [-1000, 1000] as I want the clients to have an option to give "least relevant" or "most relevant". If we start at 0 to 1000 then by default we need to give +500 as some resolutions will be more relevant and some less. In our case, the default is 0  and hence it should go on both sides  ( negative and positive). I have change it to   [-500, 500] if [-1000, 1000] is a huge range.

-------------------------------------
author: Sebastian Porter
date: 2017-07-17 09:36:07.000000000

Patch Set 11: Verified-1

(2 comments)

Line:30, bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/IMarkerResolutionRelevance.java -> Please see my previous comment on patch set 9.

Line:264, bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/QuickFixPage.java -> Looking at the patch for PDE I realized that this code won't work/scale. It should not be required that all resolutions need to implement the new interface in order to work.

Test: Only implement it for the configure severity ones and you'll see it won't sort correctly.

Here's what could work, please test it:

				int relevanceMarker1 = (e1 instanceof IMarkerResolutionRelevance)
						? ((IMarkerResolutionRelevance) e1).getRelevanceForResolution()
						: 0;
				int relevanceMarker2 = (e2 instanceof IMarkerResolutionRelevance)
						? ((IMarkerResolutionRelevance) e2).getRelevanceForResolution()
						: 0;

				if (relevanceMarker1 != relevanceMarker2) {
					return Integer.valueOf(relevanceMarker2).compareTo(Integer.valueOf(relevanceMarker1));
				}

				return ((IMarkerResolution) e1).getLabel().compareTo(
						((IMarkerResolution)e2).getLabel());

-------------------------------------
author: Sebastian Porter
date: 2017-07-17 09:44:31.000000000

Patch Set 11:

> Updated patch-11 which incorporates comment from review of
 > patch-10.
 > >>Can you explain that choice? For JDT we have 0..1000. So, if the
 > intent with -1000 was to provide more space, then it should be done
 > in both directions.
 > 
 > In JDT althought it says [0,1000], it uses negative number in the
 > code. I have provided [-1000, 1000] as I want the clients to have
 > an option to give "least relevant" or "most relevant". If we start
 > at 0 to 1000 then by default we need to give +500 as some
 > resolutions will be more relevant and some less. In our case, the
 > default is 0  and hence it should go on both sides  ( negative and
 > positive). I have change it to   [-500, 500] if [-1000, 1000] is a
 > huge range.

Didn't see that before. Our comments must have crossed each other.

OK, I see that JDT also uses negative values, even down to Integer.MIN_VALUE.

Please file a bug against JDT to fix the API Javadoc and remove the restriction on the value in both APIs. There's no value in restricting it, and as soon as we call the JDT API we would violate the new API.

-------------------------------------
author: Brenden Conley
date: 2017-07-17 10:19:48.000000000

Patch Set 11:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/13169/

-------------------------------------
author: Brenden Conley
date: 2017-07-17 10:45:50.000000000

Patch Set 11: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/13169/ : SUCCESS

-------------------------------------
author: Tyrese Hall
date: 2017-07-17 10:47:46.000000000

Patch Set 11:

Opened bug 519751 ( and provided a patch to remove the restriction).
In next patch, I intend to remove restriction in this patch too.

-------------------------------------
