Bug 275302 - [call hierarchy] Canceling leaves all but one element without children
Summary: [call hierarchy] Canceling leaves all but one element without children
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-07 09:56 EDT by Markus Keller CLA
Modified: 2024-02-02 12:18 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2009-05-07 09:56:22 EDT
I20090505-2000

Note: This is an old problem (already in 3.4 and before) which we won't address for 3.5.

When the user expands multiple nodes in the Call Hierarchy, the DeferredTreeContentManager only runs one search at a time. When the user now clicks the Cancel button, we cancel all expansions.

Unfortunately, we only get an OperationCanceledException (in our DeferredMethodWrapper#fetchDeferredChildren()) for the expansion that is currently being calculated. In 3.4, we handled that by adding a "Search Canceled" node. In 3.5, we will properly collapse and refresh the parent such that search starts again when the user expands the node again.

For all other pending searches, the DeferredTreeContentManager just calls runClearPlaceholderJob(PendingUpdateAdapter), which only removes the "Pending..." node, but does not collapse and refresh the parent.

The fix probably requires changes in DeferredTreeContentManager (either to do the collapsing and refreshing for free in case the search has not been started yet, or to give clients hooks to do this properly).
Comment 1 Eclipse Genie CLA 2019-12-03 06:51:17 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Paul Pazderski CLA 2020-02-21 17:29:51 EST
This problem remains in current master. I should have checked for an existing bug before investigating it myself because I just came to the same result as Markus and also without a solution.

You can use the small snippet below to easy reproduce the problem. Open call hierarchy for the method callHierarchy and the first expand the 'toString' child and second the 'print' child then cancel the search and find the state Markus described.


(In reply to Markus Keller from comment #0)
> For all other pending searches, the DeferredTreeContentManager just calls
> runClearPlaceholderJob(PendingUpdateAdapter), which only removes the
> "Pending..." node, but does not collapse and refresh the parent.
> 
> The fix probably requires changes in DeferredTreeContentManager (either to
> do the collapsing and refreshing for free in case the search has not been
> started yet, or to give clients hooks to do this properly).

From what I've seen this is almost possible. Removing the "Pending..." node produce an event which can be received via DeferredTreeContentManager.addUpdateCompleteListener. However I see no way to map such event to a specific finished update or to differ between success and cancellation.



Snippet --------------------------

public class Bug275302_callHierarchyCancelSearch {
	public static void main(String[] args) {
		print();
	}

	public static void print() {
		System.out.println(callHierarchy());
	}

	public static String callHierarchy() {
		return "string";
	}

	@Override
	public String toString() {
		return callHierarchy();
	}
}
Comment 3 Eclipse Genie CLA 2022-02-11 11:12:33 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Eclipse Genie CLA 2024-02-02 12:18:58 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.