Modify

Opened 3 months ago

Closed 7 weeks ago

Last modified 3 weeks ago

#18830 closed enhancement (fixed)

Remove PreferencesUtils#readPrefsFromJS due to Nashorn removal

Reported by: simon04 Owned by: simon04
Priority: normal Milestone: 20.05
Component: Core Version:
Keywords: javascript nashorn java15 Cc: Don-vip

Description


Attachments (0)

Change History (11)

comment:1 Changed 3 months ago by Don-vip

Or simply drop it. It's here since :ticket:4421#comment:34 but I don't think it's being used much. We should ask on @josm-dev

comment:2 Changed 3 months ago by simon04

https://lists.openstreetmap.org/pipermail/josm-dev/2020-March/008285.html


Nashorn was in use for three features of JOSM core:

3 – JavaScript API of JOSM configuration XML files, Help/Preferences/ImportExport#JavaScriptAPI

… we don't see a viable alternative. We plan to remove this feature with the next JOSM release unless someone steps up with a killer-user-case and migration plan

Last edited 3 months ago by simon04 (previous) (diff)

comment:4 Changed 3 months ago by simon04

Summary: Migrate PreferencesUtils#readPrefsFromJS to non-JavaScript/non-NashornRemove PreferencesUtils#readPrefsFromJS due to Nashorn removal

comment:5 Changed 3 months ago by Don-vip

Milestone: 20.0320.04

Descoping to release 20.03 early to address #18798, as we receive a lot of duplicates, and to allow some time for feedback, even if I think nobody will show up.

comment:6 Changed 8 weeks ago by simon04

Owner: changed from team to simon04
Status: newassigned

Removing PreferencesUtils#readPrefsFromJS is the easy part. The ScriptEngine, however, is heavily used via CustomConfigurator.XMLCommandProcessor#evalVars in order to evaluate various strings/values, such as Help/Preferences/ImportExport#Variablesmessageboxesandaskinguser

What should we do?

  1. Rewrite evalVars to only lookup variables, but not compute values?
  2. Rewrite evalVars to mimic the most important computations (such as math and string computations)?
  3. Rewrite evalVars to use MapCSS functions?
  4. Use https://github.com/beanshell/beanshell or a similar library?
  5. …?

comment:7 in reply to:  6 Changed 7 weeks ago by simon04

Replying to simon04:

What should we do?

  1. Rewrite evalVars to only lookup variables, but not compute values?

I chose this variant.

comment:8 Changed 7 weeks ago by simon04

Resolution: fixed
Status: assignedclosed

In 16329/josm:

fix #18830 - Remove PreferencesUtils#readPrefsFromJS due to Nashorn removal

comment:9 Changed 7 weeks ago by simon04

In 16330/josm:

see #18830 - Remove Utils#getJavaScriptEngine due to Nashorn removal

comment:11 Changed 3 weeks ago by Klumbumbus

Milestone: 20.0420.05

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain simon04.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.