は、この場合には、推奨NullPointerException
の使用である:エ議論..これは良い習慣ですか?
/**
* Drop the database referenced by the singleton.
*
* @throws NullPointerException
*/
public static void dropDatabase() throws NullPointerException {
if (store != null) {
store.dropDatabase(DATABASE);
} else {
throw new NullPointerException("No valid database connection.");
}
}
'IllegalStateException'はうまく収まります。 –
+1 for IllegalStateException – Nishant
@Jon Skeet - Guavaへの素敵なポインタ。 – wulfgarpro