update number 3
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user