mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-06 10:45:47 +08:00
Fix bug when nameConditions not null by findFields, findMethods, findConstructors in ReflectionTool
This commit is contained in:
@@ -97,8 +97,10 @@ internal object ReflectionTool {
|
|||||||
rulesData: FieldRulesData
|
rulesData: FieldRulesData
|
||||||
): HashSet<Field> {
|
): HashSet<Field> {
|
||||||
if (rulesData.type == UndefinedType) error("Field match type class is not found")
|
if (rulesData.type == UndefinedType) error("Field match type class is not found")
|
||||||
if (orderIndex == null && matchIndex == null && rulesData.name.isBlank() && rulesData.modifiers == null && rulesData.type == null)
|
if (orderIndex == null && matchIndex == null &&
|
||||||
error("You must set a condition when finding a Field")
|
rulesData.name.isBlank() && rulesData.nameConditions == null &&
|
||||||
|
rulesData.modifiers == null && rulesData.type == null
|
||||||
|
) error("You must set a condition when finding a Field")
|
||||||
val hashCode = ("[$orderIndex][$matchIndex][${rulesData.name}][${rulesData.type}][${rulesData.modifiers}][$classSet]").hashCode()
|
val hashCode = ("[$orderIndex][$matchIndex][${rulesData.name}][${rulesData.type}][${rulesData.modifiers}][$classSet]").hashCode()
|
||||||
return ReflectsCacheStore.findFields(hashCode) ?: let {
|
return ReflectsCacheStore.findFields(hashCode) ?: let {
|
||||||
val fields = HashSet<Field>()
|
val fields = HashSet<Field>()
|
||||||
@@ -213,9 +215,10 @@ internal object ReflectionTool {
|
|||||||
rulesData.paramTypes?.takeIf { it.isNotEmpty() }
|
rulesData.paramTypes?.takeIf { it.isNotEmpty() }
|
||||||
?.forEachIndexed { p, it -> if (it == UndefinedType) error("Method match paramType[$p] class is not found") }
|
?.forEachIndexed { p, it -> if (it == UndefinedType) error("Method match paramType[$p] class is not found") }
|
||||||
if (orderIndex == null && matchIndex == null &&
|
if (orderIndex == null && matchIndex == null &&
|
||||||
rulesData.name.isBlank() && rulesData.modifiers == null &&
|
rulesData.name.isBlank() && rulesData.nameConditions == null &&
|
||||||
rulesData.paramCount < 0 && rulesData.paramCountRange.isEmpty() &&
|
rulesData.modifiers == null && rulesData.paramCount < 0 &&
|
||||||
rulesData.paramTypes == null && rulesData.returnType == null
|
rulesData.paramCountRange.isEmpty() && rulesData.paramTypes == null &&
|
||||||
|
rulesData.returnType == null
|
||||||
) error("You must set a condition when finding a Method")
|
) error("You must set a condition when finding a Method")
|
||||||
val hashCode =
|
val hashCode =
|
||||||
("[$orderIndex][$matchIndex][${rulesData.name}][${rulesData.paramCount}][${rulesData.paramTypes.typeOfString()}]" +
|
("[$orderIndex][$matchIndex][${rulesData.name}][${rulesData.paramCount}][${rulesData.paramTypes.typeOfString()}]" +
|
||||||
|
Reference in New Issue
Block a user