update number 3

This commit is contained in:
2026-07-05 14:46:38 +02:00
parent b07b7855a1
commit 3988864494
2 changed files with 38 additions and 0 deletions

View File

@@ -69,6 +69,16 @@ public class StrictFqnMatchingEngine implements EventMatchingEngine {
if (!tConst.equals(smConst)) return false;
// Prevent matching string/primitive triggers to enum transitions
if (isStringTypeOrPrimitive(eventTypeFqn) && smEvent.contains(".")) {
return false;
}
// Prevent matching enum triggers to string transitions
if (!smEvent.contains(".") && triggerEvent.contains(".")) {
return false;
}
if (eventTypeFqn != null && eventTypeFqn.contains(".") && smEvent.contains(".")) {
String fullTriggerFqn = eventTypeFqn + "." + tConst;
return fullTriggerFqn.equals(smEvent);
@@ -85,6 +95,12 @@ public class StrictFqnMatchingEngine implements EventMatchingEngine {
return true;
}
private boolean isStringTypeOrPrimitive(String typeFqn) {
if (typeFqn == null) return false;
return typeFqn.equals("String") || typeFqn.equals("java.lang.String") ||
typeFqn.equals("int") || typeFqn.equals("long") || typeFqn.equals("char");
}
private boolean isWildcardVariable(String eventStr) {
if (eventStr == null) return false;