Skip to content

Commit bdec457

Browse files
committed
Updates for code review
1 parent b9e5c5f commit bdec457

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

spring-integration-cassandra/src/main/java/org/springframework/integration/cassandra/config/xml/CassandraParserUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public static void processOutboundTypeAttributes(Element element, ParserContext
9292

9393
}
9494

95-
public static boolean areMutuallyExclusive(@Nullable String query, @Nullable BeanDefinition statementExpressionDef,
95+
public static boolean areMutuallyExclusive(String query, @Nullable BeanDefinition statementExpressionDef,
9696
String ingestQuery) {
9797

9898
return !StringUtils.hasText(query) && statementExpressionDef == null && !StringUtils.hasText(ingestQuery)

spring-integration-core/src/main/java/org/springframework/integration/config/xml/DefaultInboundChannelAdapterParser.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
public class DefaultInboundChannelAdapterParser extends AbstractPollingInboundChannelAdapterParser {
5050

5151
@Override
52-
protected @Nullable BeanMetadataElement parseSource(Element element, ParserContext parserContext) {
52+
protected BeanMetadataElement parseSource(Element element, ParserContext parserContext) {
5353
Object source = parserContext.extractSource(element);
5454
BeanMetadataElement result = null;
5555
BeanComponentDefinition innerBeanDef =
@@ -90,7 +90,6 @@ else if (hasScriptElement) {
9090
"Neither 'ref' and 'method' nor 'expression' are permitted when an inner script element is "
9191
+ "configured on element "
9292
+ IntegrationNamespaceUtils.createElementDescription(element) + ".", source);
93-
return null;
9493
}
9594
BeanDefinition scriptBeanDefinition = parserContext.getDelegate().parseCustomElement(Objects.requireNonNull(scriptElement));
9695
BeanDefinitionBuilder sourceBuilder = BeanDefinitionBuilder.genericBeanDefinition(
@@ -104,12 +103,10 @@ else if (hasExpression || hasExpressionElement) {
104103
parserContext.getReaderContext().error(
105104
"The 'ref' and 'method' attributes can't be used with 'expression' attribute or inner "
106105
+ "<expression>.", element);
107-
return null;
108106
}
109107
if (hasExpression & hasExpressionElement) {
110108
parserContext.getReaderContext().error(
111109
"Exactly one of the 'expression' attribute or inner <expression> is required.", element);
112-
return null;
113110
}
114111
result = parseExpression(expressionString, expressionElement, element, parserContext);
115112
}
@@ -122,7 +119,7 @@ else if (hasRef) {
122119
result = sourceValue;
123120
}
124121
}
125-
return result;
122+
return Objects.requireNonNull(result);
126123
}
127124

128125
private BeanMetadataElement parseMethodInvokingSource(BeanMetadataElement targetObject, String methodName,

spring-integration-core/src/test/java/org/springframework/integration/config/xml/EndpointRoleParserTests-context.xml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,30 @@
99
http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
1010
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">
1111

12-
<context:property-placeholder properties-ref="props"/>
12+
<context:property-placeholder properties-ref="props" />
1313

1414
<util:properties id="props">
1515
<prop key="cluster.1">cluster</prop>
1616
<prop key="cluster.2">cluster</prop>
1717
<prop key="cluster.3">clusterX</prop>
1818
</util:properties>
1919

20-
<int:inbound-channel-adapter id="in" channel="foo" expression="'foo'" role="cluster" auto-startup="false">
21-
<int:poller fixed-delay="60000"/>
20+
<int:inbound-channel-adapter id="in" channel="foo" expression="'foo'" role="cluster" auto-startup="false">
21+
<int:poller fixed-delay="60000" />
2222
</int:inbound-channel-adapter>
2323

24-
<int:channel id="foo"/>
24+
<int:channel id="foo" />
2525

26-
<int:outbound-channel-adapter id="out1" channel="foo" role="cluster" auto-startup="false" ref="sink" method="foo"/>
26+
<int:outbound-channel-adapter id="out1" channel="foo" role="cluster" auto-startup="false" ref="sink" method="foo" />
2727

28-
<int:outbound-channel-adapter id="out2" channel="foo" role="${cluster.1}" auto-startup="false" ref="sink"
29-
method="foo"/>
28+
<int:outbound-channel-adapter id="out2" channel="foo" role="${cluster.1}" auto-startup="false" ref="sink" method="foo" />
3029

31-
<int:outbound-channel-adapter id="out3" channel="foo" role="${cluster.2}" auto-startup="false" ref="sink"
32-
method="foo"/>
30+
<int:outbound-channel-adapter id="out3" channel="foo" role="${cluster.2}" auto-startup="false" ref="sink" method="foo" />
3331

34-
<int:outbound-channel-adapter id="out4" channel="foo" role="${cluster.3}" auto-startup="false" ref="sink"
35-
method="foo"/>
32+
<int:outbound-channel-adapter id="out4" channel="foo" role="${cluster.3}" auto-startup="false" ref="sink" method="foo" />
3633

37-
<bean id="sink" class="org.springframework.integration.config.xml.EndpointRoleParserTests$Sink"/>
34+
<bean id="sink" class="org.springframework.integration.config.xml.EndpointRoleParserTests$Sink" />
3835

39-
<int:bridge id="bridge" input-channel="foo" output-channel="nullChannel" role="cluster" auto-startup="false"/>
36+
<int:bridge id="bridge" input-channel="foo" output-channel="nullChannel" role="cluster" auto-startup="false" />
4037

41-
</beans>
38+
</beans>

0 commit comments

Comments
 (0)