AnnJoy23 commented on code in PR #4341:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4341#discussion_r3578807092
##########
quarkus/extensions/kogito-quarkus-rules-extension/kogito-quarkus-rules/src/main/java/org/kie/kogito/core/rules/incubation/quarkus/support/StatefulRuleUnitServiceImpl.java:
##########
@@ -71,8 +75,12 @@ public MetaDataContext create(LocalId localId,
ExtendedReferenceContext extended
}
private Class<RuleUnitData> toClass(RuleUnitId ruleUnitId) {
+ String className = ruleUnitId.ruleUnitId();
+ if (!SAFE_CLASS_NAME.matcher(className).matches()) {
+ throw new IllegalArgumentException("Invalid rule unit class name:
" + className);
+ }
try {
- return (Class<RuleUnitData>)
Thread.currentThread().getContextClassLoader().loadClass(ruleUnitId.ruleUnitId());
+ return (Class<RuleUnitData>)
Thread.currentThread().getContextClassLoader().loadClass(className);
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
Review Comment:
Done.
included class name in ClassNotFoundException message in
StatefulRuleUnitServiceImpl
When loadClass() fails, the thrown IllegalArgumentException now includes
the class name in the message, consistent with RuleUnitServiceImpl.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]