Skip to content

Commit 6bcf71c

Browse files
committed
Fix Sonar smell in the RSocketInboundGatewayParser
1 parent bc9aa83 commit 6bcf71c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/config/RSocketInboundGatewayParser.java

+10-5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
package org.springframework.integration.rsocket.config;
1818

19+
import java.util.Arrays;
20+
import java.util.List;
21+
1922
import org.w3c.dom.Element;
2023

2124
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
@@ -31,18 +34,20 @@
3134
*/
3235
public class RSocketInboundGatewayParser extends AbstractInboundGatewayParser {
3336

37+
private static final List<String> NON_ELIGIBLE_ATTRIBUTES =
38+
Arrays.asList("path",
39+
"rsocket-strategies",
40+
"rsocket-connector",
41+
"request-element-type");
42+
3443
@Override
3544
protected Class<?> getBeanClass(Element element) {
3645
return RSocketInboundGateway.class;
3746
}
3847

3948
@Override
4049
protected boolean isEligibleAttribute(String attributeName) {
41-
return !attributeName.equals("path")
42-
&& !attributeName.equals("rsocket-strategies")
43-
&& !attributeName.equals("rsocket-connector")
44-
&& !attributeName.equals("request-element-type")
45-
&& super.isEligibleAttribute(attributeName);
50+
return !NON_ELIGIBLE_ATTRIBUTES.contains(attributeName) && super.isEligibleAttribute(attributeName);
4651
}
4752

4853
@Override

0 commit comments

Comments
 (0)