Clover coverage report - groovy - 1.0-beta-7
Coverage timestamp: Wed Sep 29 2004 16:55:52 BST
file stats: LOC: 61   Methods: 5
NCLOC: 48   Classes: 1
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
UnexpectedCharacterException.java 0% 0% 0% 0%
coverage
 1   
 package org.codehaus.groovy.syntax.lexer;
 2   
 
 3   
 public class UnexpectedCharacterException extends LexerException {
 4   
     private char c;
 5   
     private char[] expected;
 6   
     private String message;
 7   
 
 8  0
     public UnexpectedCharacterException(int line, int column, char c, String message) {
 9  0
         super("unexpected character: " + c + (message == null ? "" : "; " + message), line, column);
 10  0
         this.c = c;
 11  0
         this.expected = null;
 12  0
         this.message  = message;
 13   
     }
 14   
 
 15  0
     public UnexpectedCharacterException(int line, int column, char c, char[] expected) {
 16  0
         super("unexpected character: " + c, line, column);
 17  0
         this.c = c;
 18  0
         this.expected = expected;
 19  0
         this.message  = null;
 20   
     }
 21   
 
 22  0
     public char getCharacter() {
 23  0
         return this.c;
 24   
     }
 25   
 
 26  0
     public char[] getExpected() {
 27  0
         return this.expected;
 28   
     }
 29   
 
 30  0
     public String getMessage() {
 31  0
         StringBuffer message = new StringBuffer();
 32   
 
 33  0
         if( this.message != null ) {
 34  0
             message.append( message );
 35   
         }
 36  0
         else if( this.expected != null ) {
 37  0
             message.append("expected ");
 38  0
             if (this.expected.length == 1) {
 39  0
                 message.append("'" + this.expected[0] + "'");
 40   
             }
 41   
             else {
 42  0
                 message.append("one of {");
 43   
 
 44  0
                 for (int i = 0; i < this.expected.length; ++i) {
 45  0
                     message.append("'" + this.expected[i] + "'");
 46   
 
 47  0
                     if (i < (this.expected.length - 1)) {
 48  0
                         message.append(", ");
 49   
                     }
 50   
                 }
 51   
 
 52  0
                 message.append("}");
 53   
             }
 54   
         }
 55   
 
 56  0
         message.append( "; found '" ).append( c ).append( "'" );
 57   
 
 58  0
         return message.toString();
 59   
     }
 60   
 }
 61