Fix Return matching error details for incompatible property types
@@ -41,13 +41,19 @@ public class PropertyMatch extends AbstractMatcher<EventProperty, EventProperty>
}
if (!matchesType(offer, requirement)) {
+ buildErrorMessage(errorLog, "The required type " + requirement.getClass().getSimpleName() +
+ " is not present in the connected stream.");
+ return false;
+ } else {
+ if (isPrimitive(requirement)) {
+ return new PrimitivePropertyMatch().match(toPrimitive(offer), toPrimitive(requirement), errorLog);
+ } else if (isList(requirement)) {
+ return new ListPropertyMatch().match(toList(offer), toList(requirement), errorLog);
+ } else if (isNested(requirement)) {
+ return new NestedPropertyMatch().match(toNested(offer), toNested(requirement), errorLog);
+ } else {
return false;
}
- else {
- if (isPrimitive(requirement)) return new PrimitivePropertyMatch().match(toPrimitive(offer), toPrimitive(requirement), errorLog);
- else if (isList(requirement)) return new ListPropertyMatch().match(toList(offer), toList(requirement), errorLog);
- else if (isNested(requirement)) return new NestedPropertyMatch().match(toNested(offer), toNested(requirement), errorLog);
- else return false;
}
}
@@ -87,6 +93,4 @@ public class PropertyMatch extends AbstractMatcher<EventProperty, EventProperty>
}
-
-
}
