File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
spring-integration-xml/src/main/java/org/springframework/integration/xml/router Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 2020import java .util .HashMap ;
2121import java .util .List ;
2222import java .util .Map ;
23+ import java .util .Objects ;
2324
2425import org .jspecify .annotations .Nullable ;
2526import org .w3c .dom .DOMException ;
4243 */
4344public class XPathRouter extends AbstractMappingMessageRouter {
4445
45- private final XPathExpression xPathExpression ;
46+ private final NodeMapper < Object > nodeMapper = new TextContentNodeMapper () ;
4647
47- private NodeMapper < Object > nodeMapper = new TextContentNodeMapper () ;
48+ private final XPathExpression xPathExpression ;
4849
4950 private XmlPayloadConverter converter = new DefaultXmlPayloadConverter ();
5051
@@ -116,7 +117,7 @@ public String getComponentType() {
116117 protected List <Object > getChannelKeys (Message <?> message ) {
117118 Node node = this .converter .convertToNode (message .getPayload ());
118119 if (this .evaluateAsString ) {
119- return Collections .singletonList (this .xPathExpression .evaluateAsString (node ));
120+ return Collections .singletonList (Objects . requireNonNull ( this .xPathExpression .evaluateAsString (node ) ));
120121 }
121122 else {
122123 return this .xPathExpression .evaluate (node , this .nodeMapper );
Original file line number Diff line number Diff line change 11/**
22 * Provides XML message routers.
33 */
4+ @ org .jspecify .annotations .NullMarked
45package org .springframework .integration .xml .router ;
You can’t perform that action at this time.
0 commit comments