]> source.dussan.org Git - vaadin-framework.git/commitdiff
relocated debug code to helper class + fixed bug when reporting variables and when...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 28 Dec 2010 10:10:02 +0000 (10:10 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 28 Dec 2010 10:10:02 +0000 (10:10 +0000)
svn changeset:16682/svn branch:6.5

src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
src/com/vaadin/terminal/gwt/client/Util.java

index 04d75ca18756b97f0d82893b950b3b5f9fcca605..bc52611abc9490711be340d5ee7b513631564a65 100755 (executable)
@@ -1241,7 +1241,7 @@ public class ApplicationConnection {
 
         while (!pendingVariables.isEmpty()) {
             if (ApplicationConfiguration.isDebugMode()) {
-                logVariableBurst(pendingVariables);
+                Util.logVariableBurst(this, pendingVariables);
             }
             for (int i = 0; i < pendingVariables.size(); i++) {
                 if (i > 0) {
@@ -1265,46 +1265,6 @@ public class ApplicationConnection {
         makeUidlRequest(req.toString(), "", forceSync);
     }
 
-    private void logVariableBurst(ArrayList<String> pendingVariables2) {
-        try {
-            VConsole.log("Variable burst to be sent to server:");
-            String curId = null;
-            ArrayList<String[]> vars = new ArrayList<String[]>();
-            for (int i = 0; i < pendingVariables.size(); i++) {
-                String value = pendingVariables2.get(i++);
-                String[] split = pendingVariables2.get(i).split(
-                        VAR_FIELD_SEPARATOR);
-                String id = split[0];
-
-                if (curId == null) {
-                    curId = id;
-                } else if (!curId.equals(id)) {
-                    printPaintablesVariables(vars, curId);
-                    vars.clear();
-                    curId = id;
-                }
-                split[0] = value;
-                vars.add(split);
-            }
-            if (!vars.isEmpty()) {
-                printPaintablesVariables(vars, curId);
-            }
-        } catch (Exception e) {
-            VConsole.error(e);
-        }
-    }
-
-    private void printPaintablesVariables(ArrayList<String[]> vars, String id) {
-        Paintable paintable = getPaintable(id);
-        if (paintable != null) {
-            VConsole.log("\t" + id + " (" + paintable.getClass() + ") :");
-            for (String[] var : vars) {
-                VConsole.log("\t\t" + var[1] + " (" + var[2] + ")" + " : "
-                        + var[0]);
-            }
-        }
-    }
-
     private void makeUidlRequest(String string) {
         makeUidlRequest(string, "", false);
     }
index da69d67728e7e086ce6d6670e2ac4534473c0139..1f02f4cfa72110d40ea81c7cabe738851a642f01 100644 (file)
@@ -4,6 +4,7 @@
 
 package com.vaadin.terminal.gwt.client;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -973,4 +974,46 @@ public class Util {
         return idx;
     }
 
+    private static void printPaintablesVariables(ArrayList<String[]> vars,
+            String id, ApplicationConnection c) {
+        Paintable paintable = c.getPaintable(id);
+        if (paintable != null) {
+            VConsole.log("\t" + id + " (" + paintable.getClass() + ") :");
+            for (String[] var : vars) {
+                VConsole.log("\t\t" + var[1] + " (" + var[2] + ")" + " : "
+                        + var[0]);
+            }
+        }
+    }
+
+    static void logVariableBurst(ApplicationConnection c,
+            ArrayList<String> loggedBurst) {
+        try {
+            VConsole.log("Variable burst to be sent to server:");
+            String curId = null;
+            ArrayList<String[]> vars = new ArrayList<String[]>();
+            for (int i = 0; i < loggedBurst.size(); i++) {
+                String value = loggedBurst.get(i++);
+                String[] split = loggedBurst.get(i).split(
+                        ApplicationConnection.VAR_FIELD_SEPARATOR);
+                String id = split[0];
+
+                if (curId == null) {
+                    curId = id;
+                } else if (!curId.equals(id)) {
+                    printPaintablesVariables(vars, curId, c);
+                    vars.clear();
+                    curId = id;
+                }
+                split[0] = value;
+                vars.add(split);
+            }
+            if (!vars.isEmpty()) {
+                printPaintablesVariables(vars, curId, c);
+            }
+        } catch (Exception e) {
+            VConsole.error(e);
+        }
+    }
+
 }