NPE when using ThreadLocal + AtomicLong in Java

35 Views Asked by At

I'm initializing using public static ThreadLocal<AtomicLong> count = new ThreadLocal<>(); How do I use AtomicLong method for count? The below throws a NPE:

count.get().addAndGet(records.size());
0

There are 0 best solutions below