SHARE
TWEET

Untitled

a guest May 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 反射获得protected、private变量
  2. public class EsService {
  3.     private static List spellList = new ArrayList();
  4. }
  5.  
  6. EsService service = new EsService();
  7. Field spellListField = service.getClass().getDeclaredField("spellList");
  8. spellListField.setAccessible(true);
  9. List spellList = (List) spellListField.get(service);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top