Changeset 16330 in josm


Ignore:
Timestamp:
2020-04-17T21:45:35+02:00 (5 years ago)
Author:
simon04
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r16252 r16330  
    6666import java.util.zip.ZipFile;
    6767
    68 import javax.script.ScriptEngine;
    69 import javax.script.ScriptEngineManager;
    70 
    7168import com.kitfox.svg.xml.XMLParseUtil;
    7269import org.openstreetmap.josm.spi.preferences.Config;
     
    18031800            return Optional.of((T) o);
    18041801        return Optional.empty();
    1805     }
    1806 
    1807     /**
    1808      * Returns JRE JavaScript Engine (Nashorn by default), if any.
    1809      * Catches and logs SecurityException and return null in case of error.
    1810      * @return JavaScript Engine, or null.
    1811      * @since 13301
    1812      */
    1813     public static ScriptEngine getJavaScriptEngine() {
    1814         try {
    1815             return new ScriptEngineManager(null).getEngineByName("JavaScript");
    1816         } catch (SecurityException | ExceptionInInitializerError e) {
    1817             Logging.log(Logging.LEVEL_ERROR, "Unable to get JavaScript engine", e);
    1818             return null;
    1819         }
    18201802    }
    18211803
Note: See TracChangeset for help on using the changeset viewer.