On Wed, Jun 24, 2009 at 12:48 PM, Ian Petersen<ispet...@gmail.com> wrote:
> The following should be allowed:
>
> @SplitPointName("foo")
> final AsyncCallback callback = chooseACallback();
>
> if (flipACoin())
>  GWT.runAsync(callback);
> else
>  GWT.runAsync(callback);

I don't see how to literally allow that, because there are two calls
to runAsync.  The aren't allowed to have the same name.  However, they
could be named differently even though they use the same callback,
like this:
AsyncCallback callback = chooseACallback();

if (flipACoin()) {
  @SplitPointName("foo")
  AsyncCallback callback1 = callback;
  GWT.runAsync(callback1);
} else {
  @SplitPointName("bar")
  AsyncCallback callback2 = callback;
  GWT.runAsync(callback2);
}

It works fine, but IMHO it's verbose.

Overall, unless I missed something, it's down to style and taste.  I'd
pick 1, then 4, then 6.  Ian has indicated preferring 6, then 4, then
1.  I presume Cameron prefers 4 over anything else.  Shall we go with
4, then, everyone?

// proposal 4
GWT.runAsync("NameGoesHere", new RunAsyncCallback() { .... } )

Going once....  going twice....

Lex

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to