Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Virtual tree viewer reinserts orphaned items
Virtual tree viewer reinserts orphaned items [message #911750] Wed, 12 September 2012 08:51 Go to next message
Ken Wenzel is currently offline Ken WenzelFriend
Messages: 51
Registered: July 2009
Member
Hello,

after the bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=388950
has been fixed - thank your for this - I discovered another one.

The tree viewer starts with the following initial contents:
index.php/fa/11471/0/

Afterwards, this refresh logic is executed:
parent2Children.put("2", new String[] { "2.2" });
treeViewer.refresh("2");
treeViewer.refresh("2.1"); // this accidentally reinserts "2.1" into the tree


This leads to the following incorrect representation:
index.php/fa/11472/0/

Node "2" has child "2.1" instead of the correct child "2.2".
The wrong behavior can be observed whether hash look-up is used or not.

Certain breakpoints during debugging prevented the wrong behavior.
Therefore, this may also be triggered by a race condition.

I would be glad if you could help me.

Best regards,
Ken

Re: Virtual tree viewer reinserts orphaned items [message #912034 is a reply to message #911750] Wed, 12 September 2012 20:38 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Ken,
I've tested your code snippet in RCP it it behaves exactly the same like
in RAP. That's why I think that the problem is in the original JFace
code. You could prove this yourself and open a bug against JFace. What I
don't understand is why you refresh the element "2.1" when it is no
longer in the model?
Best,
Ivan

On 9/12/2012 11:51 AM, Ken Wenzel wrote:
> Hello,
>
> after the bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=388950
> has been fixed - thank your for this - I discovered another one.
>
> The tree viewer starts with the following initial contents:
>
>
> Afterwards, this refresh logic is executed:
>
> parent2Children.put("2", new String[] { "2.2" });
> treeViewer.refresh("2");
> treeViewer.refresh("2.1"); // this accidentally reinserts "2.1" into the tree
>
>
> This leads to the following incorrect representation:
>
>
> Node "2" has child "2.1" instead of the correct child "2.2".
> The wrong behavior can be observed whether hash look-up is used or not.
>
> Certain breakpoints during debugging prevented the wrong behavior.
> Therefore, this may also be triggered by a race condition.
>
> I would be glad if you could help me.
>
> Best regards,
> Ken
>
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Virtual tree viewer reinserts orphaned items [message #912207 is a reply to message #912034] Thu, 13 September 2012 06:20 Go to previous messageGo to next message
Ken Wenzel is currently offline Ken WenzelFriend
Messages: 51
Registered: July 2009
Member
Hi Ivan,

thank you for your help.

The element "2.1" is refreshed because at this point
I don't know if it is no longer in the model, or more precisely,
in our real application this decision would require to execute a
rather costly SPARQL query.

If I open a bug against JFace then how long will it take
to pull the potential fix into RAP?

Best regards,
Ken
Re: Virtual tree viewer reinserts orphaned items [message #912213 is a reply to message #912207] Thu, 13 September 2012 06:29 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Ken,
it depends on how fast the JFace team will fix the problem and will it
be an easy fix (couple lines of code) or a big one.
But please first open a bugzilla against JFace and wait for them to
confirm the problem.
Best,
Ivan

On 9/13/2012 9:20 AM, Ken Wenzel wrote:
> Hi Ivan,
>
> thank you for your help.
>
> The element "2.1" is refreshed because at this point I don't know if
> it is no longer in the model, or more precisely,
> in our real application this decision would require to execute a
> rather costly SPARQL query.
>
> If I open a bug against JFace then how long will it take
> to pull the potential fix into RAP?
>
> Best regards,
> Ken

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Virtual tree viewer reinserts orphaned items [message #912274 is a reply to message #912213] Thu, 13 September 2012 08:41 Go to previous message
Ken Wenzel is currently offline Ken WenzelFriend
Messages: 51
Registered: July 2009
Member
Hi Ivan,

I found a way to avoid this bug:
parent2Children.put("2", new String[] { "2.2" });
treeViewer.refresh("2");

// manually invoke tree.checkData() for the orphaned item
TreeItem item = (TreeItem) treeViewer.testFindItem("2.1");
if (item != null) {
	// call getText to invoke tree.checkData()
	item.getText();
}

treeViewer.refresh("2.1"); // now, this does not reinsert "2.1" into the tree


It seems that the tree should call checkData() at some point
when in VIRTUAL mode to correctly clean up the items.

The corresponding bugzilla entry is:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=389482

Best regards,
Ken

[Updated on: Thu, 13 September 2012 09:00]

Report message to a moderator

Previous Topic:Showing Local URLs in Browser
Next Topic:RAP and MSSQL
Goto Forum:
  


Current Time: Fri Apr 26 14:43:27 GMT 2024

Powered by FUDForum. Page generated in 0.03832 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top