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:45:56.000000000

Patch Set 12: Patch Set 11 was rebased

-------------------------------------
author: Tyrese Hall
date: 2017-07-17 10:03:32.000000000

Patch Set 12:

>>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.

If you look at jdt.ui patch, it is a very small patch. API tools should have had something like AbstractPDEAPIToolsMarkerResolution ( just like PDE UI).

Comparing 2 resolutions when one of them implements IMarkerRelevance and other doesn't is not a good idea. In that case, we should leave it to default comparator. As per initial design, the clients should decide if they want to rearrange their set or subset of resolutions or skip it.  If 2 resolutions implement IMarkerResolutionRelevance, comparing them makes sense. If one of them does and one of them doesn't, it is comparing 2 different things. It is overriding the default comparator behavior without client explicitly telling it.

97654/11 + 101310 = works fine for PDE
97654/11  + 101113 = works fine for JDT UI


Regarding wrong range for IJavaCompletionProposal::getRelevance, I will open a separate bug.

-------------------------------------
author: Sebastian Porter
date: 2017-07-17 10:13:39.000000000

Patch Set 12: Verified-1

> Comparing 2 resolutions when one of them implements
 > IMarkerRelevance and other doesn't is not a good idea. 

It depends what we want to achieve. With your proposed solution you cannot specify for sure that a specific resolution (e.g. config severity), is the last one, even if you set it to -1000. Because, as soon as another plug-in also contributes some resolutions but does not implement the new interface, it will fall back to alpha sort and config sev will again be at/near the top.

-------------------------------------
author: Tyrese Hall
date: 2017-07-17 10:31:24.000000000

Patch Set 12:

>>With your proposed solution you cannot specify for sure that a specific resolution (e.g. config severity), is the last one, even if you set it to -1000

This means that once there is a resolution ( say R1) with IMarkerResolutionRelevance, while comparing that resolution with any other marker resolution (say R2), it will set the relevance of R2 to 0 ( unless IMarkerResolutionRelevance is implemented for R2 and given a different relevance value. It is doing much more than I initially intended it to but if this approach is taken, it should be documented properly ( so as to be clear to the clients). 

I will update with this change ( and add some documentation to be more clear) and also adjust the client code ( pde+jdt ui) to remove code that will be left redundant post this change.

-------------------------------------
author: Brenden Conley
date: 2017-07-17 11:14:09.000000000

Patch Set 12:

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

-------------------------------------
author: Brenden Conley
date: 2017-07-17 11:39:08.000000000

Patch Set 12: Verified+1

Build Successful 

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

-------------------------------------
author: Sebastian Porter
date: 2017-07-17 14:05:26.000000000

Patch Set 12:

> I will update with this change ( and add some documentation to be
 > more clear)

Yes, documenting this is good!

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