title: Using Spring ReflectionUtils
body: <p>I don't <strong>fully</strong> understand the <strong>last line</strong> in following piece of code</p>
  
  <pre><code> Field init = ReflectionUtils.findField(ABCClass.class, "init");
   ReflectionUtils.makeAccessible(init);
   init.set(null, false);
  </code></pre>
  
  <p>What i do understand that its setting the AbcClass.init=false using Reflection API. What i dont understand is why we dont have a setter like </p>
  
  <pre><code>set(Object value) // looks logical as we have reference to field , we can simply set the value
  </code></pre>
  
  <p>but instead we have Something like</p>
  
  <pre><code>set(Object obj,Object value) 
  </code></pre>
  
  <p>I went through the api doc <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/reflect/Field.html#set(java.lang.Object" rel="nofollow">http://docs.oracle.com/javase/6/docs/api/java/lang/reflect/Field.html#set(java.lang.Object</a>, java.lang.Object)
  it says </p>
  
  <blockquote>
    <p>If the underlying field is static, the obj argument is ignored; it may
    be null. </p>
    
    <p>Otherwise the underlying field is an instance field. If the specified
    object argument is null, the method throws a NullPointerException.</p>
  </blockquote>
  
  <p>But in my test case its not throwing any null pointer exception</p>
  
  <p>I tried googling around for more example usage of this api , didnt find any useful example , may be some more examples can help me understand better.</p>