You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!descriptor.isSortOnly()) { // for compatibility
if (!(descriptor.isTriggerPoint(e1) && descriptor.isTriggerPoint(e2))) {
returnnull;
}
}
returnsorter;
Sequence:
sorterService.findSorter(...) will correctly return the sorter defined by sortF (implementation: org.eclipse.ui.internal.navigator.sorters.NavigatorSorterService)
if (!descriptor.isSortOnly()) will be entered as navA can't be sortOnly
descriptor.isTriggerPoint(e2) will be false
sortF sorter will be wrongfully discarded
Notes:
1. if (!descriptor.isSortOnly()) will always be entered (if my understanding is correct) as this code
If both navigationContents involved fail isTriggerPoint() then no sorter will ever be provided (e.g. navA as above and navB only acting on .json files)
A sortOnly commonSorter with lower priority would be a good idea in case no common sorter is found (as a fallback). That could be added right before
How to reproduce:
Setup:
navA
providinge1
with specific trigger points (e.g. providing and acting on.xml
files)e1
belonging tonavA
(e.g. filefoo.xml
)e2
not belonging tonavA
and not fulfilling its trigger points/enablement (e.g. filebar.txt
)sortF
with the same or higher priority thannavA
valid for the objects (e.g. parent isIFolder
)eclipse.platform.ui/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonViewerSorter.java
Lines 132 to 138 in 2cab7ac
Sequence:
sorterService.findSorter(...)
will correctly return the sorter defined bysortF
(implementation:org.eclipse.ui.internal.navigator.sorters.NavigatorSorterService
)if (!descriptor.isSortOnly())
will be entered asnavA
can't be sortOnlydescriptor.isTriggerPoint(e2)
will befalse
sortF
sorter will be wrongfully discardedNotes:
1.
if (!descriptor.isSortOnly())
will always be entered (if my understanding is correct) as this codeeclipse.platform.ui/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonViewerSorter.java
Lines 83 to 84 in 2cab7ac
can't ever give a sortOnly navigationContent as source (as it can't provide items per definition).
These are used in the later call:
eclipse.platform.ui/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonViewerSorter.java
Lines 108 to 110 in 2cab7ac
If both navigationContents involved fail
isTriggerPoint()
then no sorter will ever be provided (e.g.navA
as above andnavB
only acting on.json
files)A sortOnly commonSorter with lower priority would be a good idea in case no common sorter is found (as a fallback). That could be added right before
eclipse.platform.ui/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonViewerSorter.java
Lines 118 to 120 in 2cab7ac
The text was updated successfully, but these errors were encountered: