mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 16:53:04 +08:00
fix(framework): reject @Init methods with parameters during component validation
This commit is contained in:
@@ -24,6 +24,12 @@ class ComponentAnnotationValidatorFactory : AgentBaseFactory() {
|
|||||||
"${declaringClass.name}#${method.name}"
|
"${declaringClass.name}#${method.name}"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (method.parameterCount > 0) {
|
||||||
|
throw ModuleCheckException(
|
||||||
|
"@Init 标注的方法不能包含形参: " +
|
||||||
|
"${declaringClass.name}#${method.name}"
|
||||||
|
)
|
||||||
|
}
|
||||||
val methods = componentFactoryContext
|
val methods = componentFactoryContext
|
||||||
.initMethodsByDeclaringType
|
.initMethodsByDeclaringType
|
||||||
.getOrPut(declaringClass) { LinkedHashSet() }
|
.getOrPut(declaringClass) { LinkedHashSet() }
|
||||||
|
|||||||
Reference in New Issue
Block a user