* Use RequestEvaluator.EMPTY_ARGS whenever calling a function with no args.
This commit is contained in:
parent
e1fb468424
commit
4b72017330
1 changed files with 11 additions and 8 deletions
|
@ -435,9 +435,9 @@ public final class Application implements IPathElement, Runnable {
|
||||||
RequestEvaluator eval = null;
|
RequestEvaluator eval = null;
|
||||||
try {
|
try {
|
||||||
eval = getEvaluator();
|
eval = getEvaluator();
|
||||||
eval.invokeInternal(null, "onStop", new Object[0]);
|
eval.invokeInternal(null, "onStop", RequestEvaluator.EMPTY_ARGS);
|
||||||
} catch (Exception x) {
|
} catch (Exception x) {
|
||||||
logError("Error in " + name + "/onStop()", x);
|
logError("Error in " + name + "onStop()", x);
|
||||||
} finally {
|
} finally {
|
||||||
releaseEvaluator(eval);
|
releaseEvaluator(eval);
|
||||||
}
|
}
|
||||||
|
@ -1209,6 +1209,9 @@ public final class Application implements IPathElement, Runnable {
|
||||||
private Object invokeFunction(Object obj, String func, Object[] args) {
|
private Object invokeFunction(Object obj, String func, Object[] args) {
|
||||||
RequestEvaluator reval = getCurrentRequestEvaluator();
|
RequestEvaluator reval = getCurrentRequestEvaluator();
|
||||||
if (reval != null) {
|
if (reval != null) {
|
||||||
|
if (args == null) {
|
||||||
|
args = RequestEvaluator.EMPTY_ARGS;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
return reval.invokeDirectFunction(obj, func, args);
|
return reval.invokeDirectFunction(obj, func, args);
|
||||||
} catch (Exception x) {
|
} catch (Exception x) {
|
||||||
|
@ -1244,7 +1247,7 @@ public final class Application implements IPathElement, Runnable {
|
||||||
return ((IPathElement) obj).getElementName();
|
return ((IPathElement) obj).getElementName();
|
||||||
}
|
}
|
||||||
|
|
||||||
Object retval = invokeFunction(obj, "getElementName", new Object[0]);
|
Object retval = invokeFunction(obj, "getElementName", RequestEvaluator.EMPTY_ARGS);
|
||||||
|
|
||||||
if (retval != null) {
|
if (retval != null) {
|
||||||
return retval.toString();
|
return retval.toString();
|
||||||
|
@ -1276,7 +1279,7 @@ public final class Application implements IPathElement, Runnable {
|
||||||
return ((IPathElement) obj).getParentElement();
|
return ((IPathElement) obj).getParentElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
return invokeFunction(obj, "getParentElement", new Object[0]);
|
return invokeFunction(obj, "getParentElement", RequestEvaluator.EMPTY_ARGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1448,9 +1451,9 @@ public final class Application implements IPathElement, Runnable {
|
||||||
RequestEvaluator eval = null;
|
RequestEvaluator eval = null;
|
||||||
try {
|
try {
|
||||||
eval = getEvaluator();
|
eval = getEvaluator();
|
||||||
eval.invokeInternal(null, "onStart", new Object[0]);
|
eval.invokeInternal(null, "onStart", RequestEvaluator.EMPTY_ARGS);
|
||||||
} catch (Exception xcept) {
|
} catch (Exception xcept) {
|
||||||
logError("Error in " + name + "/onStart()", xcept);
|
logError("Error in " + name + "onStart()", xcept);
|
||||||
} finally {
|
} finally {
|
||||||
releaseEvaluator(eval);
|
releaseEvaluator(eval);
|
||||||
}
|
}
|
||||||
|
@ -1638,7 +1641,7 @@ public final class Application implements IPathElement, Runnable {
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
evaluator.invokeInternal(null, job.getFunction(),
|
evaluator.invokeInternal(null, job.getFunction(),
|
||||||
new Object[0], job.getTimeout());
|
RequestEvaluator.EMPTY_ARGS, job.getTimeout());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logEvent("error running " + job + ": " + ex);
|
logEvent("error running " + job + ": " + ex);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -2043,7 +2046,7 @@ public final class Application implements IPathElement, Runnable {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
thisEvaluator.invokeInternal(null, job.getFunction(),
|
thisEvaluator.invokeInternal(null, job.getFunction(),
|
||||||
new Object[0], job.getTimeout());
|
RequestEvaluator.EMPTY_ARGS, job.getTimeout());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logEvent("error running " + job + ": " + ex);
|
logEvent("error running " + job + ": " + ex);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue