check if an object is fit to be proper input ... has to be Comparable and non-null @param o the object being checked @param index _KEY or _VALUE (used to put the right word in the exception message) @exception NullPointerException if o is null @exception ClassCastException if o is not
(Object o,
int index)
| 1196 | * @exception ClassCastException if o is not Comparable |
| 1197 | */ |
| 1198 | private static void checkNonNullComparable(Object o, |
| 1199 | int index) |
| 1200 | { |
| 1201 | if (o == null) |
| 1202 | { |
| 1203 | throw new NullPointerException(_data_name[ index ] |
| 1204 | + " cannot be null"); |
| 1205 | } |
| 1206 | if (!(o instanceof Comparable)) |
| 1207 | { |
| 1208 | throw new ClassCastException(_data_name[ index ] |
| 1209 | + " must be Comparable"); |
| 1210 | } |
| 1211 | } |
| 1212 | |
| 1213 | /** |
| 1214 | * check a key for validity (non-null and implements Comparable) |
no outgoing calls
no test coverage detected