private static Map<String, MatchTemplate> cachedScripts = new HashMap<String, MatchTemplate>();
private static <T> T parse(File dir, String file, String template, String lastupdate, Class<T> resultClass, String... extra) throws Exception {
System.out.println("*" + file);
MatchTemplate ps = cachedScripts.get(template);
if (ps == null) {
ps = new MatchTemplate(PDARoundtripParser.class, "templates/" + template + ".jmt", "ISO-8859-1");
ps.enableCoveredStatementsTracing();
cachedScripts.put(template, ps);
}
Parser p = new Parser(ps);
p.setLocal("lastupdate", lastupdate);
for (int i = 0; i < extra.length; i += 2) {