Browse Source

adds CtClass#isKotlin() for PR #276

tags/rel_3_26_0_ga
chibash 4 years ago
parent
commit
855ca0050a
2 changed files with 13 additions and 0 deletions
  1. 5
    0
      src/main/javassist/CtBehavior.java
  2. 8
    0
      src/main/javassist/CtClass.java

+ 5
- 0
src/main/javassist/CtBehavior.java View File

@@ -858,6 +858,11 @@ public abstract class CtBehavior extends CtMember {
* generate the original bytecode.
* The other <code>insertAfter</code> methods calls this method
* with <code>false</code> for this parameter.
* A tip is to pass <code>this.getDeclaringClass().isKotlin()</code>
* to this parameter.
*
* @see CtClass#isKotlin()
* @see #getDeclaringClass()
* @since 3.26
*/
public void insertAfter(String src, boolean asFinally, boolean redundant)

+ 8
- 0
src/main/javassist/CtClass.java View File

@@ -332,6 +332,14 @@ public abstract class CtClass {
return false;
}

/**
* Returns <code>true</code> if this object represents a Kotlin class.
* @since 3.26
*/
public boolean isKotlin() {
return hasAnnotation("kotlin.Metadata");
}

/**
* If this object represents an array, this method returns the component
* type of the array. Otherwise, it returns <code>null</code>.

Loading…
Cancel
Save