ellepsis commented on a change in pull request #839:
URL: https://github.com/apache/cxf/pull/839#discussion_r698235537
##########
File path:
rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java
##########
@@ -107,20 +107,12 @@ public void handleMessage(Message m) throws Fault {
boolean supportsNode = this.supportsDataReader(message, Node.class);
Service service = ServiceModelUtil.getService(message.getExchange());
+
+ validateHeaders(message, headers, service);
+
for (SoapHeaderInfo header : headers) {
MessagePartInfo mpi = header.getPart();
- try {
- if
(ServiceUtils.isSchemaValidationEnabled(SchemaValidationType.IN, message)) {
Review comment:
I think that it would not make almost any difference. We are not using
any variables which are received in the main cycle (except `MessagePartInfo mpi
= header.getPart();`, but it is just a getter call). Besides code
style/structure, the only difference will be to get headers from `ArrayList`,
which highly likely will be cached in a CPU cache. From another side we
introducing additional checks for each iteration (hopefully will be optimized
by JIT). But anyway I believe that difference is so small for time spend to
further discussion)
I've pushed changes. Thank you for review!
Btw `schemaValidationEnabled && schema != null` could be simplified to
`schema != null`. But I agree, that with the `schemaValidationEnabled` flag
check, it's much more readable.
--
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]