Explorar el Código

adds CtClass#isKotlin() for PR #276

tags/rel_3_26_0_ga
chibash hace 4 años
padre
commit
855ca0050a
Se han modificado 2 ficheros con 13 adiciones y 0 borrados
  1. 5
    0
      src/main/javassist/CtBehavior.java
  2. 8
    0
      src/main/javassist/CtClass.java

+ 5
- 0
src/main/javassist/CtBehavior.java Ver fichero

@@ -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 Ver fichero

@@ -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>.

Cargando…
Cancelar
Guardar