Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java - How to check value of 'ThreadLocal' variables in Eclipse?

I have couple of ThreadLocals populated in my web app. And, while remote debugging the webapp, I want to see the value of these ThreadLocal variables in Eclipse (just like the way Eclipse shows other variables in the variables tab in Debug perspective).

Any idea how can I view the value of ThreadLocal variables during debugging in Eclipse?

Thanks!

like image 403
peakit Avatar asked Nov 22 '10 14:11

peakit


1 Answers

When you hit any breakpoint, just use view Expressions to display the value of Thread.currentThread() and you will be able to inspect every ThreadLocal value.

enter image description here

like image 57
Aldian Avatar answered Sep 16 '22 15:09

Aldian