HoussemNasri commented on code in PR #2412:
URL: https://github.com/apache/james-project/pull/2412#discussion_r1765247645


##########
mailet/amqp/src/main/java/org/apache/james/transport/mailets/AmqpForwardAttribute.java:
##########
@@ -183,6 +195,12 @@ String preInit(MailetConfig mailetConfig) throws 
MailetException {
             throw new MailetException("No value for " + EXCHANGE_PARAMETER_NAME
                     + " parameter was provided.");
         }
+        exchangeType = 
mailetConfig.getInitParameter(EXCHANGE_TYPE_PARAMETER_NAME);
+        if (StringUtils.isNotEmpty(exchangeType) && 
!VALIDATE_EXCHANGE_TYPES.contains(exchangeType)) {

Review Comment:
   This condition will evaluate to `false` if `exchangeType` is empty and thus 
the exception won't be thrown, empty doesn't seem like a valid value here. 
Maybe change the && to ||?
   
   If this was done on purpose to use the default exchange type when empty, I 
think this should be specified, preferably using a unit test.



-- 
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]

Reply via email to