Designer crashes on spaces in SmartGWT item name

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Designer crashes on spaces in SmartGWT item name

Postby Maksym » Wed May 19, 2010 4:36 am

GWT Designer crashes while trying to input name with spaces for SmartGWT textitem (may be for other controls also, didn't check).
Of course its not correct to input such name but designer entirely crashes on this input w/o saving editor. I guess this is minor problem but not user-friendly behavior.

Code: Select all
com.instantiations.designer.core.utils.exception.DesignerException: 307 (Exception during constructor evaluation). new TextItem("newTextItem 6") TextItem(String) {newTextItem 6} java.lang.AssertionError: Invalid FormItem name. Cannot use spaces in FormItem name.
   at com.smartgwt.client.widgets.form.fields.FormItem.setName(FormItem.java:3331)
   at com.smartgwt.client.widgets.form.fields.TextItem.<init>(TextItem.java:83)
   at com.instantiations.designer.core.eval.evaluators.InvocationEvaluator.createConstructorProblemException(InvocationEvaluator.java:597)
   at com.instantiations.designer.core.eval.evaluators.InvocationEvaluator.evaluate(InvocationEvaluator.java:257)
   at com.instantiations.designer.core.eval.evaluators.InvocationEvaluator.evaluate(InvocationEvaluator.java:71)
   at com.instantiations.designer.core.eval.ASTEvaluationEngine.evaluate0(ASTEvaluationEngine.java:96)
   at com.instantiations.designer.core.eval.ASTEvaluationEngine.evaluate(ASTEvaluationEngine.java:42)
   at com.instantiations.designer.core.model.JavaInfoEvaluationHelper.evaluateExpression(JavaInfoEvaluationHelper.java:573)
   at com.instantiations.designer.core.model.JavaInfoEvaluationHelper.evaluate(JavaInfoEvaluationHelper.java:448)
   at com.instantiations.designer.core.model.JavaInfo$8.postVisit(JavaInfo.java:1016)
   at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils$1.intercept(ExecutionFlowUtils.java:345)
   at org.eclipse.jdt.core.dom.ASTVisitor$$EnhancerByCGLIB$$81f04a19.postVisit(<generated>)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2483)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
   at org.eclipse.jdt.core.dom.ArrayInitializer.accept0(ArrayInitializer.java:132)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2528)
   at org.eclipse.jdt.core.dom.ArrayCreation.accept0(ArrayCreation.java:213)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
   at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:245)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2528)
   at org.eclipse.jdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:144)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visitStatement0(ExecutionFlowUtils.java:301)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visitStatement(ExecutionFlowUtils.java:264)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visitStatement0(ExecutionFlowUtils.java:284)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visitStatement(ExecutionFlowUtils.java:264)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visit(ExecutionFlowUtils.java:222)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visit(ExecutionFlowUtils.java:201)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visit(ExecutionFlowUtils.java:170)
   at com.instantiations.designer.core.model.JavaInfo.refresh_create(JavaInfo.java:1069)
   at com.instantiations.designer.core.model.ObjectInfo.refreshCreate0(ObjectInfo.java:450)
   at com.instantiations.designer.core.model.ObjectInfo.access$0(ObjectInfo.java:446)
   at com.instantiations.designer.core.model.ObjectInfo$4.run(ObjectInfo.java:419)
   at com.instantiations.designer.core.utils.execution.ExecutionUtils.runDesignTime(ExecutionUtils.java:116)
   at com.instantiations.designer.core.model.ObjectInfo.refresh(ObjectInfo.java:417)
   at com.instantiations.designer.core.model.ObjectInfo.endEdit(ObjectInfo.java:384)
   at com.instantiations.designer.core.utils.execution.ExecutionUtils.run(ExecutionUtils.java:270)
   at com.instantiations.designer.core.model.property.GenericPropertyImpl.setValue(GenericPropertyImpl.java:185)
   at com.instantiations.designer.core.model.property.editor.string.StringPropertyEditor.setEditorText(StringPropertyEditor.java:66)
   at com.instantiations.designer.core.model.property.editor.AbstractTextPropertyEditor.toProperty(AbstractTextPropertyEditor.java:163)
   at com.instantiations.designer.core.model.property.editor.AbstractTextPropertyEditor.handleKeyPressed(AbstractTextPropertyEditor.java:117)
   at com.instantiations.designer.core.model.property.editor.AbstractTextPropertyEditor.access$0(AbstractTextPropertyEditor.java:114)
   at com.instantiations.designer.core.model.property.editor.AbstractTextPropertyEditor$1.keyPressed(AbstractTextPropertyEditor.java:46)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:155)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
   at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040)
   at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1427)
   at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036)
   at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368)
   at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053)
   at org.eclipse.swt.widgets.Text.WM_CHAR(Text.java:2175)
   at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946)
   at org.eclipse.swt.widgets.Text.windowProc(Text.java:2170)
   at org.eclipse.swt.widgets.Display.windowProc(Display.java:4619)
   at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
   at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2411)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3501)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
   at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
   at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
   at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
   at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
   at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Caused by: java.lang.AssertionError: Invalid FormItem name. Cannot use spaces in FormItem name.
   at com.smartgwt.client.widgets.form.fields.FormItem.setName(FormItem.java:3331)
   at com.smartgwt.client.widgets.form.fields.TextItem.<init>(TextItem.java:83)
   at sun.reflect.GeneratedConstructorAccessor94.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
   at java.lang.reflect.Constructor.newInstance(Unknown Source)
   at com.instantiations.designer.core.eval.evaluators.InvocationEvaluator.evaluate(InvocationEvaluator.java:251)
   ... 82 more

Full context stack trace:
com.instantiations.designer.core.utils.exception.DesignerException: 0 (Wrapper).
   at com.instantiations.designer.core.model.JavaInfo$8.postVisit(JavaInfo.java:1024)
   at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils$1.intercept(ExecutionFlowUtils.java:345)
   at org.eclipse.jdt.core.dom.ASTVisitor$$EnhancerByCGLIB$$81f04a19.postVisit(<generated>)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2483)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
   at org.eclipse.jdt.core.dom.ArrayInitializer.accept0(ArrayInitializer.java:132)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2528)
   at org.eclipse.jdt.core.dom.ArrayCreation.accept0(ArrayCreation.java:213)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
   at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:245)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2528)
   at org.eclipse.jdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:144)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visitStatement0(ExecutionFlowUtils.java:301)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visitStatement(ExecutionFlowUtils.java:264)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visitStatement0(ExecutionFlowUtils.java:284)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visitStatement(ExecutionFlowUtils.java:264)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visit(ExecutionFlowUtils.java:222)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visit(ExecutionFlowUtils.java:201)
   at com.instantiations.designer.core.eval.ExecutionFlowUtils.visit(ExecutionFlowUtils.java:170)
   at com.instantiations.designer.core.model.JavaInfo.refresh_create(JavaInfo.java:1069)
   at com.instantiations.designer.core.model.ObjectInfo.refreshCreate0(ObjectInfo.java:450)
   at com.instantiations.designer.core.model.ObjectInfo.access$0(ObjectInfo.java:446)
   at com.instantiations.designer.core.model.ObjectInfo$4.run(ObjectInfo.java:419)
   at com.instantiations.designer.core.utils.execution.ExecutionUtils.runDesignTime(ExecutionUtils.java:116)
   at com.instantiations.designer.core.model.ObjectInfo.refresh(ObjectInfo.java:417)
   at com.instantiations.designer.core.model.ObjectInfo.endEdit(ObjectInfo.java:384)
   at com.instantiations.designer.core.utils.execution.ExecutionUtils.run(ExecutionUtils.java:270)
   at com.instantiations.designer.core.model.property.GenericPropertyImpl.setValue(GenericPropertyImpl.java:185)
   at com.instantiations.designer.core.model.property.editor.string.StringPropertyEditor.setEditorText(StringPropertyEditor.java:66)
   at com.instantiations.designer.core.model.property.editor.AbstractTextPropertyEditor.toProperty(AbstractTextPropertyEditor.java:163)
   at com.instantiations.designer.core.model.property.editor.AbstractTextPropertyEditor.handleKeyPressed(AbstractTextPropertyEditor.java:117)
   at com.instantiations.designer.core.model.property.editor.AbstractTextPropertyEditor.access$0(AbstractTextPropertyEditor.java:114)
   at com.instantiations.designer.core.model.property.editor.AbstractTextPropertyEditor$1.keyPressed(AbstractTextPropertyEditor.java:46)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:155)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
   at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040)
   at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1427)
   at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036)
   at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368)
   at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053)
   at org.eclipse.swt.widgets.Text.WM_CHAR(Text.java:2175)
   at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946)
   at org.eclipse.swt.widgets.Text.windowProc(Text.java:2170)
   at org.eclipse.swt.widgets.Display.windowProc(Display.java:4619)
   at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
   at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2411)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3501)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
   at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
   at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
   at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
   at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
   at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Caused by: com.instantiations.designer.core.utils.exception.DesignerException: 0 (Wrapper).
   at com.instantiations.designer.core.model.JavaInfoEvaluationHelper.evaluate(JavaInfoEvaluationHelper.java:505)
   at com.instantiations.designer.core.model.JavaInfo$8.postVisit(JavaInfo.java:1016)
   ... 76 more
Caused by: org.apache.commons.lang.exception.NestableError: new TextItem("newTextItem 6")
   at com.instantiations.designer.core.eval.ASTEvaluationEngine.evaluate(ASTEvaluationEngine.java:52)
   at com.instantiations.designer.core.model.JavaInfoEvaluationHelper.evaluateExpression(JavaInfoEvaluationHelper.java:573)
   at com.instantiations.designer.core.model.JavaInfoEvaluationHelper.evaluate(JavaInfoEvaluationHelper.java:448)
   ... 77 more
Caused by: com.instantiations.designer.core.utils.exception.DesignerException: 307 (Exception during constructor evaluation). new TextItem("newTextItem 6") TextItem(String) {newTextItem 6} java.lang.AssertionError: Invalid FormItem name. Cannot use spaces in FormItem name.
   at com.smartgwt.client.widgets.form.fields.FormItem.setName(FormItem.java:3331)
   at com.smartgwt.client.widgets.form.fields.TextItem.<init>(TextItem.java:83)
   at com.instantiations.designer.core.eval.evaluators.InvocationEvaluator.createConstructorProblemException(InvocationEvaluator.java:597)
   at com.instantiations.designer.core.eval.evaluators.InvocationEvaluator.evaluate(InvocationEvaluator.java:257)
   at com.instantiations.designer.core.eval.evaluators.InvocationEvaluator.evaluate(InvocationEvaluator.java:71)
   at com.instantiations.designer.core.eval.ASTEvaluationEngine.evaluate0(ASTEvaluationEngine.java:96)
   at com.instantiations.designer.core.eval.ASTEvaluationEngine.evaluate(ASTEvaluationEngine.java:42)
   ... 79 more
Caused by: java.lang.AssertionError: Invalid FormItem name. Cannot use spaces in FormItem name.
   at com.smartgwt.client.widgets.form.fields.FormItem.setName(FormItem.java:3331)
   at com.smartgwt.client.widgets.form.fields.TextItem.<init>(TextItem.java:83)
   at sun.reflect.GeneratedConstructorAccessor94.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
   at java.lang.reflect.Constructor.newInstance(Unknown Source)
   at com.instantiations.designer.core.eval.evaluators.InvocationEvaluator.evaluate(InvocationEvaluator.java:251)
   ... 82 more
Maksym
 
Posts: 6
Joined: Tue May 11, 2010 10:04 am

Re: Designer crashes on spaces in SmartGWT item name

Postby Eric Clayberg » Wed May 19, 2010 5:55 am

I don't see that behavior. When I try this, SmartGWT throws an exception which is caught and reported by Designer. Designer did not crash and the editor did not close. The editor is still fully saveable and you can even use Undo to revert back to the state prior to entering the bad value.

Now that we know that SmartGWT exhibits such bad behavior in this case (the JavaDoc for setName() does not mention this restriction), we can add a filter to ignore bad values at the editor level.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Designer crashes on spaces in SmartGWT item name

Postby Maksym » Wed May 19, 2010 6:40 am

Just rechecked.
Yes your're right, no data lost. Exception window confused me.
Maksym
 
Posts: 6
Joined: Tue May 11, 2010 10:04 am

Re: Designer crashes on spaces in SmartGWT item name

Postby Eric Clayberg » Thu May 20, 2010 11:14 am

In the latest v7.5 build we will now automatically replace the spaces with underscores.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Designer crashes on spaces in SmartGWT item name

Postby sjivan » Wed May 26, 2010 8:34 pm

I'll update the Javadocs to indicate that spaces are not allowed for FormItem names (and also Canvas ID's).

Sanjiv
sjivan
 
Posts: 9
Joined: Thu Feb 07, 2008 8:25 am
Location: Boston

Re: Designer crashes on spaces in SmartGWT item name

Postby Eric Clayberg » Thu May 27, 2010 3:54 am

Excellent! Thank you.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest