01: package spoon.vsuite.common.template;
02:
03: import spoon.reflect.code.CtStatement;
04: import spoon.reflect.declaration.CtClass;
05: import spoon.template.Local;
06: import spoon.template.Parameter;
07: import spoon.template.Template;
08:
09: public class BadCatchTemplate implements Template {
10:
11: @Parameter
12: Class<?> _Throwable_;
13:
14: @Parameter
15: Class<?> _ReplacingThrowable_;
16:
17: @Parameter
18: String _e_;
19:
20: void statement() throws Exception {
21: _Throwable_ _e_ = null;
22: throw new _ReplacingThrowable_(_e_.getMessage());
23: }
24:
25: @Local
26: public static CtStatement getStatement(CtClass<BadCatchTemplate> c) {
27: return c.getMethod("statement").getBody().getStatements()
28: .get(1);
29: }
30: }
31:
32: @SuppressWarnings("serial")
33: class _Throwable_ extends Exception {
34: }
35:
36: @SuppressWarnings("serial")
37: class _ReplacingThrowable_ extends Exception {
38: public _ReplacingThrowable_(String msg) {
39: }
40: }
|