title: Why I cannot change static final int field with reflection from kotlin android
body: <p>I have following java class with static final int which I need to change via reflection:</p>
  <pre><code>class DateValidator {
     public static final int DIFF = 20;
  }
  </code></pre>
  <p>And from Android Kotlin I try to change it value from 20 to 100:</p>
  <pre><code>class MainActivity : AppCompatActivity() {
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
          println(&quot;@@@@DateValidator.DIFF: ${DateValidator.DIFF}&quot;)
          val clazz = DateValidator::class.java
          println(&quot;@@@clazz: $clazz&quot;)
          val field: Field = clazz.getDeclaredField(&quot;DIFF&quot;)
          println(&quot;@@@field: $field&quot;)
          println(&quot;@@@field.isAccessible: ${field.isAccessible}&quot;)
          field.isAccessible = true
          println(&quot;@@@field.isAccessible2: ${field.isAccessible}&quot;)
          val fieldAccessFlags: Field = Field::class.java.getDeclaredField(&quot;accessFlags&quot;)
          println(&quot;@@@fieldAccessFlags: $fieldAccessFlags&quot;)
          println(&quot;@@@fieldAccessFlags.isAccessible: ${fieldAccessFlags.isAccessible}&quot;)
          fieldAccessFlags.isAccessible = true
          println(&quot;@@@fieldAccessFlags.isAccessible2: ${fieldAccessFlags.isAccessible}&quot;)
          fieldAccessFlags.setInt(field, field.modifiers and Modifier.FINAL.inv())
          field.set(null, 100)
          println(&quot;@@@@DateValidator.DIFF2: ${DateValidator.DIFF}&quot;)
          field.setInt(null, 100)
          println(&quot;@@@@DateValidator.DIFF3: ${DateValidator.DIFF}&quot;)
  
      }
  </code></pre>
  <p>And I have following output in Logcat:</p>
  <pre><code>@@@@DateValidator.DIFF: 20
  @@@clazz: class com.droiddevstar.changestaticprj.DateValidator
  @@@field: public static final int com.droiddevstar.changestaticprj.DateValidator.DIFF
  @@@field.isAccessible: false
  @@@field.isAccessible2: true
  @@@fieldAccessFlags: private int java.lang.reflect.Field.accessFlags
  @@@fieldAccessFlags.isAccessible: false
  @@@fieldAccessFlags.isAccessible2: true
  @@@@DateValidator.DIFF2: 20
  @@@@DateValidator.DIFF3: 20
  </code></pre>
  <p>Perhapse reflection doesn't work with primitive int?</p>