Clover coverage report - Replica - 1.0-Alpha
Coverage timestamp: Dom Fev 1 2004 17:00:58 WET
file stats: LOC: 71   Methods: 6
NCLOC: 56   Classes: 2
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
ASTIfStatement.java 0% 0% 0% 0%
coverage
 1   
 /* JJT:    0.2.2 */
 2   
 
 3   
 package    mobisnap.mobile_trx;
 4   
 
 5   
 import java.util.*;
 6   
 
 7   
 public class ASTIfStatement    extends    mobisnap.mobile_trx.SimpleNode {
 8   
     public class Alternatives {
 9   
         public ASTPlSqlExpression        expr;
 10   
         public ASTSequenceOfStatements    stats;
 11   
         
 12  0
         public Alternatives( ASTPlSqlExpression expr, ASTSequenceOfStatements stats ) {
 13  0
             this.expr = expr;
 14  0
             this.stats = stats;
 15   
         }
 16   
 
 17   
     };
 18   
     public Vector alternatives;
 19   
     public ASTSequenceOfStatements    elseStats;
 20   
     
 21   
 
 22  0
     public ASTIfStatement(int id) {
 23  0
         super(id);
 24  0
         alternatives = new Vector();
 25  0
         elseStats = null;
 26   
     }
 27   
 
 28  0
     public ASTIfStatement( MobisnapSQL    p, int i) {
 29  0
         super( p, i);
 30  0
         id = i;
 31  0
         alternatives = new Vector();
 32  0
         elseStats = null;
 33   
     }
 34   
     
 35   
     /** Accept the visitor. **/
 36  0
     public Object jjtAccept(MobisnapSQLVisitor visitor, Object data) {
 37  0
         return visitor.visit(this, data);
 38   
     }
 39   
     
 40  0
     public void insert( ASTPlSqlExpression expr, ASTSequenceOfStatements stats) {
 41  0
         alternatives.addElement( new Alternatives( expr, stats));
 42   
     }
 43   
 
 44  0
     public void process( int msql_type) throws Exception {
 45  0
         for( int i = 0; i < alternatives.size(); i++) {
 46  0
             Alternatives aux = (Alternatives)alternatives.elementAt( i);
 47  0
             Object obj = aux.expr.value( msql_type, true);
 48  0
             if( obj instanceof SQLNull)
 49  0
                 continue;
 50  0
             if( obj instanceof Boolean) {
 51  0
                 if( ((Boolean)obj).booleanValue()) {
 52  0
                     aux.stats.process( msql_type);
 53  0
                     return;
 54   
                 } else
 55  0
                     continue;
 56   
             }
 57  0
             if( obj instanceof String && (((String)obj).equalsIgnoreCase( "true") || ((String)obj).equalsIgnoreCase( "false"))) {
 58  0
                 if( ((String)obj).equalsIgnoreCase( "true")) {
 59  0
                     aux.stats.process( msql_type);
 60  0
                     return;
 61   
                 } else
 62  0
                     continue;
 63   
             }
 64  0
             throw new mobisnap.MobisnapException( "Invalid expression in if statement");
 65   
         }
 66  0
         if( elseStats != null)
 67  0
             elseStats.process( msql_type);
 68   
     }
 69   
 
 70   
 }
 71