aboutsummaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2010-12-28 10:10:02 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2010-12-28 10:10:02 +0000
commit7830dd06df20cee7292d909d92b9de780f64e2de (patch)
tree53e3f5a739138320531b528c1aa3210b91730c5e /src/com
parentfce626683d65d112a936c414866d6c4afccfbb6e (diff)
downloadvaadin-framework-7830dd06df20cee7292d909d92b9de780f64e2de.tar.gz
vaadin-framework-7830dd06df20cee7292d909d92b9de780f64e2de.zip
relocated debug code to helper class + fixed bug when reporting variables and when multiple bursts in queue
svn changeset:16682/svn branch:6.5
Diffstat (limited to 'src/com')
-rwxr-xr-xsrc/com/vaadin/terminal/gwt/client/ApplicationConnection.java42
-rw-r--r--src/com/vaadin/terminal/gwt/client/Util.java43
2 files changed, 44 insertions, 41 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
index 04d75ca187..bc52611abc 100755
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
@@ -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);
}
diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java
index da69d67728..1f02f4cfa7 100644
--- a/src/com/vaadin/terminal/gwt/client/Util.java
+++ b/src/com/vaadin/terminal/gwt/client/Util.java
@@ -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);
+ }
+ }
+
}