Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Admittedly, if you're using groovy, the last time I used it (~1.7 era) you could just do b.stuff and groovy would do all the reflection and breaking of private for you... (with the caviat that it also does syntatic sugar for java bean methods getX). :) Commented Apr 23, 2013 at 14:43
  • @Charlie: yes, b.stuff is enough for this in groovy. Commented Apr 23, 2013 at 14:48
  • This works great and the big key for my use case was using setAccessible; this is coming from a weak Java background, but stronger in other languages. I moved some reflection logic and things started failing when I could no longer access the values until adding setAccessible. Commented Dec 18, 2014 at 2:48