Commit 3efcc76e authored by Lubomir Bulej's avatar Lubomir Bulej

DiSL-RE: include analysis method name in case of exceptions during analysis method invocations

parent c6c173e8
......@@ -8,29 +8,33 @@ public class AnalysisInvocation {
private Method analysisMethod;
private Object analysisInstance;
private List<Object> args;
public AnalysisInvocation(Method analysisMethod, Object analysisInstance,
List<Object> args) {
public AnalysisInvocation (
Method analysisMethod, Object analysisInstance,
List<Object> args
) {
super();
this.analysisMethod = analysisMethod;
this.analysisInstance = analysisInstance;
this.args = args;
}
public void invoke() {
public void invoke () {
try {
analysisMethod.invoke(analysisInstance, args.toArray());
}
catch(Exception e) {
// reports error during analysis
Throwable cause = e.getCause();
System.err.println("DiSL-RE analysis exception: "
+ cause.getMessage());
analysisMethod.invoke (analysisInstance, args.toArray());
} catch (final Exception e) {
// report error during analysis invocation
final Throwable cause = e.getCause ();
final String message = cause.getMessage ();
System.err.format (
"DiSL-RE: exception in analysis %s.%s(): %s",
analysisMethod.getDeclaringClass ().getName (),
analysisMethod.getName (),
(message != null) ? message : ""
);
cause.printStackTrace();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment