PerformanceCounter.nextValue doesn't return NULL when no counter has been added. now JNI method can throw RuntimeException using throwExc function.