-
Type: Bug
-
Status: Resolved
-
Priority: Critical
-
Resolution: Fixed
-
Affects Version/s: 2023.4, 2021.46
-
Component/s: Automation
-
Release Notes Summary:nuxeo.conf now allows to enable Nashorn optimistic types.
-
Tags:
-
Backlog priority:900
-
Upgrade notes:
-
Sprint:nxplatform #108
-
Story Points:3
NXP-32134 improved script compilation speed by disabling Nashorn optimistic typing - however this introduces a regression in scripts that pass number objects as parameters to operations that expect an Integer (for example, Document.RemoveItemFromListProperty). An option to enable optimistic typing (including its downsides) should be made available such that these scripts won't have to be immediately refactored.
Steps to Reproduce:
- Install the attached Studio project and ensure minimum hotfix version 2021.46 or 2023.4.
- Create an instance of RadioGroupDoc and populate the radiogroupdoc:items multi-valued complex property with several values.
- After navigating to the created document, find a button under DOCUMENT_ACTIONS slot labeled "Test Item Removal" which runs the following script to remove the last item in the array:
function run(input, params) { if(input && input['radiogroupdoc:items']) { var len = input['radiogroupdoc:items'].length; if(len > 0) { Document.RemoveItemFromListProperty( input, { 'xpath': 'radiogroupdoc:items', 'index': (len - 1), 'save': true } ); } } }
Expected result: the last item in the list property is removed.
Actual result: the following error is thrown:
Exception: OperationException Caught error: No type adapter found for input: class java.lang.Double and output class java.lang.Integer Caused by: org.nuxeo.ecm.automation.OperationException: No type adapter found for input: class java.lang.Double and output class java.lang.Integer
- is related to
-
NXP-32134 Deactivate optimistic types to speedup nashorn script compilation
- Resolved