Representation of catch exception, e.g., catch (e).
| 31 | * Representation of catch exception, e.g., catch (e). |
| 32 | */ |
| 33 | public class Catch extends AbstractStmt { |
| 34 | |
| 35 | /** |
| 36 | * Reference of the exception object to be caught. |
| 37 | */ |
| 38 | private final Var exceptionRef; |
| 39 | |
| 40 | public Catch(Var exceptionRef) { |
| 41 | this.exceptionRef = exceptionRef; |
| 42 | } |
| 43 | |
| 44 | public Var getExceptionRef() { |
| 45 | return exceptionRef; |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public Optional<LValue> getDef() { |
| 50 | return Optional.of(exceptionRef); |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public <T> T accept(StmtVisitor<T> visitor) { |
| 55 | return visitor.visit(this); |
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public String toString() { |
| 60 | return "catch " + exceptionRef; |
| 61 | } |
| 62 | } |
nothing calls this directly
no outgoing calls
no test coverage detected