(Object x)
| 1075 | } |
| 1076 | |
| 1077 | static public char charCast(Object x){ |
| 1078 | if(x instanceof Character) |
| 1079 | return ((Character) x).charValue(); |
| 1080 | |
| 1081 | long n = ((Number) x).longValue(); |
| 1082 | if(n < Character.MIN_VALUE || n > Character.MAX_VALUE) |
| 1083 | throw new IllegalArgumentException("Value out of range for char: " + x); |
| 1084 | |
| 1085 | return (char) n; |
| 1086 | } |
| 1087 | |
| 1088 | static public char charCast(byte x){ |
| 1089 | char i = (char) x; |
no test coverage detected