Created
February 11, 2015 17:48
-
-
Save maurociancio/0d3f5a082454479490b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.lang.reflect.* | |
| Thread thread = Thread.currentThread() | |
| Field threadLocalsField = Thread.class.getDeclaredField("threadLocals") | |
| threadLocalsField.setAccessible(true) | |
| Object threadLocalTable = threadLocalsField.get(thread) | |
| def values = threadLocalTable.table.grep().collect { it?.value } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment