Skip to content

Commit

Permalink
Merge pull request #87 from IceCream-QAQ/master
Browse files Browse the repository at this point in the history
1.0.0-DEV2
  • Loading branch information
IceCream-QAQ authored Jan 17, 2025
2 parents 0cad366 + b909a0d commit 1048b6e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -52,7 +52,7 @@ subprojects {
create<MavenPublication>(name) {
groupId = "com.IceCreamQAQ.Rain"
artifactId = name
version = "1.0.0-DEV1"
version = rootProject.version.toString()

pom {
name.set("Rain Java Dev Framework")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class SimpleCatchMethodInvoker<CTX : ActionContext>(
) : ProcessInvoker<CTX> {

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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ abstract class SimpleKJReflectMethodInvoker<CTX : ActionContext, ATT>(

val resultFlag = method.returnType.name != "void"

init {
open fun init(): ProcessInvoker<CTX> {
method.kotlinFunction?.let { kFun ->
var instanceParam: KParameter? = null
kFun.parameters.mapNotNull {
Expand Down Expand Up @@ -166,6 +166,7 @@ abstract class SimpleKJReflectMethodInvoker<CTX : ActionContext, ATT>(
}
}

return this
}

abstract fun initParam(method: Method, params: Array<MethodParam<ATT>>)
Expand Down
2 changes: 1 addition & 1 deletion module/job/src/main/kotlin/rain/job/JobCenter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class JobCenter(


override fun start() {
jobs.values.forEach { it.start() }
// jobs.values.forEach { it.start() }
}

override fun stop() {
Expand Down
2 changes: 1 addition & 1 deletion test/base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
13 changes: 11 additions & 2 deletions tools/function/src/main/kotlin/rain/function/asm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}


Expand Down

0 comments on commit 1048b6e

Please sign in to comment.