Servoy8.3.0, StringBuffer append is not recognised as func..

Questions, tips and tricks and techniques for scripting in Servoy

Servoy8.3.0, StringBuffer append is not recognised as func..

Postby danny.richadson » Tue May 08, 2018 3:03 pm

I haved switch from Servoy 8.2.3 to Servoy8.3.0. After it a object of type StringBuffer no longer accept append as a function. The error is: TypeError: Cannot find function append in object .
The definition of the variable is: var _sSqlTarget = new java.lang.StringBuffer();

The java version used is: jre1.8.0_151

The whole stacktrace is:
=>
{fileName:"<some file>",lineNumber:1521,message:"Cannot find function append in object .",name:"TypeError",rhinoException:{stackTrace:[org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:4224),org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:4202),org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:4235),org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:4254),org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:4326),org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2562),org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2544),org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1330),org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815),org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109),org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:399),org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3534),org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107),com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:665),com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:394),com.servoy.j2db.BasicFormController.executeFunction(BasicFormController.java:1063),com.servoy.j2db.BasicFormController.executeFunction(BasicFormController.java:945),com.servoy.j2db.BasicFormController.executeFunction(BasicFormController.java:812),com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:1041),com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:299),com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:265),com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:233),com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:228),com.servoy.j2db.smart.dataui.AbstractScriptButton$2.actionPerformed(AbstractScriptButton.java:660),javax.swing.AbstractButton.fireActionPerformed(Unknown Source),javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source),javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source),javax.swing.DefaultButtonModel.setPressed(Unknown Source),javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source),java.awt.AWTEventMulticaster.mouseReleased(Unknown Source),java.awt.Component.processMouseEvent(Unknown Source),javax.swing.JComponent.processMouseEvent(Unknown Source),java.awt.Component.processEvent(Unknown Source),java.awt.Container.processEvent(Unknown Source),java.awt.Component.dispatchEventImpl(Unknown Source),java.awt.Container.dispatchEventImpl(Unknown Source),java.awt.Component.dispatchEvent(Unknown Source),java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source),java.awt.LightweightDispatcher.processMouseEvent(Unknown Source),java.awt.LightweightDispatcher.dispatchEvent(Unknown Source),java.awt.Container.dispatchEventImpl(Unknown Source),java.awt.Window.dispatchEventImpl(Unknown Source),java.awt.Component.dispatchEvent(Unknown Source),java.awt.EventQueue.dispatchEventImpl(Unknown Source),java.awt.EventQueue.access$500(Unknown Source),java.awt.EventQueue$3.run(Unknown Source),java.awt.EventQueue$3.run(Unknown Source),java.security.AccessController.doPrivileged(Native Method),java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source),java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source),java.awt.EventQueue$4.run(Unknown Source),java.awt.EventQueue$4.run(Unknown Source),java.security.AccessController.doPrivileged(Native Method),java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source),java.awt.EventQueue.dispatchEvent(Unknown Source),java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source),java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source),java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source),java.awt.EventDispatchThread.pumpEvents(Unknown Source),java.awt.EventDispatchThread.pumpEvents(Unknown Source),java.awt.EventDispatchThread.run(Unknown Source)]},stack:" at <some_file>:1521 (parse)
"}
Danny Richardson
e-mail: info@danson.nl
User avatar
danny.richadson
 
Posts: 30
Joined: Wed Oct 17, 2007 3:46 pm
Location: Netherlands

Re: Servoy8.3.0, StringBuffer append is not recognised as fu

Postby jcompagner » Tue May 08, 2018 5:36 pm

That is because of the Rhino update:

https://github.com/mozilla/rhino/commit ... b4541L1015

the changed a test for String to CharSequence to make a NativeString
So now all CharSequences (like StringBuilder) will be right after creation a native js string.

Why do you want to do this? Because we already had concatting of strings supported for a long time (so underneath it uses StringBuilders) and our impl is now even replaced because Rhino itself does that also
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8828
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy8.3.0, StringBuffer append is not recognised as fu

Postby danny.richadson » Wed May 09, 2018 11:31 am

Thanks Johan! It was 'old' stuff and was optimized in previous version for performance reason. I will rewritten this source, so it will use native string methods.
Danny Richardson
e-mail: info@danson.nl
User avatar
danny.richadson
 
Posts: 30
Joined: Wed Oct 17, 2007 3:46 pm
Location: Netherlands


Return to Methods

Who is online

Users browsing this forum: No registered users and 7 guests

cron