Clover coverage report - DynamicJava Test Coverage (dynamicjava-20120303-r5436)
Coverage timestamp: Sat Mar 3 2012 03:02:19 CST
file stats: LOC: 106   Methods: 6
NCLOC: 30   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
TryStatement.java - 88.9% 83.3% 86.7%
coverage coverage
 1    /*
 2    * DynamicJava - Copyright (C) 1999-2001
 3    *
 4    * Permission is hereby granted, free of charge, to any person obtaining a
 5    * copy of this software and associated documentation files
 6    * (the "Software"), to deal in the Software without restriction, including
 7    * without limitation the rights to use, copy, modify, merge, publish,
 8    * distribute, sublicense, and/or sell copies of the Software, and to permit
 9    * persons to whom the Software is furnished to do so, subject to the
 10    * following conditions:
 11    * The above copyright notice and this permission notice shall be included
 12    * in all copies or substantial portions of the Software.
 13    *
 14    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 15    * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 16    * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 17    * IN NO EVENT SHALL DYADE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 18    * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 19    * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 20    * DEALINGS IN THE SOFTWARE.
 21    *
 22    * Except as contained in this notice, the name of Dyade shall not be
 23    * used in advertising or otherwise to promote the sale, use or other
 24    * dealings in this Software without prior written authorization from
 25    * Dyade.
 26    *
 27    */
 28   
 29    package koala.dynamicjava.tree;
 30   
 31    import java.util.*;
 32   
 33    import koala.dynamicjava.tree.visitor.*;
 34   
 35    /**
 36    * This class represents the try statement nodes of the syntax tree
 37    *
 38    * @author Stephane Hillion
 39    * @version 1.0 - 1999/05/26
 40    */
 41   
 42    public class TryStatement extends Statement {
 43    /**
 44    * The try block
 45    */
 46    private Node tryBlock;
 47   
 48    /**
 49    * The catch statements
 50    */
 51    private List<CatchStatement> catchStatements;
 52   
 53    /**
 54    * The finally block
 55    */
 56    private Node finallyBlock;
 57   
 58    /**
 59    * Creates a new while statement
 60    * @param tryB the try block
 61    * @param catchL the catch list
 62    * @param fin the finally block
 63    */
 64  2 public TryStatement(Node tryB, List<CatchStatement> catchL, Node fin,
 65    SourceInfo si) {
 66  2 super(si);
 67  2 tryBlock = tryB;
 68  2 catchStatements = catchL;
 69  2 finallyBlock = fin;
 70    }
 71   
 72    /**
 73    * Gets the try block
 74    */
 75  2 public Node getTryBlock() {
 76  2 return tryBlock;
 77    }
 78   
 79    /**
 80    * Gets the catch statements
 81    */
 82  2 public List<CatchStatement> getCatchStatements() {
 83  2 return catchStatements;
 84    }
 85   
 86    /**
 87    * Gets the finally block
 88    */
 89  2 public Node getFinallyBlock() {
 90  2 return finallyBlock;
 91    }
 92   
 93    /**
 94    * Allows a visitor to traverse the tree
 95    * @param visitor the visitor to accept
 96    */
 97  0 public <T> T acceptVisitor(Visitor<T> visitor) {
 98  0 return visitor.visit(this);
 99    }
 100    /**
 101    * Implementation of toString for use in unit testing
 102    */
 103  2 public String toString() {
 104  2 return "("+getClass().getName()+": "+getTryBlock()+" "+getCatchStatements()+" "+getFinallyBlock()+")";
 105    }
 106    }