Simplifies redundant code constructs
@@ -107,21 +107,13 @@ public class MessageTypeSlipComputer implements InitializingBean, ApplicationCon
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
if (annotation == null || messageType == null || direction == null)
return false;
- if (messageType != null) {
- if (annotationFeatureMismatch(annotation, messageType.toString(), "messageType")) {
+ if (annotationFeatureMismatch(annotation, messageType.toString(), "messageType")
+ || annotationFeatureMismatch(annotation, direction.toString(), "direction")) {
return false;
}
- }
- if (direction != null) {
- if (annotationFeatureMismatch(annotation, direction.toString(), "direction")) {
+ if (facetType != null && annotationFeatureMismatch(annotation, facetType.toString(), "facetType")) {
return false;
}
- }
- if (facetType != null) {
- if (annotationFeatureMismatch(annotation, facetType.toString(), "facetType")) {
- return false;
- }
- }
return true;
}
