title: Call Kotlin inline function from Java
body: <p>Exceptions.kt:</p>
  
  <pre><code>@Suppress("NOTHING_TO_INLINE")
  inline fun generateStyleNotCorrectException(key: String, value: String) =
          AOPException(key + " = " + value)
  </code></pre>
  
  <p>In kotlin:</p>
  
  <pre><code>fun inKotlin(key: String, value: String) {
      throw generateStyleNotCorrectException(key, value) }
  </code></pre>
  
  <p>It works  in kotlin and the function is inlined.</p>
  
  <p>But when used in Java code, It just cannot be inlined,
   and <em>still</em> a normal static method call (seen from the decompiled contents).</p>
  
  <p>Something like this:</p>
  
  <pre><code>public static final void inJava(String key, String value) throws AOPException {
      throw ExceptionsKt.generateStyleNotCorrectException(key, value);
  // when decompiled, it has the same contents as before , not the inlined contents.
  }
  </code></pre>