diff --git a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/beans/ClassSuperInfo.kt b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/beans/ClassSuperInfo.kt index d74dce31..a6f97aa2 100644 --- a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/beans/ClassSuperInfo.kt +++ b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/beans/ClassSuperInfo.kt @@ -1,4 +1,4 @@ package com.flyjingfish.android_aop_plugin.beans -class ClassSuperInfo(val className: String, val superName: String, val interfaces: ArrayList) { +class ClassSuperInfo(val className: String, val superName: String?, val interfaces: Array?) { } \ No newline at end of file diff --git a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/ClassSuperScanner.java b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/ClassSuperScanner.java index 9dd9b7fc..065bdbb5 100644 --- a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/ClassSuperScanner.java +++ b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/ClassSuperScanner.java @@ -1,15 +1,10 @@ package com.flyjingfish.android_aop_plugin.scanner_visitor; import com.flyjingfish.android_aop_plugin.beans.ClassSuperInfo; -import com.flyjingfish.android_aop_plugin.utils.UtilsKt; import com.flyjingfish.android_aop_plugin.utils.WovenInfoUtils; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.Opcodes; -import org.slf4j.Logger; - -import java.util.ArrayList; -import java.util.Arrays; public class ClassSuperScanner extends ClassVisitor { public ClassSuperScanner() { @@ -19,12 +14,6 @@ public ClassSuperScanner() { @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { super.visit(version, access, name, signature, superName, interfaces); - ArrayList interfaceList; - if (interfaces == null){ - interfaceList = new ArrayList<>(); - }else { - interfaceList = new ArrayList<>(Arrays.asList(interfaces)); - } - WovenInfoUtils.INSTANCE.addClassSuper(new ClassSuperInfo(name,superName,interfaceList)); + WovenInfoUtils.INSTANCE.addClassSuper(new ClassSuperInfo(name,superName,interfaces)); } } \ No newline at end of file diff --git a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/WovenInfoUtils.kt b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/WovenInfoUtils.kt index 00b9b836..804ad4a5 100644 --- a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/WovenInfoUtils.kt +++ b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/WovenInfoUtils.kt @@ -88,7 +88,7 @@ object WovenInfoUtils { fun isLeaf(className:String):Boolean{ for (classSuperInfo in classSuperList) { - if (classSuperInfo.superName == className || (classSuperInfo.interfaces.contains(className))){ + if (classSuperInfo.superName == className || (classSuperInfo.interfaces?.contains(className) == true)){ return false } }