* @return
*/
int getIntervalSize() {
- return stringsEntrySize + HTNode.getDataEntrySize();
+ return stringsEntrySize + HTNode.DATA_ENTRY_SIZE;
}
private int computeStringsEntrySize() {
return sv.unboxStr().getBytes().length + 2;
} catch (StateValueTypeException e) {
/* We're inside a switch/case for the string type, can't happen */
- throw new RuntimeException();
+ throw new IllegalStateException(e);
}
default:
/* It's very important that we know how to write the state value in
* the file!! */
- throw new RuntimeException();
+ throw new IllegalStateException();
}
}
@Override
public boolean equals(Object other) {
- if (other instanceof HTInterval) {
- if (this.compareTo((HTInterval) other) == 0) {
- return true;
- }
+ if (other instanceof HTInterval &&
+ this.compareTo((HTInterval) other) == 0) {
+ return true;
}
return false;
}
return TYPE_LONG;
default:
/* Should not happen if the switch is fully covered */
- throw new RuntimeException();
+ throw new IllegalStateException();
}
}
}