gnodet-bot commented on code in PR #27641:
URL: https://github.com/apache/camel/pull/27641#discussion_r4235576905
##########
components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java:
##########
@@ -297,6 +279,19 @@ public MyBatisEndpoint getEndpoint() {
return (MyBatisEndpoint) super.getEndpoint();
}
+ /**
+ * Iterates a collection, an iterator, a stream or an array of objects, to
run the statement once per element. Any
+ * other value is one parameter as-is: a Map, a String (which may contain
commas) and a primitive array (such as a
+ * byte[]).
+ */
+ private static Iterator<?> createIterator(Object in) {
+ if (in instanceof Map || in instanceof String
+ || in.getClass().isArray() &&
in.getClass().getComponentType().isPrimitive()) {
Review Comment:
💡 **Suggestion:** The `&&` operator binds tighter than `||`, so this
condition is technically correct — but adding explicit parentheses around the
`&&` sub-expression would make the precedence immediately obvious to future
readers:
```suggestion
if (in instanceof Map || in instanceof String
|| (in.getClass().isArray() &&
in.getClass().getComponentType().isPrimitive())) {
```
--
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]