Can't cancel repeat timer in GWT
问题 I am trying to schedule a repeating timer in GWT, it will run every one milli second, poll for a certain event, if it is found satisfactory, do something and cancel the timer. I tried doing this: final Timer t = new Timer() { public void run() { if (..condition is true, exit) { t.cancel(); doSomething(); } } } t.scheduleRepeating(1); However, I get an error message like the local variable t may not have been initialized . I am putting tis piece of code in the onSuccess clause of a