Already taken care of in 2.0 in lot more than one places. I'm sure there are more places where this kind of optimization will help.
The one you point is a very small case, and I'm sure there are others, in trees for e.g. Could you file a patch similar to any of these ? http://swtbot.svn.sourceforge.net/viewvc/swtbot/branches/java-1.5-api-spike/net.sf.swtbot.finder/src/net/sf/swtbot/wait/WaitForWidget.java?view=markup http://swtbot.svn.sourceforge.net/viewvc/swtbot/branches/java-1.5-api-spike/net.sf.swtbot.finder/src/net/sf/swtbot/wait/WaitForWidgetInParent.java?view=markup -- Ketan On 13-Oct-08, at 9:57 PM, Hans Schwaebli wrote: > SWTBot runs very fast, but I have seen a piece of code, where time > is lost. > > public SWTBotTableItem getTableItem(final String itemText) > throws WidgetNotFoundException { > try { > new SWTBot().waitUntil(new DefaultCondition() { > public String getFailureMessage() { > return "Could not find node with text " + > itemText; > } > > public boolean test() throws Exception { > return getItem(itemText) != null; > } > }); > } catch (TimeoutException e) { > throw new WidgetNotFoundException("Timed out waiting for > table item " + itemText, e); > } > return new SWTBotTableItem(getItem(itemText)); > } > > The method getItem(itemText) is called twice. Once for determining > whether the widget exists and again for returning the widget. > > I suggest that the waitUnit(...) method returns the widget if it > finds it, so it does not need to be searched again. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ SWTBot-users mailing list SWTBot-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/swtbot-users http://swtbot.org/ - a functional testing tool for SWT/Eclipse