]> source.dussan.org Git - vaadin-framework.git/commitdiff
merged [9513] from 6.1
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 30 Oct 2009 13:26:53 +0000 (13:26 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 30 Oct 2009 13:26:53 +0000 (13:26 +0000)
svn changeset:9514/svn branch:6.2

src/com/vaadin/terminal/gwt/server/CommunicationManager.java

index 4238aab01919b0c641b9120b7f3db82a5c9d0ccc..c96b2b60b899b98b3c59feb65192fe67ede01e71 100644 (file)
@@ -33,6 +33,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Random;
 import java.util.Set;
 
 import javax.servlet.ServletException;
@@ -368,7 +369,7 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
             String seckey = (String) request.getSession().getAttribute(
                     ApplicationConnection.UIDL_SECURITY_TOKEN_ID);
             if (seckey == null) {
-                seckey = "" + (int) (Math.random() * 1000000);
+                seckey = "" + new Random().nextInt(1000000);
                 request.getSession().setAttribute(
                         ApplicationConnection.UIDL_SECURITY_TOKEN_ID, seckey);
             }
@@ -1153,7 +1154,7 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
             String newWindowName = window.getName();
             while (currentlyOpenWindowsInClient.containsKey(newWindowName)) {
                 newWindowName = window.getName() + "_"
-                        + ((int) (Math.random() * 100000000));
+                        + new Random().nextInt(100000000);
             }
 
             window = application.getWindow(newWindowName);