diff --git a/build.gradle.kts b/build.gradle.kts index 0956582..52f71b8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,16 +1,16 @@ plugins { - java kotlin("jvm") version "2.0.10" + java `java-library` `maven-publish` } -val dependencyAsm by extra("9.3") -val dependencyFastJSON2 by extra("2.0.46") +val dependencyAsm by extra("9.7.1") +val dependencyFastJSON2 by extra("2.0.54") val dependencySlf4j by extra("2.0.9") group = "com.IceCreamQAQ.Rain" -version = "1.0.0-DEV1" +version = "1.0.0-DEV2" allprojects { repositories { @@ -52,7 +52,7 @@ subprojects { create(name) { groupId = "com.IceCreamQAQ.Rain" artifactId = name - version = "1.0.0-DEV1" + version = rootProject.version.toString() pom { name.set("Rain Java Dev Framework") diff --git a/enhance/classloader/src/main/kotlin/rain/classloader/enchant/EnchantManager.kt b/enhance/classloader/src/main/kotlin/rain/classloader/enchant/EnchantManager.kt index e2d26d9..6d1759f 100644 --- a/enhance/classloader/src/main/kotlin/rain/classloader/enchant/EnchantManager.kt +++ b/enhance/classloader/src/main/kotlin/rain/classloader/enchant/EnchantManager.kt @@ -12,7 +12,8 @@ class EnchantManager(private val classloader: IRainClassLoader) : ClassTransform for (annotation in node.visibleAnnotations) { val annotationClassName = annotation.desc.substring(1, annotation.desc.length - 1).replace("/", ".") - val annotationClass = classloader.forName(annotationClassName, false) + val annotationClass = + kotlin.runCatching { classloader.forName(annotationClassName, false) }.getOrNull() ?: continue val aa = annotationClass.annotations for (a in aa) { if (a is EnchantBy) { diff --git a/module/controller/src/main/kotlin/rain/controller/simple/SimpleCatchMethodInvoker.kt b/module/controller/src/main/kotlin/rain/controller/simple/SimpleCatchMethodInvoker.kt index 2de0b2a..9b07b1a 100644 --- a/module/controller/src/main/kotlin/rain/controller/simple/SimpleCatchMethodInvoker.kt +++ b/module/controller/src/main/kotlin/rain/controller/simple/SimpleCatchMethodInvoker.kt @@ -9,7 +9,7 @@ class SimpleCatchMethodInvoker( ) : ProcessInvoker { override suspend fun invoke(context: CTX): Any? { - if (context.runtimeError == null || errorType.isAssignableFrom(context.runtimeError!!::class.java)) return null + if (context.runtimeError == null || !errorType.isInstance(context.runtimeError)) return null return invoker.invoke(context) } diff --git a/module/controller/src/main/kotlin/rain/controller/simple/SimpleKJReflectMethodInvoker.kt b/module/controller/src/main/kotlin/rain/controller/simple/SimpleKJReflectMethodInvoker.kt index 3b5ce4e..ee229fa 100644 --- a/module/controller/src/main/kotlin/rain/controller/simple/SimpleKJReflectMethodInvoker.kt +++ b/module/controller/src/main/kotlin/rain/controller/simple/SimpleKJReflectMethodInvoker.kt @@ -116,7 +116,7 @@ abstract class SimpleKJReflectMethodInvoker( val resultFlag = method.returnType.name != "void" - init { + open fun init(): ProcessInvoker { method.kotlinFunction?.let { kFun -> var instanceParam: KParameter? = null kFun.parameters.mapNotNull { @@ -166,6 +166,7 @@ abstract class SimpleKJReflectMethodInvoker( } } + return this } abstract fun initParam(method: Method, params: Array>) diff --git a/module/job/src/main/kotlin/rain/job/JobCenter.kt b/module/job/src/main/kotlin/rain/job/JobCenter.kt index 100a686..f86ec48 100644 --- a/module/job/src/main/kotlin/rain/job/JobCenter.kt +++ b/module/job/src/main/kotlin/rain/job/JobCenter.kt @@ -31,7 +31,7 @@ class JobCenter( override fun start() { - jobs.values.forEach { it.start() } +// jobs.values.forEach { it.start() } } override fun stop() { diff --git a/test/base/build.gradle.kts b/test/base/build.gradle.kts index c462490..1dc70b0 100644 --- a/test/base/build.gradle.kts +++ b/test/base/build.gradle.kts @@ -3,6 +3,6 @@ plugins { } dependencies { - api("ch.qos.logback:logback-classic:1.3.14") + api("ch.qos.logback:logback-classic:1.3.15") api(project(":rain-test")) } \ No newline at end of file diff --git a/tools/function/src/main/kotlin/rain/function/asm.kt b/tools/function/src/main/kotlin/rain/function/asm.kt index 7907d9c..d077c26 100644 --- a/tools/function/src/main/kotlin/rain/function/asm.kt +++ b/tools/function/src/main/kotlin/rain/function/asm.kt @@ -25,6 +25,15 @@ fun getLoad(type: String): Int = else -> ALOAD } +fun getStore(type: String): Int = + when (type[0]) { + 'B', 'S', 'I', 'Z', 'C' -> ISTORE + 'J' -> LSTORE + 'F' -> FSTORE + 'D' -> DSTORE + else -> ASTORE + } + fun getReturn(type: String): Int = when (type[0]) { 'B', 'S', 'I', 'Z', 'C' -> IRETURN @@ -86,9 +95,9 @@ fun makeCast(mv: MethodVisitor, type: String) { fun getTypedWidth(type: String): Int = when (type[0]) { - 'B', 'S', 'I', 'Z', 'F', 'C' -> 1 +// 'B', 'S', 'I', 'Z', 'F', 'C' -> 1 'J', 'D' -> 2 - else -> ARETURN + else -> 1 }