only print stack trace if app.debug(),
removed dead code.
This commit is contained in:
parent
a03ba78b03
commit
00173af1b6
1 changed files with 4 additions and 40 deletions
|
@ -262,8 +262,10 @@ public class FesiEvaluator {
|
||||||
String msg = x.getMessage ();
|
String msg = x.getMessage ();
|
||||||
if (msg == null || msg.length() < 10)
|
if (msg == null || msg.length() < 10)
|
||||||
msg = x.toString ();
|
msg = x.toString ();
|
||||||
System.err.println ("INVOKE-ERROR: "+msg);
|
if (app.debug ()) {
|
||||||
x.printStackTrace ();
|
System.err.println ("Error in Script: "+msg);
|
||||||
|
x.printStackTrace ();
|
||||||
|
}
|
||||||
throw new ScriptingException (msg);
|
throw new ScriptingException (msg);
|
||||||
} finally {
|
} finally {
|
||||||
// remove global variables that have been added during invocation.
|
// remove global variables that have been added during invocation.
|
||||||
|
@ -527,39 +529,13 @@ public class FesiEvaluator {
|
||||||
|
|
||||||
public synchronized void updateEvaluator (Prototype prototype, Reader reader, EvaluationSource source) {
|
public synchronized void updateEvaluator (Prototype prototype, Reader reader, EvaluationSource source) {
|
||||||
|
|
||||||
// HashMap priorProps = null;
|
|
||||||
// HashSet newProps = null;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
ObjectPrototype op = getPrototype (prototype.getName());
|
ObjectPrototype op = getPrototype (prototype.getName());
|
||||||
|
|
||||||
// extract all properties from prototype _before_ evaluation, so we can compare afterwards
|
|
||||||
// but only do this is declaredProps is not up to date yet
|
|
||||||
/*if (declaredPropsTimestamp != lastmod) {
|
|
||||||
priorProps = new HashMap ();
|
|
||||||
// remember properties before evaluation, so we can tell what's new afterwards
|
|
||||||
try {
|
|
||||||
for (Enumeration en=op.getAllProperties(); en.hasMoreElements(); ) {
|
|
||||||
String prop = (String) en.nextElement ();
|
|
||||||
priorProps.put (prop, op.getProperty (prop, prop.hashCode()));
|
|
||||||
}
|
|
||||||
} catch (Exception ignore) {}
|
|
||||||
} */
|
|
||||||
|
|
||||||
// do the update, evaluating the file
|
// do the update, evaluating the file
|
||||||
evaluator.evaluate(reader, op, source, false);
|
evaluator.evaluate(reader, op, source, false);
|
||||||
|
|
||||||
// check what's new
|
|
||||||
/* if (declaredPropsTimestamp != lastmod) try {
|
|
||||||
newProps = new HashSet ();
|
|
||||||
for (Enumeration en=op.getAllProperties(); en.hasMoreElements(); ) {
|
|
||||||
String prop = (String) en.nextElement ();
|
|
||||||
if (priorProps.get (prop) == null || op.getProperty (prop, prop.hashCode()) != priorProps.get (prop))
|
|
||||||
newProps.add (prop);
|
|
||||||
}
|
|
||||||
} catch (Exception ignore) {} */
|
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
app.logEvent ("Error parsing function file "+source+": "+e);
|
app.logEvent ("Error parsing function file "+source+": "+e);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -568,18 +544,6 @@ public class FesiEvaluator {
|
||||||
reader.close();
|
reader.close();
|
||||||
} catch (IOException ignore) {}
|
} catch (IOException ignore) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// now remove the props that were not refreshed, and set declared props to new collection
|
|
||||||
/* if (declaredPropsTimestamp != lastmod) {
|
|
||||||
declaredPropsTimestamp = lastmod;
|
|
||||||
if (declaredProps != null) {
|
|
||||||
declaredProps.removeAll (newProps);
|
|
||||||
removeProperties (declaredProps);
|
|
||||||
}
|
|
||||||
declaredProps = newProps;
|
|
||||||
// System.err.println ("DECLAREDPROPS = "+declaredProps);
|
|
||||||
} */
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue