[gwt-contrib] Fix issue 5065: Float.parseFloat and Double.parseDouble are too strict validating input (issue647802)

2010-06-28 Thread t . broyer

Reviewers: ,

Description:
Make Float.parseFloat/valueOf and Double.parseDouble/valueOf accept
strings with a float type suffix, such as "1.0f" or "1.0d".

Please review this at http://gwt-code-reviews.appspot.com/647802/show

Affected files:
  user/super/com/google/gwt/emul/java/lang/Number.java
  user/test/com/google/gwt/emultest/java/lang/DoubleTest.java
  user/test/com/google/gwt/emultest/java/lang/FloatTest.java


Index: user/super/com/google/gwt/emul/java/lang/Number.java
===
--- user/super/com/google/gwt/emul/java/lang/Number.java(revision 8320)
+++ user/super/com/google/gwt/emul/java/lang/Number.java(working copy)
@@ -345,7 +345,7 @@
 var floatRegex = @java.lang.Number::floatRegex;
 if (!floatRegex) {
   // Disallow '.' with no digits on either side
-  floatRegex = @java.lang.Number::floatRegex = /^\s*[+-]?((\d+\.?\d*)| 
(\.\d+))([eE][+-]?\d+)?\s*$/i;
+  floatRegex = @java.lang.Number::floatRegex = /^\s*[+-]?((\d+\.?\d*)| 
(\.\d+))([eE][+-]?\d+)?[dDfF]?\s*$/i;

 }
 if (floatRegex.test(str)) {
   return parseFloat(str);
Index: user/test/com/google/gwt/emultest/java/lang/DoubleTest.java
===
--- user/test/com/google/gwt/emultest/java/lang/DoubleTest.java	(revision  
8320)
+++ user/test/com/google/gwt/emultest/java/lang/DoubleTest.java	(working  
copy)

@@ -151,5 +151,11 @@
 assertTrue(-2.56789e1 == Double.parseDouble("  -2.56789E1"));
 assertTrue(-2.56789e1 == Double.parseDouble("-2.56789e+01   "));
 assertTrue(-2.56789e1 == Double.parseDouble("   -2.56789E1   "));
+
+// Test that a float type suffix is allowed
+assertTrue(1.0 == Double.parseDouble("1.0f"));
+assertTrue(1.0 == Double.parseDouble("1.0F"));
+assertTrue(1.0 == Double.parseDouble("1.0d"));
+assertTrue(1.0 == Double.parseDouble("1.0D"));
   }
 }
Index: user/test/com/google/gwt/emultest/java/lang/FloatTest.java
===
--- user/test/com/google/gwt/emultest/java/lang/FloatTest.java	(revision  
8320)
+++ user/test/com/google/gwt/emultest/java/lang/FloatTest.java	(working  
copy)

@@ -78,6 +78,11 @@
 assertEquals(-1.5f, Float.parseFloat("-1.5"), 0.0);
 assertEquals(3.0f, Float.parseFloat("3."), 0.0);
 assertEquals(0.5f, Float.parseFloat(".5"), 0.0);
+// Test that a float type suffix is allowed
+assertEquals(1.0f, Float.parseFloat("1.0f"), 0.0);
+assertEquals(1.0f, Float.parseFloat("1.0F"), 0.0);
+assertEquals(1.0f, Float.parseFloat("1.0d"), 0.0);
+assertEquals(1.0f, Float.parseFloat("1.0D"), 0.0);
 // TODO(jat): it isn't safe to parse MAX/MIN_VALUE because we also  
want to
 // be able to get POSITIVE/NEGATIVE_INFINITY for out-of-range values,  
and

 // since all math in JS is done in double we can't rely on getting the


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] WebSockets in GWT

2010-06-28 Thread Marko Vuksanovic
Are web sockets going to be implemented in GWT any time soon? Does
google or more precisely, GWT team, have that in the roadmap?

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Making StackLayoutPanel#showWidget(Widget) call showWidget(int) for legacy support. Ditto to Ta... (issue641802)

2010-06-28 Thread jlabanca

Reviewers: jgw,

Description:
Making StackLayoutPanel#showWidget(Widget) call showWidget(int) for
legacy support.  Ditto to TabLayoutPanel.


Please review this at http://gwt-code-reviews.appspot.com/641802/show

Affected files:
  M user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java
  M user/src/com/google/gwt/user/client/ui/TabLayoutPanel.java
  M user/test/com/google/gwt/user/client/ui/StackLayoutPanelTest.java
  M user/test/com/google/gwt/user/client/ui/TabLayoutPanelTest.java


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] WebSockets in GWT

2010-06-28 Thread John Tamplin
On Mon, Jun 28, 2010 at 12:50 PM, Marko Vuksanovic <
markovuksano...@gmail.com> wrote:

> Are web sockets going to be implemented in GWT any time soon? Does
> google or more precisely, GWT team, have that in the roadmap?


I am working on WebSockets in general, and the GWT bindings will probably
look a lot like those used in GWT Quake.  It will probably have some
deferred binding property to check for WebSockets support, but will not try
and do anything like emulating it over some other transport in the first
pass.

Jetty was recently upgraded to 7.0.2, which provides WebSocket support on
the server.

If you are interested in working on this, please contact me off-list.

-- 
John A. Tamplin
Software Engineer (GWT), Google

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] [google-web-toolkit] r8321 committed - DefaultSelectionModel#setSelected currently adds an exception even if ...

2010-06-28 Thread codesite-noreply

Revision: 8321
Author: jlaba...@google.com
Date: Mon Jun 28 07:32:05 2010
Log: DefaultSelectionModel#setSelected currently adds an exception even if  
the default selection state equals the specified state. Also adds test  
cases for all selection models.


Review at http://gwt-code-reviews.appspot.com/658801

Review by: j...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=8321

Added:
 /trunk/user/test/com/google/gwt/view/ViewSuite.java
 /trunk/user/test/com/google/gwt/view/client/AbstractSelectionModelTest.java
 /trunk/user/test/com/google/gwt/view/client/DefaultSelectionModelTest.java
 /trunk/user/test/com/google/gwt/view/client/MultiSelectionModelTest.java
 /trunk/user/test/com/google/gwt/view/client/SingleSelectionModelTest.java
Modified:
 /trunk/user/src/com/google/gwt/view/client/DefaultSelectionModel.java
 /trunk/user/src/com/google/gwt/view/client/SelectionModel.java

===
--- /dev/null
+++ /trunk/user/test/com/google/gwt/view/ViewSuite.java	Mon Jun 28 07:32:05  
2010

@@ -0,0 +1,47 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may  
not
+ * use this file except in compliance with the License. You may obtain a  
copy of

+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT

+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations  
under

+ * the License.
+ */
+package com.google.gwt.view;
+
+import com.google.gwt.junit.tools.GWTTestSuite;
+import com.google.gwt.view.client.AbstractListViewAdapterTest;
+import com.google.gwt.view.client.AbstractSelectionModelTest;
+import com.google.gwt.view.client.AsyncListViewAdapterTest;
+import com.google.gwt.view.client.DefaultNodeInfoTest;
+import com.google.gwt.view.client.DefaultSelectionModelTest;
+import com.google.gwt.view.client.MultiSelectionModelTest;
+import com.google.gwt.view.client.RangeTest;
+import com.google.gwt.view.client.SingleSelectionModelTest;
+
+import junit.framework.Test;
+
+/**
+ * Tests of the view package.
+ */
+public class ViewSuite {
+  public static Test suite() {
+GWTTestSuite suite = new GWTTestSuite("Test suite for all view  
classes");

+
+suite.addTestSuite(AbstractListViewAdapterTest.class);
+suite.addTestSuite(AbstractSelectionModelTest.class);
+suite.addTestSuite(AsyncListViewAdapterTest.class);
+suite.addTestSuite(DefaultNodeInfoTest.class);
+suite.addTestSuite(DefaultSelectionModelTest.class);
+suite.addTestSuite(MultiSelectionModelTest.class);
+suite.addTestSuite(RangeTest.class);
+suite.addTestSuite(SingleSelectionModelTest.class);
+return suite;
+  }
+}
===
--- /dev/null
+++  
/trunk/user/test/com/google/gwt/view/client/AbstractSelectionModelTest.java	 
Mon Jun 28 07:32:05 2010

@@ -0,0 +1,128 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may  
not
+ * use this file except in compliance with the License. You may obtain a  
copy of

+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT

+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations  
under

+ * the License.
+ */
+package com.google.gwt.view.client;
+
+import com.google.gwt.junit.client.GWTTestCase;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.view.client.SelectionModel.AbstractSelectionModel;
+import com.google.gwt.view.client.SelectionModel.SelectionChangeEvent;
+import com.google.gwt.view.client.SelectionModel.SelectionChangeHandler;
+
+/**
+ * Tests for {...@link AbstractSelectionModel}.
+ */
+public class AbstractSelectionModelTest extends GWTTestCase {
+
+  /**
+   * A mock {...@link SelectionChangeHandler} used for testing.
+   */
+  private static class MockSelectionChangeHandler implements
+  SelectionChangeHandler {
+
+private boolean eventFired;
+
+public void assertEventFired(boolean expected) {
+  assertEquals(expected, eventFired);
+}
+
+public void onSelectionChange(SelectionChangeEvent event) {
+  eventFired = true;
+}
+  }
+
+  /**
+   * A mock {...@link SelectionModel} used for testing.
+   *
+   * @param  the data type
+   */
+  private static class MockSelectionModel extends  
AbstractSelectionModel {

+public boolean isSelected(T object) {
+  return false;
+}
+
+public void setSelected(T object, boolean selected) {
+}
+  }
+
+  @Override
+  public String getModuleName() {

[gwt-contrib] Adding NoSelectionModel, which allows selection without saving the selection state. (issue667801)

2010-06-28 Thread jlabanca

Reviewers: jgw,

Description:
Adding NoSelectionModel, which allows selection without saving the
selection state.


Please review this at http://gwt-code-reviews.appspot.com/667801/show

Affected files:
  M bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpenseList.java
  M  
bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseList.java
  M  
bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileReportList.java

  A user/src/com/google/gwt/view/client/NoSelectionModel.java
  M user/test/com/google/gwt/view/ViewSuite.java
  A user/test/com/google/gwt/view/client/NoSelectionModelTest.java


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: DefaultSelectionModel#setSelected currently adds an exception even if the default selection stat... (issue658801)

2010-06-28 Thread jlabanca

committed as r8321

http://gwt-code-reviews.appspot.com/658801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Making StackLayoutPanel#showWidget(Widget) call showWidget(int) for legacy support. Ditto to Ta... (issue641802)

2010-06-28 Thread jgw

On 2010/06/28 16:54:55, jlabanca wrote:


LGTM

http://gwt-code-reviews.appspot.com/641802/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r8322 committed - Merged trunk r8308 into this branch...

2010-06-28 Thread codesite-noreply

Revision: 8322
Author: j...@google.com
Date: Mon Jun 28 10:46:22 2010
Log: Merged trunk r8308 into this branch

Fixes List.subList adds.

svn merge -c8308 --ignore-ancestry  
https://google-web-toolkit.googlecode.com/svn/trunk



http://code.google.com/p/google-web-toolkit/source/detail?r=8322

Modified:
 /releases/2.0/branch-info.txt
 /releases/2.0/user/super/com/google/gwt/emul/java/util/AbstractList.java
 /releases/2.0/user/test/com/google/gwt/emultest/java/util/ListTestBase.java

===
--- /releases/2.0/branch-info.txt   Wed Jun 23 14:48:11 2010
+++ /releases/2.0/branch-info.txt   Mon Jun 28 10:46:22 2010
@@ -1519,3 +1519,8 @@
   Escaping HTML strings from the client as a good practice to avoid XSS  
vulnerabilities in apps

   the build off of the default app.
   svn merge -c8293 --ignore-ancestry  
https://google-web-toolkit.googlecode.com/svn/trunk

+
+tr...@r8308 was merged into this branch
+  Fixes List.subList adds.
+  svn merge -c8308 --ignore-ancestry  
https://google-web-toolkit.googlecode.com/svn/trunk

+
===
---  
/releases/2.0/user/super/com/google/gwt/emul/java/util/AbstractList.java	 
Wed Jan 27 12:34:44 2010
+++  
/releases/2.0/user/super/com/google/gwt/emul/java/util/AbstractList.java	 
Mon Jun 28 10:46:22 2010

@@ -170,7 +170,7 @@
 }

 private void checkIndexForAdd(int index) {
-  checkIndex(index, size - 1);
+  checkIndex(index, size + 1);
 }

 private int getSize(int fromIndex, int toIndex) {
===
---  
/releases/2.0/user/test/com/google/gwt/emultest/java/util/ListTestBase.java	 
Wed Jan 27 12:34:44 2010
+++  
/releases/2.0/user/test/com/google/gwt/emultest/java/util/ListTestBase.java	 
Mon Jun 28 10:46:22 2010

@@ -32,7 +32,7 @@
 public abstract class ListTestBase extends TestArrayList {

   private static volatile boolean NO_OPTIMIZE_FALSE = false;
-
+
   public void testAddAll() {
 assertFalse(makeEmptyList().addAll(makeEmptyList()));
 assertTrue(makeEmptyList().addAll(makeFullList()));
@@ -43,7 +43,7 @@
 assertFalse(makeFullList().addAll(1, makeEmptyList()));
 assertTrue(makeFullList().addAll(1, makeFullList()));
   }
-
+
   public void testAddWatch() {
 List s = makeEmptyList();
 s.add("watch");
@@ -107,6 +107,10 @@
 assertFalse(i.hasNext());
 assertTrue(i.hasPrevious());
   }
+
+  public void testListIteratorRemove() {
+// TODO(jat): implement
+  }

   public void testListIteratorSetInSeveralPositions() {
 List l = makeEmptyList();
@@ -121,10 +125,6 @@
   assertEquals(new Integer(n), l.get(n));
 }
   }
-
-  public void testListIteratorRemove() {
-// TODO(jat): implement
-  }

   public void testRemoveAllDuplicates() {
 Collection c = makeCollection();
@@ -135,83 +135,22 @@
 assertTrue(c.removeAll(d));
 assertEquals(0, c.size());
   }
-
-  public void testToArray() {
-List l = makeEmptyList();
-for (int i = 0; i < 10; i++) {
-  l.add(new Integer(i));
-}
-
-{
-  Object[] objArray = l.toArray();
-  assertEquals(10, objArray.length);
-  for (int i = 0; i < 10; i++) {
-Integer elem = (Integer) objArray[i];
-assertEquals(i, elem.intValue());
-  }
-  // should not cause ArrayStore
-  objArray[0] = new Object();
-}
-
-{
-  Integer[] firstArray = new Integer[13];
-  firstArray[10] = new Integer(10);
-  firstArray[11] = new Integer(11);
-  firstArray[12] = new Integer(12);
-  Integer[] intArray = (Integer[]) l.toArray(firstArray);
-  assertTrue(firstArray == intArray);
-  assertEquals(13, intArray.length);
-  for (int i = 0; i < 13; i++) {
-if (i == 10) {
-  assertNull(intArray[i]);
-} else {
-  Integer elem = intArray[i];
-  assertEquals(i, elem.intValue());
-}
-  }
-  try {
-Object[] objArray = NO_OPTIMIZE_FALSE ? new Object[1] : intArray;
-assertTrue(objArray instanceof Integer[]);
-objArray[0] = new Object();
-fail("expected ArrayStoreException");
-  } catch (ArrayStoreException e) {
-  }
-}
-
-{
-  Integer[] firstArray = new Integer[0];
-  Integer[] intArray = (Integer[]) l.toArray(firstArray);
-  assertFalse(firstArray == intArray);
-  assertEquals(10, intArray.length);
-  for (int i = 0; i < 10; i++) {
-Integer elem = intArray[i];
-assertEquals(i, elem.intValue());
-  }
-  try {
-Object[] objArray = NO_OPTIMIZE_FALSE ? new Object[1] : intArray;
-assertTrue(objArray instanceof Integer[]);
-objArray[0] = new Object();
-fail("expected ArrayStoreException");
-  } catch (ArrayStoreException e) {
-  }
-}
-  }

   public void testSubList() {
-List wrappedList = createListWithContent(new int[]{1, 2, 3,  
4, 5});
+List wrappedList = createListWithContent(new int[] {1, 2, 3,  
4, 5});

 List te

[gwt-contrib] Re: Fix external issue 5052 - JSONParser.parse exceptions with some unicode characters (issue659801)

2010-06-28 Thread דניאל רייס
On Fri, Jun 25, 2010 at 6:18 PM,  wrote:
>
> Just like in "plain JavaScript", the following would actually create an
> "ab" property with no trace of  (tested in Safari 5 on Windows):
>   var o = {};
>   o['a\u2028b'] = 'c';
> That's a bug in JavaScriptCore that can hardly be worked around, so I
> suggest not doing anything (the probability that those chars be used in
> property names is rather low, and they are correctly treated in string
> values)
>
> I couldn't reproduce the problem (using \u0601 for ) in either of
> Firefox (3.6.4), Chrome (6.0.447.0 dev), IE (8) or Opera (10.60 beta).


  I don't see this on a recently-updated Safari 5.0 on Os X 10.5.8:

> var o = {}
*undefined*
> o['a\u2028b'] = 'c'
*"c"*
> o['ab']
*undefined*
> o['ab'] = 'd'
*"d"*
> o['a\u2028b']
*"c*"
> o['ab']
*"d"*

Dan

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] Re: Fix issue 5065: Float.parseFloat and Double.parseDouble are too strict validating input (issue647802)

2010-06-28 Thread rice

LGTM

http://gwt-code-reviews.appspot.com/647802/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Fix issue 5065: Float.parseFloat and Double.parseDouble are too strict validating input (issue647802)

2010-06-28 Thread rice

Thanks for the patch, I'll submit it.

Dan

On 2010/06/28 18:07:14, Dan Rice wrote:

LGTM




http://gwt-code-reviews.appspot.com/647802/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r8323 committed - Making StackLayoutPanel#showWidget(Widget) call showWidget(int) for le...

2010-06-28 Thread codesite-noreply

Revision: 8323
Author: jlaba...@google.com
Date: Mon Jun 28 08:24:06 2010
Log: Making StackLayoutPanel#showWidget(Widget) call showWidget(int) for  
legacy support.  Ditto to TabLayoutPanel.


Review at http://gwt-code-reviews.appspot.com/641802

Review by: j...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=8323

Modified:
 /trunk/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java
 /trunk/user/src/com/google/gwt/user/client/ui/TabLayoutPanel.java
 /trunk/user/test/com/google/gwt/user/client/ui/StackLayoutPanelTest.java
 /trunk/user/test/com/google/gwt/user/client/ui/TabLayoutPanelTest.java

===
--- /trunk/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java	Mon  
Jun  7 12:20:31 2010
+++ /trunk/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java	Mon  
Jun 28 08:24:06 2010

@@ -341,6 +341,7 @@
 };
   }

+  @Override
   public void onResize() {
 layoutPanel.onResize();
   }
@@ -439,7 +440,7 @@
* @param child the child widget to be shown.
*/
   public void showWidget(Widget child) {
-showWidget(child, true);
+showWidget(getWidgetIndex(child));
   }

   /**
===
--- /trunk/user/src/com/google/gwt/user/client/ui/TabLayoutPanel.java	Mon  
Jun  7 12:20:31 2010
+++ /trunk/user/src/com/google/gwt/user/client/ui/TabLayoutPanel.java	Mon  
Jun 28 08:24:06 2010

@@ -420,7 +420,7 @@
* @param child the child whose tab is to be selected
*/
   public void selectTab(Widget child) {
-selectTab(child, true);
+selectTab(getWidgetIndex(child));
   }

   /**
===
---  
/trunk/user/test/com/google/gwt/user/client/ui/StackLayoutPanelTest.java	 
Mon Jun  7 12:20:31 2010
+++  
/trunk/user/test/com/google/gwt/user/client/ui/StackLayoutPanelTest.java	 
Mon Jun 28 08:24:06 2010

@@ -21,7 +21,9 @@
 import com.google.gwt.event.logical.shared.SelectionEvent;
 import com.google.gwt.event.logical.shared.SelectionHandler;

+import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;

 /**
  * Tests for {...@link StackLayoutPanel}.
@@ -198,6 +200,30 @@
 handler.assertOnBeforeSelectionFired(false);
 handler.assertOnSelectionFired(false);
   }
+
+  /**
+   * For legacy reasons, {...@link StackLayoutPanel#showWidget(Widget)}  
should call

+   * {...@link StackLayoutPanel#showWidget(int)}.
+   */
+  public void testShowWidgetLegacy() {
+final List called = new ArrayList();
+StackLayoutPanel panel = new StackLayoutPanel(Unit.PX) {
+  @Override
+  public void showWidget(int index) {
+called.add(index);
+super.showWidget(index);
+  }
+};
+Label stack1 = new Label("Stack 1");
+panel.add(new Label("Stack 0"), "Stack 0", 100);
+panel.add(stack1, "Stack 1", 100);
+panel.add(new Label("Stack 2"), "Stack 2", 100);
+called.clear();
+
+panel.showWidget(stack1);
+assertEquals(1, called.size());
+assertEquals(1, called.get(0).intValue());
+  }

   public void testVisibleWidget() {
 StackLayoutPanel p = new StackLayoutPanel(Unit.EM);
===
--- /trunk/user/test/com/google/gwt/user/client/ui/TabLayoutPanelTest.java	 
Mon Jun  7 12:20:31 2010
+++ /trunk/user/test/com/google/gwt/user/client/ui/TabLayoutPanelTest.java	 
Mon Jun 28 08:24:06 2010

@@ -26,7 +26,9 @@
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.DeferredCommand;

+import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;

 /**
  * Tests for {...@link TabLayoutPanel}.
@@ -39,7 +41,8 @@
 }
   }

-  private class TestSelectionHandler implements  
BeforeSelectionHandler, SelectionHandler {

+  private class TestSelectionHandler implements
+  BeforeSelectionHandler, SelectionHandler {
 private boolean onBeforeSelectionFired;
 private boolean onSelectionFired;

@@ -273,6 +276,30 @@
 assertFalse(labels[1].isVisible());
 assertFalse(labels[2].isVisible());
   }
+
+  /**
+   * For legacy reasons, {...@link TabLayoutPanel#selectTab(Widget)} should  
call

+   * {...@link TabLayoutPanel#selectTab(int)}.
+   */
+  public void testSelectTabLegacy() {
+final List called = new ArrayList();
+TabLayoutPanel panel = new TabLayoutPanel(100.0, Unit.PX) {
+  @Override
+  public void selectTab(int index) {
+called.add(index);
+super.selectTab(index);
+  }
+};
+Label tab1 = new Label("Tab 1");
+panel.add(new Label("Tab 0"), "Tab 0");
+panel.add(tab1, "Tab 1");
+panel.add(new Label("Tab 2"), "Tab 2");
+called.clear();
+
+panel.selectTab(tab1);
+assertEquals(1, called.size());
+assertEquals(1, called.get(0).intValue());
+  }

   /**
* Tests that tabs actually line up properly (see issue 4447).
@@ -285,8 +312,7 @@
 p.add(new Button("foo"), new Label("foo"));
 p.add(new Button("bar"), new Label("bar"));

-assertEquals(
-p.get

[gwt-contrib] Re: Making StackLayoutPanel#showWidget(Widget) call showWidget(int) for legacy support. Ditto to Ta... (issue641802)

2010-06-28 Thread jlabanca

committed as r8323

http://gwt-code-reviews.appspot.com/641802/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r8324 committed - Adding json-1.5 jar that contains 1.5 compatible bytecode so that GWT ...

2010-06-28 Thread codesite-noreply

Revision: 8324
Author: amitman...@google.com
Date: Mon Jun 28 11:49:58 2010
Log: Adding json-1.5 jar that contains 1.5 compatible bytecode so that GWT  
users can

use java 1.5 to build apps with GWT.

Patch by: amitmanjhi
Review by: rjrjr, fabbott (TBR)


http://code.google.com/p/google-web-toolkit/source/detail?r=8324

Added:
 /tools/redist/json/r2_20080312/README
 /tools/redist/json/r2_20080312/json-1.5.jar

===
--- /dev/null
+++ /tools/redist/json/r2_20080312/README   Mon Jun 28 11:49:58 2010
@@ -0,0 +1,3 @@
+json-1.5.jar and json.jar share the same source json-src.jar. They only  
differ
+in that the java 1.5 compiler was used to create json-1.5.jar whereas the  
java

+1.6 compiler was used to create json.jar.
===
--- /dev/null   
+++ /tools/redist/json/r2_20080312/json-1.5.jar Mon Jun 28 11:49:58 2010
Binary file, no diff available.

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Patch by T. Broyer - Fix issue 5065: Float.parseFloat and Double.parseDouble are too strict vali... (issue661802)

2010-06-28 Thread rice

Reviewers: Ray Ryan,

Description:
Patch by T. Broyer - Fix issue 5065: Float.parseFloat and
Double.parseDouble are too strict validating input (issue647802)


Please review this at http://gwt-code-reviews.appspot.com/661802/show

Affected files:
  M user/super/com/google/gwt/emul/java/lang/Number.java
  M user/test/com/google/gwt/emultest/java/lang/DoubleTest.java
  M user/test/com/google/gwt/emultest/java/lang/FloatTest.java


Index: user/super/com/google/gwt/emul/java/lang/Number.java
===
--- user/super/com/google/gwt/emul/java/lang/Number.java(revision 8320)
+++ user/super/com/google/gwt/emul/java/lang/Number.java(working copy)
@@ -345,7 +345,7 @@
 var floatRegex = @java.lang.Number::floatRegex;
 if (!floatRegex) {
   // Disallow '.' with no digits on either side
-  floatRegex = @java.lang.Number::floatRegex = /^\s*[+-]?((\d+\.?\d*)| 
(\.\d+))([eE][+-]?\d+)?\s*$/i;
+  floatRegex = @java.lang.Number::floatRegex = /^\s*[+-]?((\d+\.?\d*)| 
(\.\d+))([eE][+-]?\d+)?[dDfF]\s*$/i;

 }
 if (floatRegex.test(str)) {
   return parseFloat(str);
Index: user/test/com/google/gwt/emultest/java/lang/DoubleTest.java
===
--- user/test/com/google/gwt/emultest/java/lang/DoubleTest.java	(revision  
8320)
+++ user/test/com/google/gwt/emultest/java/lang/DoubleTest.java	(working  
copy)

@@ -151,5 +151,11 @@
 assertTrue(-2.56789e1 == Double.parseDouble("  -2.56789E1"));
 assertTrue(-2.56789e1 == Double.parseDouble("-2.56789e+01   "));
 assertTrue(-2.56789e1 == Double.parseDouble("   -2.56789E1   "));
+
+// Test that a float/double type suffix is allowed
+assertEquals(1.0d, Double.parseDouble("1.0f"), 0.0);
+assertEquals(1.0d, Double.parseDouble("1.0F"), 0.0);
+assertEquals(1.0d, Double.parseDouble("1.0d"), 0.0);
+assertEquals(1.0d, Double.parseDouble("1.0D"), 0.0);
   }
 }
Index: user/test/com/google/gwt/emultest/java/lang/FloatTest.java
===
--- user/test/com/google/gwt/emultest/java/lang/FloatTest.java	(revision  
8320)
+++ user/test/com/google/gwt/emultest/java/lang/FloatTest.java	(working  
copy)

@@ -78,6 +78,13 @@
 assertEquals(-1.5f, Float.parseFloat("-1.5"), 0.0);
 assertEquals(3.0f, Float.parseFloat("3."), 0.0);
 assertEquals(0.5f, Float.parseFloat(".5"), 0.0);
+
+// Test that a float/double type suffix is allowed
+assertEquals(1.0f, Float.parseFloat("1.0f"), 0.0);
+assertEquals(1.0f, Float.parseFloat("1.0F"), 0.0);
+assertEquals(1.0f, Float.parseFloat("1.0d"), 0.0);
+assertEquals(1.0f, Float.parseFloat("1.0D"), 0.0);
+
 // TODO(jat): it isn't safe to parse MAX/MIN_VALUE because we also  
want to
 // be able to get POSITIVE/NEGATIVE_INFINITY for out-of-range values,  
and

 // since all math in JS is done in double we can't rely on getting the


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r8325 committed - Make GWT depend on json-1.5.jar that contains 1.5 compatible bytecode ...

2010-06-28 Thread codesite-noreply

Revision: 8325
Author: amitman...@google.com
Date: Mon Jun 28 08:45:45 2010
Log: Make GWT depend on json-1.5.jar that contains 1.5 compatible bytecode  
instead

of json.jar that only contains 1.6 compatible bytecode.

Patch by: amitmanjhi
Review by: fabbott, rjrjr

http://code.google.com/p/google-web-toolkit/source/detail?r=8325

Modified:
 /trunk/bikeshed/build.xml
 /trunk/dev/build.xml
 /trunk/eclipse/user/.classpath
 /trunk/user/build.xml

===
--- /trunk/bikeshed/build.xml   Mon Jun  7 12:20:31 2010
+++ /trunk/bikeshed/build.xml   Mon Jun 28 08:45:45 2010
@@ -52,8 +52,6 @@
 
 
   
-location="${gwt.tools.redist}/json/r2_20080312/json.jar" />
-location="${gwt.root}/bikeshed/war/temp-libs/validation-api-1.0.0.GA.jar" />

 
 
   
===
--- /trunk/dev/build.xmlThu Jun 24 14:48:00 2010
+++ /trunk/dev/build.xmlMon Jun 28 08:45:45 2010
@@ -38,7 +38,7 @@
 location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />

 
 location="${gwt.tools.lib}/w3c/flute/flute-1.3-gg1.jar" />
-location="${gwt.tools}/redist/json/r2_20080312/json.jar" />
+location="${gwt.tools}/redist/json/r2_20080312/json-1.5.jar" />
 location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar" />
 location="${gwt.build.lib}/gwt-dev-${build.host.platform}.jar" />

 
===
--- /trunk/eclipse/user/.classpath  Thu Jun 24 14:48:00 2010
+++ /trunk/eclipse/user/.classpath  Mon Jun 28 08:45:45 2010
@@ -33,7 +33,7 @@
 	path="GWT_TOOLS/lib/htmlunit/htmlunit-r5607/htmlunit-r5607.jar"  
sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-r5607/htmlunit-r5607-sources.jar"/>
 	path="GWT_TOOLS/lib/htmlunit/htmlunit-r5607/htmlunit-core-js-r5607.jar"  
sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-r5607/htmlunit-core-js-r5607-sources.jar"/>
 	path="GWT_TOOLS/lib/jetty/jetty-7.0.2.v20100331/jetty-7.0.2.v20100331.jar"  
sourcepath="GWT_TOOLS/lib/jetty/jetty-7.0.2.v20100331/jetty-7.0.2.v20100331-src.zip"/>
-	path="GWT_TOOLS/redist/json/r2_20080312/json.jar"  
sourcepath="/GWT_TOOLS/redist/json/r2_20080312/json-src.jar"/>
+	path="GWT_TOOLS/redist/json/r2_20080312/json-1.5.jar"  
sourcepath="/GWT_TOOLS/redist/json/r2_20080312/json-src.jar"/>
 	path="GWT_TOOLS/lib/javax/validation/validation-api-1.0.0.GA.jar"  
sourcepath="/GWT_TOOLS/lib/javax/validation/validation-api-1.0.0.GA-sources.jar"/>


 
===
--- /trunk/user/build.xml   Thu Jun 24 14:48:00 2010
+++ /trunk/user/build.xml   Mon Jun 28 08:45:45 2010
@@ -73,7 +73,7 @@
 location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />

 
 location="${gwt.tools.lib}/w3c/flute/flute-1.3-gg1.jar" />
-location="${gwt.tools}/redist/json/r2_20080312/json.jar" />
+location="${gwt.tools}/redist/json/r2_20080312/json-1.5.jar" />
 location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar" />

 
   
@@ -106,7 +106,7 @@
 
 
 location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
-location="${gwt.tools}/redist/json/r2_20080312/json.jar" />
+location="${gwt.tools}/redist/json/r2_20080312/json-1.5.jar" />
 location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar" />

 
   

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Setting the default selection model in DefaultNodeInfo to null. Having a selection model per nod... (issue657801)

2010-06-28 Thread jlabanca

committed as r8326

http://gwt-code-reviews.appspot.com/657801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Fix external issue 5052 - JSONParser.parse exceptions with some unicode characters (issue659801)

2010-06-28 Thread rice

http://gwt-code-reviews.appspot.com/659801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r8326 committed - Setting the default selection model in DefaultNodeInfo to null. Having...

2010-06-28 Thread codesite-noreply

Revision: 8326
Author: jlaba...@google.com
Date: Mon Jun 28 08:48:57 2010
Log: Setting the default selection model in DefaultNodeInfo to null. Having  
a selection model per node is almost always incorrect. Users should supply  
a single Selectionmodel for the entire tree in most cases.


Review at http://gwt-code-reviews.appspot.com/657801

Review by: r...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=8326

Modified:
 /trunk/user/src/com/google/gwt/view/client/TreeViewModel.java

===
--- /trunk/user/src/com/google/gwt/view/client/TreeViewModel.java	Fri May  
28 08:44:36 2010
+++ /trunk/user/src/com/google/gwt/view/client/TreeViewModel.java	Mon Jun  
28 08:48:57 2010

@@ -46,7 +46,7 @@
  * @param cell the {...@link Cell} used to render the child values
  */
 public DefaultNodeInfo(AbstractListViewAdapter adapter, Cell  
cell) {

-  this(adapter, cell, new SingleSelectionModel(), null);
+  this(adapter, cell, null, null);
 }

 /**

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r8327 committed - Column should not use a singleton FieldUpdater because the Cell may ha...

2010-06-28 Thread codesite-noreply

Revision: 8327
Author: gwt.mirror...@gmail.com
Date: Mon Jun 28 12:12:17 2010
Log: Column should not use a singleton FieldUpdater because the Cell may  
hang on to the FieldUpdater. We now create a new instance each time.


Review at http://gwt-code-reviews.appspot.com/620803

Review by: r...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=8327

Modified:
 /trunk/user/src/com/google/gwt/user/cellview/client/Column.java

===
--- /trunk/user/src/com/google/gwt/user/cellview/client/Column.java	Mon  
Jun  7 12:20:31 2010
+++ /trunk/user/src/com/google/gwt/user/cellview/client/Column.java	Mon Jun  
28 12:12:17 2010

@@ -44,43 +44,36 @@

   /**
* A {...@link ValueUpdater} used by the {...@link Column} to delay the field  
update

-   * until after the view data has been set.
-   *
-   * @param  the type of data
+   * until after the view data has been set. After the view data has been  
set,

+   * the delay is revoked and we pass updates directly to the
+   * {...@link FieldUpdater}.
*/
-  private static class DelayedValueUpdater implements ValueUpdater {
-private C newValue;
+  private class DelayedValueUpdater implements ValueUpdater {
+
 private boolean hasNewValue;
-
-/**
- * Get the new value.
- *
- * @return the new value
- */
-public C getNewValue() {
-  return newValue;
+private boolean isDelayed = true;
+private C newValue;
+private final int rowIndex;
+private final T rowObject;
+
+public DelayedValueUpdater(int rowIndex, T rowObject) {
+  this.rowIndex = rowIndex;
+  this.rowObject = rowObject;
 }

-/**
- * Check if the value has been updated.
- *
- * @return true if updated, false if not
- */
-public boolean hasNewValue() {
-  return hasNewValue;
-}
-
-/**
- * Reset this updater so it can be reused.
- */
-public void reset() {
-  newValue = null;
-  hasNewValue = false;
+public void flush() {
+  isDelayed = false;
+  if (hasNewValue && fieldUpdater != null) {
+fieldUpdater.update(rowIndex, rowObject, newValue);
+  }
 }

 public void update(C value) {
   hasNewValue = true;
   newValue = value;
+  if (!isDelayed) {
+flush();
+  }
 }
   }

@@ -90,11 +83,6 @@

   protected Map viewDataMap = new HashMapObject>();


-  /**
-   * The {...@link DelayedValueUpdater} singleton.
-   */
-  private final DelayedValueUpdater delayedValueUpdater = new  
DelayedValueUpdater();

-
   public Column(Cell cell) {
 this.cell = cell;
   }
@@ -134,9 +122,10 @@
   NativeEvent event, ProvidesKey providesKey) {
 Object key = getKey(object, providesKey);
 Object viewData = getViewData(key);
-delayedValueUpdater.reset();
+DelayedValueUpdater valueUpdater = (fieldUpdater == null) ? null
+: new DelayedValueUpdater(index, object);
 Object newViewData = cell.onBrowserEvent(elem, getValue(object),  
viewData,

-event, fieldUpdater == null ? null : delayedValueUpdater);
+event, valueUpdater);

 // We have to save the view data before calling the field updater, or  
the

 // view data will not be available.
@@ -146,8 +135,8 @@
 }

 // Call the FieldUpdater after setting the view data.
-if (delayedValueUpdater.hasNewValue()) {
-  fieldUpdater.update(index, object,  
delayedValueUpdater.getNewValue());

+if (valueUpdater != null) {
+  valueUpdater.flush();
 }
   }

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Column should not use a singleton FieldUpdater because the Cell may hang on to the FieldUpdater.... (issue620803)

2010-06-28 Thread jlabanca

committed as r8327

http://gwt-code-reviews.appspot.com/620803/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Fix external issue 5052 - JSONParser.parse exceptions with some unicode characters (issue659801)

2010-06-28 Thread jat


http://gwt-code-reviews.appspot.com/659801/diff/9001/10003
File user/test/com/google/gwt/json/client/JSONTest.java (right):

http://gwt-code-reviews.appspot.com/659801/diff/9001/10003#newcode573
user/test/com/google/gwt/json/client/JSONTest.java:573: String
jsonString = "{ \"name\": \"miles\u2028da\u2029vis\",
\"ins\u2028tru\u2029ment\": \"trumpet\" }";
On 2010/06/25 22:18:17, tbroyer wrote:

I suggest removing the test on U+2028 and U+2029 on property names,

with a note

that it's not guaranteed because it fails in Safari 5 at a global

level (objects

just cannot have properties whose name contain those chars, the chars

are simply

stripped and you end up assigning another property, independent on

whether you

parse JSON or set a property on a JavaScript object)


I agree the test needs to pass on all browsers, including Safari 5 on
Windows/Mac.

http://gwt-code-reviews.appspot.com/659801/diff/19001/20001
File user/src/com/google/gwt/core/client/JsonUtils.java (right):

http://gwt-code-reviews.appspot.com/659801/diff/19001/20001#newcode114
user/src/com/google/gwt/core/client/JsonUtils.java:114: return eval('('
+ escaped + ')');
So if there is bogus JS here, it will just get a JavaScriptException,
right?  Should we put a try/catch and call throwJSONException if we
catch it?

http://gwt-code-reviews.appspot.com/659801/diff/19001/20003
File user/test/com/google/gwt/json/client/JSONTest.java (right):

http://gwt-code-reviews.appspot.com/659801/diff/19001/20003#newcode154
user/test/com/google/gwt/json/client/JSONTest.java:154:
Spaces.

http://gwt-code-reviews.appspot.com/659801/diff/19001/20003#newcode708
user/test/com/google/gwt/json/client/JSONTest.java:708:
Spaces.

http://gwt-code-reviews.appspot.com/659801/diff/19001/20003#newcode733
user/test/com/google/gwt/json/client/JSONTest.java:733: private
JSONValue parse(String jsonString) {
Rename this method to better reflect what it does.

http://gwt-code-reviews.appspot.com/659801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] proposing a hypothetically breaking change to gwt-servlet.jar: comments?

2010-06-28 Thread Freeland Abbott
So, this becomes a very breaking change if we say we want to go all the way
right: we would have to repackage

com.google.gwt.core.client.JavaScriptObject
com.google.gwt.core.client.GWT
com.google.gwt.core.client.JsArray
com.google.gwt.core.client.JavaScriptException
com.google.gwt.core.client.JsArray
com.google.gwt.core.client.UnsafeNativeLong
com.google.gwt.junit.client.GWTTestCase
com.google.gwt.junit.client.TimeoutException
com.google.gwt.i18n.client.HasDirection
com.google.gwt.rpc.client.ast.*
com.google.gwt.rpc.client.RpcService
com.google.gwt.user.client.rpc.RemoteService
com.google.gwt.user.client.rpc.AsyncCallback
com.google.gwt.user.client.rpc.GwtTransient
com.google.gwt.user.client.rpc.IsSerializable
com.google.gwt.user.client.rpc.*Exception


...which seems likely to break just about every GWT app anywhere.  Some we
could try to finagle around (GWT.isClient() might be in a shared GWT-analog,
different from the client one, for example), but most of those classes
really are shard and really are misnamed in today's packaging.

So, how breaking are we willing to be to correct that?




On Fri, Jun 25, 2010 at 12:08 PM, John Tamplin  wrote:

> On Fri, Jun 25, 2010 at 11:50 AM, Freeland Abbott wrote:
>
>> The last sentence was the only thing I was going to add here (except you
>> included it): I know my first cut is compilation-valid, which I think means
>> it has to be runtime-valid.
>
>
> Actually, in my personal app I ran into runtime failures on the server
> where only in some code paths did make some methods get called which
> instantiated non-server classes on the server which caused errors.  That is
> when I started being very rigorous about client/server/shared code, and I
> haven't had the problem since.  In the current state of GWT, that means not
> using a number of GWT classes that would actually be usable (though I do
> make an exception for Messages, which I generate bytecode on the server to
> share translations with the client).
>
>
>> I guess we have violent agreement that gwt-servlet should eventually
>> become just **/shared/** and **/server/**.  I can get us a lot closer to
>> that in one change, and then work to prune the exceptions down with more
>> incremental refactoring.  The alternative approach would be to refactor
>> first, leaving the blacklist in place (except probably in my personal
>> workspace) until that's done, and THEN move to whitelist.
>>
>
> I am ok with doing the whitelist first as long as that is just one step
> along the way to the final solution.  I do object if that is intended to be
> a "good enough for now" fix.
>
> --
> John A. Tamplin
> Software Engineer (GWT), Google
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] Replacing PagingListView.setPageStart/Size with PagingListView.setRange. Replacing CellListImpl... (issue614803)

2010-06-28 Thread jlabanca

Reviewers: jgw,

Description:
Replacing PagingListView.setPageStart/Size with PagingListView.setRange.
 Replacing CellListImpl with PagingListViewPresenter, which makes the
implementation easier to test and reuse.  Adding lots of tests.


Please review this at http://gwt-code-reviews.appspot.com/614803/show

Affected files:
  M bikeshed/src/com/google/gwt/app/place/AbstractRecordListActivity.java
  M  
bikeshed/src/com/google/gwt/sample/bikeshed/cookbook/client/MailRecipe.java
  M  
bikeshed/src/com/google/gwt/sample/bikeshed/cookbook/client/ScrollbarPager.java
  M  
bikeshed/src/com/google/gwt/sample/bikeshed/cookbook/client/SimplePager.java
  M  
bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpenseDetails.java

  M bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpenseList.java
  M  
bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseList.java
  M  
bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileReportList.java

  M user/src/com/google/gwt/app/place/AbstractRecordListActivity.java
  M user/src/com/google/gwt/user/cellview/client/AbstractPager.java
  M user/src/com/google/gwt/user/cellview/client/CellBrowser.java
  M user/src/com/google/gwt/user/cellview/client/CellList.java
  D user/src/com/google/gwt/user/cellview/client/CellListImpl.java
  M user/src/com/google/gwt/user/cellview/client/CellTable.java
  M user/src/com/google/gwt/user/cellview/client/CellTreeNodeView.java
  M user/src/com/google/gwt/user/cellview/client/PageSizePager.java
  A  
user/src/com/google/gwt/user/cellview/client/PagingListViewPresenter.java

  M user/src/com/google/gwt/user/cellview/client/SimplePager.java
  M user/src/com/google/gwt/view/client/ListView.java
  M user/src/com/google/gwt/view/client/PagingListView.java
  A user/test/com/google/gwt/user/cellview/CellViewSuite.java
  A user/test/com/google/gwt/user/cellview/client/AbstractPagerTest.java
  A user/test/com/google/gwt/user/cellview/client/ColumnTest.java
  A  
user/test/com/google/gwt/user/cellview/client/PagingListViewPresenterTest.java

  A user/test/com/google/gwt/user/cellview/client/SimplePagerTest.java
  M user/test/com/google/gwt/view/ViewSuite.java
  A user/test/com/google/gwt/view/client/ListViewAdapterTest.java
  M user/test/com/google/gwt/view/client/MockPagingListView.java
  A user/test/com/google/gwt/view/client/MockSelectionModel.java


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] proposing a hypothetically breaking change to gwt-servlet.jar: comments?

2010-06-28 Thread John Tamplin
On Mon, Jun 28, 2010 at 3:57 PM, Freeland Abbott  wrote:

> So, this becomes a very breaking change if we say we want to go all the way
> right: we would have to repackage
>
> com.google.gwt.core.client.JavaScriptObject
> com.google.gwt.core.client.JsArray
> com.google.gwt.core.client.JavaScriptException
> com.google.gwt.core.client.JsArray
> com.google.gwt.junit.client.GWTTestCase
> com.google.gwt.rpc.client.RpcService
> com.google.gwt.user.client.rpc.RemoteService
> com.google.gwt.user.client.rpc.AsyncCallback
>
>
What server-side classes can use any of these at all?  They all have
significant GWT magic behind them, and would require at a minimum
significant bytecode rewriting/generation to use on the server.

-- 
John A. Tamplin
Software Engineer (GWT), Google

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] Re: Add a simple remote log handler, and update the sample to use it (issue626802)

2010-06-28 Thread unnurg


http://gwt-code-reviews.appspot.com/626802/diff/1/4
File samples/logexample/war/WEB-INF/web.xml (right):

http://gwt-code-reviews.appspot.com/626802/diff/1/4#newcode7
samples/logexample/war/WEB-INF/web.xml:7:
com.google.gwt.sample.logexample.server.LoggingServiceImpl
On 2010/06/25 04:22:30, fredsa wrote:

It's confusing to have both LoggingSerivceImpl and

RemoteLoggingSerivceImpl.

Renaming LoggingSerivceImpl to SampleLoggingSerivceImpl or even
RemoteLoggingSerivceImpl (same name as the other

RemoteLoggingSerivceImpl, but

in a different package) would be more straightforward.


Agreed - following up with a CL to clean up the remote logging vs.
"triggering logging on the server"

http://gwt-code-reviews.appspot.com/626802/diff/1/4#newcode12
samples/logexample/war/WEB-INF/web.xml:12:
/logexample/log
On 2010/06/25 04:22:30, fredsa wrote:

It's hard to tell from the url-pattern which logger in just part of

the example

and which is the official remote logger. Suggest changing

"/logexample/log" to

something else, like "/logexample/sample_logger"



Agreed - sending a follow up CL later today

http://gwt-code-reviews.appspot.com/626802/diff/1/8
File
user/src/com/google/gwt/logging/server/RemoteLoggingServiceImpl.java
(right):

http://gwt-code-reviews.appspot.com/626802/diff/1/8#newcode26
user/src/com/google/gwt/logging/server/RemoteLoggingServiceImpl.java:26:
* Server side code for the remote log handlers.
On 2010/06/25 04:22:30, fredsa wrote:

handlers -> handler


Done.

http://gwt-code-reviews.appspot.com/626802/diff/1/8#newcode38
user/src/com/google/gwt/logging/server/RemoteLoggingServiceImpl.java:38:
logger.severe(failureMessage);
On 2010/06/25 04:22:30, fredsa wrote:

The stack trace for e is not logged, but should be.


removed - see below

http://gwt-code-reviews.appspot.com/626802/diff/1/8#newcode42
user/src/com/google/gwt/logging/server/RemoteLoggingServiceImpl.java:42:
System.err.println(failureMessage);
On 2010/06/25 04:22:30, fredsa wrote:

If logging is broken, it's possible that line 38 would throw another

exception,

preventing System.err.println from being called. Then again, that

exception

would bubble up in result is some error logging higher up the stack,

in which

case our System.err.prinln might be considered spammy.


Fair enough - I returned this code to the way it was in the incubator -
and am just printing to stderr.

http://gwt-code-reviews.appspot.com/626802/diff/1/11
File user/src/com/google/gwt/logging/shared/SerializableLogRecord.java
(right):

http://gwt-code-reviews.appspot.com/626802/diff/1/11#newcode35
user/src/com/google/gwt/logging/shared/SerializableLogRecord.java:35:
private Throwable thrown;
On 2010/06/25 04:22:30, fredsa wrote:

I don't think you want to include Throwable in the fields serialized

over RPC as

it will blow out the serialization/deserialization code in the

compiled output.

A serialized representation of StackTraceElement[] would be better.


Done.

http://gwt-code-reviews.appspot.com/626802/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] proposing a hypothetically breaking change to gwt-servlet.jar: comments?

2010-06-28 Thread Freeland Abbott
GWT is imported by
com/google/gwt/user/*server*/rpc/impl/SerializabilityUtil.java
(for isClient()), com/google/gwt/valuestore/*shared*/impl/RecordJsoImpl.java
(for isScript()),
com/google/gwt/rpc/*client-but-becomes-shared*/impl/SimplePayloadSink.java
(for isScript()), and
com/google/gwt/rpc/*client-but-becomes-shared*/impl/EscapeUtil.java
(for isClient()).

JSO and JsArray are imported by ClientSerializationStream{Reader,Writer},
which are in client now but used by server-side code, so naively they'd move
to be shared.  They don't make a lot of sense as server, I guess; I imagine
they're being overridden, and some third interface type could be introduced
instead.

GWTTestCase is referenced from the junit server packages; it's also
legitimately used in java context in a test, so I think making it "shared"
is sensible.

RpcService and RemoteService are marker interfaces implemented by
server-side classes.  We could probably work out a way to leave
AsyncCallback in client, though; I'd have to track down again what touched
it from server-side.



So, a quick pushback still leaves you with GWTTestCase, RpcService,
RemoteService, and at least parts of GWT.  Which still has a wide impact.





On Mon, Jun 28, 2010 at 4:10 PM, John Tamplin  wrote:

> On Mon, Jun 28, 2010 at 3:57 PM, Freeland Abbott wrote:
>
>> So, this becomes a very breaking change if we say we want to go all the
>> way right: we would have to repackage
>>
>> com.google.gwt.core.client.JavaScriptObject
>> com.google.gwt.core.client.JsArray
>> com.google.gwt.core.client.JavaScriptException
>> com.google.gwt.core.client.JsArray
>> com.google.gwt.junit.client.GWTTestCase
>> com.google.gwt.rpc.client.RpcService
>> com.google.gwt.user.client.rpc.RemoteService
>> com.google.gwt.user.client.rpc.AsyncCallback
>>
>>
> What server-side classes can use any of these at all?  They all have
> significant GWT magic behind them, and would require at a minimum
> significant bytecode rewriting/generation to use on the server.
>
> --
> John A. Tamplin
> Software Engineer (GWT), Google
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] Re: Add a simple remote log handler, and update the sample to use it (issue626802)

2010-06-28 Thread unnurg

http://gwt-code-reviews.appspot.com/626802/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Add a simple remote log handler, and update the sample to use it (issue626802)

2010-06-28 Thread unnurg

http://gwt-code-reviews.appspot.com/626802/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Add a simple remote log handler, and update the sample to use it (issue626802)

2010-06-28 Thread fredsa

LGTM

http://gwt-code-reviews.appspot.com/626802/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Replacing PagingListView.setPageStart/Size with PagingListView.setRange. Replacing CellListImpl... (issue614803)

2010-06-28 Thread jlabanca

http://gwt-code-reviews.appspot.com/614803/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Replacing PagingListView.setPageStart/Size with PagingListView.setRange. Replacing CellListImpl... (issue614803)

2010-06-28 Thread jlabanca

Removed ColumnTest because it is failing and this change doesn't touch
Column.  ColumnTest, plus tests for the widgets, will be added in a
later patch.

http://gwt-code-reviews.appspot.com/614803/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] proposing a hypothetically breaking change to gwt-servlet.jar: comments?

2010-06-28 Thread Lex Spoon
On Mon, Jun 28, 2010 at 3:57 PM, Freeland Abbott  wrote:
>
> So, how breaking are we willing to be to correct that?
>

My knee-jerk reaction is that we don't want to do a lot of breaking just to
tidy up the definition of gwt-servlet. The only benefit is to reduce the
size of the white list, right? That's a small benefit.

Nonetheless, we still would benefit to make gwt-servlet be based on a
whitelist rather than a blacklist. It would immediately shrink the jar size,
and it would prevent us from accidentally sprawling it even larger.

-Lex

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] Re: Fix external issue 5052 - JSONParser.parse exceptions with some unicode characters (issue659801)

2010-06-28 Thread t . broyer


http://gwt-code-reviews.appspot.com/659801/diff/9001/10001
File user/src/com/google/gwt/core/client/JsonUtils.java (right):

http://gwt-code-reviews.appspot.com/659801/diff/9001/10001#newcode89
user/src/com/google/gwt/core/client/JsonUtils.java:89: out[0xad] =
'\\u00ad'; // Soft hyphen
On 2010/06/25 22:18:17, tbroyer wrote:


Just like in "plain JavaScript", the following would actually create

an "ab"

property with no trace of  (tested in Safari 5 on Windows):
var o = {};
o['a\u2028b'] = 'c';
That's a bug in JavaScriptCore that can hardly be worked around, so I

suggest

not doing anything (the probability that those chars be used in

property names

is rather low, and they are correctly treated in string values)



I couldn't reproduce the problem (using \u0601 for ) in either

of Firefox

(3.6.4), Chrome (6.0.447.0 dev), IE (8) or Opera (10.60 beta).


Do not reproduce in Safari 5 (7533.16) on WinXP, using your test code.
Also tried encodeURI(JSON.stringify(o)). I think I got abused by the JS
console which do not escape the char when you just type "o" on the
prompt and inspect the object (when setting both "ab" and "a\u2028b", it
displays an object with 2 "ab" keys, but encodeURI(JSON.stringify(o))
reveals the U+2028. Sorry for the confusion.

http://gwt-code-reviews.appspot.com/659801/diff/19001/20001#newcode114
user/src/com/google/gwt/core/client/JsonUtils.java:114: out[0x206b] =
'\\u206b'; // Activate symmetric swapping
On 2010/06/28 19:16:19, jat wrote:

So if there is bogus JS here, it will just get a JavaScriptException,

right?

Should we put a try/catch and call throwJSONException if we catch it?


That'd be a breaking change, right?

http://gwt-code-reviews.appspot.com/659801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r8328 committed - Add a simple remote log handler, and update the sample to use it...

2010-06-28 Thread codesite-noreply

Revision: 8328
Author: unn...@google.com
Date: Mon Jun 28 12:35:42 2010
Log: Add a simple remote log handler, and update the sample to use it

Review at http://gwt-code-reviews.appspot.com/626802

Review by: fre...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=8328

Added:
 /trunk/samples/logexample/war/WEB-INF
 /trunk/samples/logexample/war/WEB-INF/web.xml
 /trunk/user/src/com/google/gwt/logging/client/SimpleRemoteLogHandler.java
 /trunk/user/src/com/google/gwt/logging/server
 /trunk/user/src/com/google/gwt/logging/server/RemoteLoggingServiceImpl.java
 /trunk/user/src/com/google/gwt/logging/shared
 /trunk/user/src/com/google/gwt/logging/shared/RemoteLoggingService.java
  
/trunk/user/src/com/google/gwt/logging/shared/RemoteLoggingServiceAsync.java

 /trunk/user/src/com/google/gwt/logging/shared/SerializableLogRecord.java
 /trunk/user/src/com/google/gwt/logging/shared/SerializableThrowable.java
Modified:
  
/trunk/samples/logexample/src/com/google/gwt/sample/logexample/client/HandlerController.java
  
/trunk/samples/logexample/src/com/google/gwt/sample/logexample/client/HandlerController.ui.xml

 /trunk/user/src/com/google/gwt/logging/Logging.gwt.xml
 /trunk/user/src/com/google/gwt/logging/client/LogConfiguration.java

===
--- /dev/null
+++ /trunk/samples/logexample/war/WEB-INF/web.xml   Mon Jun 28 12:35:42 2010
@@ -0,0 +1,31 @@
+
+
+
+  
+  
+logServlet
+ 
com.google.gwt.sample.logexample.server.LoggingServiceImpl

+  
+
+  
+logServlet
+/logexample/log
+  
+
+  
+remoteLoggingServlet
+ 
com.google.gwt.logging.server.RemoteLoggingServiceImpl

+  
+
+  
+remoteLoggingServlet
+logexample/remote_logging
+  
+
+
+  
+  
+LogExample.html
+  
+
+
===
--- /dev/null
+++  
/trunk/user/src/com/google/gwt/logging/client/SimpleRemoteLogHandler.java	 
Mon Jun 28 12:35:42 2010

@@ -0,0 +1,79 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may  
not
+ * use this file except in compliance with the License. You may obtain a  
copy of

+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT

+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations  
under

+ * the License.
+ */
+
+package com.google.gwt.logging.client;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.logging.shared.RemoteLoggingService;
+import com.google.gwt.logging.shared.RemoteLoggingServiceAsync;
+import com.google.gwt.logging.shared.SerializableLogRecord;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+import java.util.logging.Handler;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+
+/**
+ * A very simple handler which sends messages to the server via GWT RPC to  
be
+ * logged. Note that this logger should not be used in production. It does  
not

+ * do any intelligent batching of RPC's, nor does it disable when the RPC
+ * calls fail repeatedly.
+ */
+public final class SimpleRemoteLogHandler extends Handler {
+  private static Logger logger =
+Logger.getLogger(SimpleRemoteLogHandler.class.getName());
+
+  class DefaultCallback implements AsyncCallback {
+public void onFailure(Throwable caught) {
+  logger.severe("Remote logging failed: " + caught.toString());
+}
+public void onSuccess(String result) {
+  if (!result.isEmpty()) {
+logger.severe("Remote logging failed: " + result);
+  } else {
+logger.finest("Remote logging message acknowledged");
+  }
+}
+  }
+
+  private RemoteLoggingServiceAsync service;
+  private AsyncCallback callback;
+
+  public SimpleRemoteLogHandler() {
+service = (RemoteLoggingServiceAsync)  
GWT.create(RemoteLoggingService.class);

+this.callback = new DefaultCallback();
+  }
+
+  @Override
+  public void close() {
+// No action needed
+  }
+
+  @Override
+  public void flush() {
+// No action needed
+  }
+
+  @Override
+  public void publish(LogRecord record) {
+if (record.getLoggerName().equals(logger.getName())) {
+  // We don't want to propagate our own messages to the server since it
+  // would lead to an infinite loop.
+  return;
+}
+service.logOnServer(new SerializableLogRecord(record), callback);
+  }
+}
===
--- /dev/null
+++  
/trunk/user/src/com/google/gwt/logging/server/RemoteLoggingServiceImpl.java	 
Mon Jun 28 12:35:42 2010

@@ -0,0 +1,47 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may  
not
+ * use this file except in compliance with the License. You may obtain a  
copy of

+ * the License at
+ *
+ * h