Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipse-dev] [jdt-dev] how to create new junit test

Thanks Lars and Mickael

Sure thing, I filed a bug for it here

My thought was it's a shame to only use the StyledTextRenderer.layouts cache in one direction, when block-selecting from bottom-to-top, but (mostly) not in the other direction, selecting top-to-bottom.  Looking at it from a high level, doesn't seem like such a discrepancy needs to exist.

So I wondered if maybe that array could become more like a circular buffer of some kind, so that when the top of selection goes offscreen, instead of disposing the indices < 0, keep them around until that cache runs out of space.  In other words, try to keep that cache full at all times.  Maybe we can avoid those System.arrayCopy calls too at the top of getTextLayout() since the layouts cache seems to only grow at the edges, not in a random-access way, so instead of copying to new array we simply move the start/end pointers in the circlular buffer to "virtually" shift the indices.

Haven't fully thought this through, was just looking into it.

Thanks for any ideas/suggestions/advice, much appreciated.


On Thu, Jun 18, 2020 at 3:53 PM Mickael Istria <mistria@xxxxxxxxxx> wrote:

On Thu, Jun 18, 2020 at 9:26 PM Ari Kast <arikast@xxxxxxxxx> wrote:
I'm doing some work inside org.eclipse.swt.custom.StyledTextRenderer to improve the cache hit ratio for the "layouts" field, and I wanted to write test cases for my work.

Did you open a bug on about this work? It would improve collaboration opportunities.

To my surprise though, at the top of the test class when I import org.eclipse.swt.custom.StyledTextRenderer, some Eclipse rule seems to kick in and immediately delete my import statement.

If this StyledTextRenderer type isn't used anywhere in the code, the import is just cleaned up.
Also, the StyledTextRenderer is "package" visible only, so it's not really possible to interact with it from the tests bundle.. So please open a bug with more details about what you're trying to achieve and we'll discuss there what's doable.

jdt-dev mailing list
To unsubscribe from this list, visit

Back to the top