Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 397545

Summary: Java Remote Object throws exception if "set" is called twice for same property
Product: [RT] RAP Reporter: Tim Buschtoens <tbuschto>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: tbuschto
Version: 2.0   
Target Milestone: 2.0 RC1   
Hardware: All   
OS: All   
Whiteboard:

Description Tim Buschtoens CLA 2013-01-07 05:22:52 EST
Calling RemoteObject#set more than once for the same property, on the same instance, in the same request causes an Exception:

java.lang.IllegalArgumentException: Duplicate property size
	at org.eclipse.rap.rwt.internal.protocol.Operation.appendProperty(Operation.java:45)
	at org.eclipse.rap.rwt.internal.protocol.ProtocolMessageWriter.appendSet(ProtocolMessageWriter.java:82)
	at org.eclipse.rap.rwt.internal.protocol.ProtocolMessageWriter.appendSet(ProtocolMessageWriter.java:77)
	at org.eclipse.rap.rwt.internal.remote.RemoteObjectImpl$6.render(RemoteObjectImpl.java:93)
	at org.eclipse.rap.rwt.internal.remote.RemoteObjectImpl.render(RemoteObjectImpl.java:164)
	at org.eclipse.rap.rwt.internal.remote.RemoteObjectLifeCycleAdapter.render(RemoteObjectLifeCycleAdapter.java:34)
	at org.eclipse.swt.internal.widgets.displaykit.DisplayLCA.render(DisplayLCA.java:125)
	at org.eclipse.rap.rwt.internal.lifecycle.Render.execute(Render.java:29)
	at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.continueLifeCycle(RWTLifeCycle.java:164)
	at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLifeCycle.java:238)
	at org.eclipse.swt.widgets.Display.sleep(Display.java:1179)
	at com.eclipsesource.widgets.ckeditor.demo.CkEditorDemo.runReadAndDispatchLoop(CkEditorDemo.java:76)
	at com.eclipsesource.widgets.ckeditor.demo.CkEditorDemo.createUI(CkEditorDemo.java:69)
	at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:186)
	at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:298)
	at java.lang.Thread.run(Unknown Source)
	at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:104)
Comment 1 Ralf Sternberg CLA 2013-01-07 10:16:29 EST
Fixed with commit eded1fe806199f42ded2096a16f308afa606c4d7.

It's legal to call set sequentially for the same property on a remote object, e.g. when the same value changes multiple times in a row.
When no other operation is rendered meanwhile, the previous value will be overridden, otherwise a new set operation will be created.