Vasili Gulevich

Results 63 comments of Vasili Gulevich
trafficstars

https://github.com/eclipse-platform/eclipse.platform.swt/actions/runs/7674714373/job/20919789301 ``` org.junit.ComparisonFailure: expected: but was: at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.test_copy(Test_org_eclipse_swt_widgets_Text.java:324) ```

I have not found a way to make `TreeItem.getItemCount()` without using this GTK API, but I have an idea of caching child count to help with JFace scenario, where child...

Naive caching helps with `childCount()`, but `getChilld(int)` is ~ (3N), and when the fix is applied it stays O(N). See my [PR comment](https://github.com/eclipse-platform/eclipse.platform.swt/pull/883#issuecomment-1806917114).

@laeubi as there no way to detect visible object going out of scope, it is impossible to clean the cache, which means we would store all the objects that had...

We can avoid cache cleanup problem by only holding children of one item of interest, and repopulating it when interest shifts (Windows implementation does it for its caches).

@laeubi I've implemented the cache and fixed the quadratic complexity of traversal, but the solution (in #883) stinks (is very slow on depth-first traversals). I'm still thinking about either making...

I was wrong - efemeral Java TreeItems were never an option - strong references to them are held on all platforms. The difference is : MacOS uses those strong references...

I [went with my dumb caching approach](https://github.com/eclipse-platform/eclipse.platform.swt/pull/883) and it works for the scenario I'm interested in. It fails to actually make children tracking sensible, in particular, depth-first traversal is slow....

The PR #883 is a failure. I've tested it on original testcase from https://github.com/eclipse-platform/eclipse.platform.ui/issues/649 and the polynomial growth is 1.8 (approximation from three points) which for practical purposes is not...

An example of ID use case: ``` org.eclipse.swt.widgets.Tree.getFocusItem() { long [] path = new long [1]; GTK.gtk_tree_view_get_cursor (handle, path, null); if (path [0] == 0) return null; TreeItem item =...