Changeset 9524 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2016-01-18T01:46:48+01:00 (8 years ago)
Author:
Don-vip
Message:

CustomConfigurator - add unit test, javadoc, and use JavaScript engine instead of rhino, gone with Java 8 (replaced by Nashorn)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java

    r9498 r9524  
    9797    }
    9898
     99    /**
     100     * Resets the log.
     101     */
     102    public static void resetLog() {
     103        summary = new StringBuilder();
     104    }
     105
     106    /**
     107     * Read configuration script from XML file, modifying main preferences
     108     * @param dir - directory
     109     * @param fileName - XML file name
     110     */
    99111    public static void readXML(String dir, String fileName) {
    100112        readXML(new File(dir, fileName));
     
    474486            try {
    475487                this.mainPrefs = mainPrefs;
    476                 summary = new StringBuilder();
    477                 engine = new ScriptEngineManager().getEngineByName("rhino");
     488                resetLog();
     489                engine = new ScriptEngineManager().getEngineByName("JavaScript");
    478490                engine.eval("API={}; API.pref={}; API.fragments={};");
    479491
     
    493505            } catch (Exception ex) {
    494506                log("Error: initializing script engine: "+ex.getMessage());
     507                Main.error(ex);
    495508            }
    496509        }
Note: See TracChangeset for help on using the changeset viewer.