Hi All,

I have the following problem:
A piece of code running too long for the Browsers (both for IE and Mozilla).

This is a while cycle searching for RootPanel of a widget.

While I was debugging I found that if I put Window.alert it operates correctly, 
no pop-up from browser.
Finally the following solution solved the problem:

                while (null != w) {
                        //check if w is a composite
                        try {
                                Composite tmp = (Composite) w;
                                tmp.isAttached();
                        
                                wLastComposite = w;
                                wLastCompositeChild = wChild;

                                wChild = w;
                                w = w.getParent();

                                continue;
                        } catch (Exception ex) {
                                //not Composite, do nothing
                        }

!!!!!START solution: Added only this line!!!!
                        long end = System.currentTimeMillis();
!!!!!END of solution
                        //check if w is a RootPanel
                        try {
                                RootPanel rpTest = (RootPanel) w;
                                rpTest.isAttached();
                                w = null;
                                foundRootPanel = true;
                                
                                break;
                        } catch (Exception ex) {
                                //not RootPanel, nothing to do
                        }

                        //continue with its parent
                        wChild = w;
                        w = w.getParent();
                }

Now, its running fast. Like 1 ms. 

Can you please tell me WHY???????

Approximately 6 iteration needed, this is what I found during debug. I do not 
think, this shall last more than 10 sec (Browsers limits) by default.
And the issue occurred after we upgraded to 2.1.
I understand, that GWT is single threaded, and the only think I can think of 
that system call somehow make an interrupt.

So two questions: 
- why does not it work??
- why this system call solves the issue??

Thanks in advance for your answers/explanation!!

BR,
Zsomi

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/XTYVt4QQNuEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to