Changeset 16330 in josm
- Timestamp:
- 2020-04-17T21:45:35+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r16252 r16330 66 66 import java.util.zip.ZipFile; 67 67 68 import javax.script.ScriptEngine;69 import javax.script.ScriptEngineManager;70 71 68 import com.kitfox.svg.xml.XMLParseUtil; 72 69 import org.openstreetmap.josm.spi.preferences.Config; … … 1803 1800 return Optional.of((T) o); 1804 1801 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 133011812 */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 }1820 1802 } 1821 1803
Note:
See TracChangeset
for help on using the changeset viewer.