アサーション
正直、実務で使った事が無いので、ほとんどわからない。
OJC-Pはそういうところもカバーしてくれるのでありがたいと言えばありがたいのかな?
φ(・ω・。)かきかき
assert Thread.holdsLock(this);
//条件付きコンパイルの例 class Data{ //この定数を変更してコンパイルする。 static final boolean asserts = false; int d; boolean check() { return d!= 0; } void meth() { if ( asserts ) assert check(); System.out.println("meth"); } } class sample{ public static void main(String[] args){ Data data = new Data(); data.meth(); } }