only print stack trace if app.debug(),

removed dead code.
This commit is contained in:
hns 2002-05-16 17:12:04 +00:00
parent a03ba78b03
commit 00173af1b6

View file

@ -262,8 +262,10 @@ public class FesiEvaluator {
String msg = x.getMessage ();
if (msg == null || msg.length() < 10)
msg = x.toString ();
System.err.println ("INVOKE-ERROR: "+msg);
x.printStackTrace ();
if (app.debug ()) {
System.err.println ("Error in Script: "+msg);
x.printStackTrace ();
}
throw new ScriptingException (msg);
} finally {
// 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) {
// HashMap priorProps = null;
// HashSet newProps = null;
try {
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
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) {
app.logEvent ("Error parsing function file "+source+": "+e);
} finally {
@ -568,18 +544,6 @@ public class FesiEvaluator {
reader.close();
} 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);
} */
}
}