[CAMEL-22555] extra fixes for non-varargs call of varargs method with inexact argument type#22033
Conversation
|
/component-test coap geocoder bindy ehcache mina netty zookeeper |
|
✅
|
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
squakez
left a comment
There was a problem hiding this comment.
This problem won't be simply solved by cast forcing the varargs. For example, in the LOGGER.debug case:
LOGGER.debug("There are configured cipher suites: {}", getConfiguredCipherSuites());
the getConfiguredCipherSuites() returns an array of String. What you need to do is to convert the array into a single string probably. Casting is hiding the information that we're writing to the log instead.
8c9a084 to
ba55e0f
Compare
...indy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairFixTest.java
Outdated
Show resolved
Hide resolved
...ents/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheConsumerTest.java
Outdated
Show resolved
Hide resolved
...el-mina/src/test/java/org/apache/camel/component/mina/MinaInOutWithForcedNoResponseTest.java
Show resolved
Hide resolved
...el-mina/src/test/java/org/apache/camel/component/mina/MinaInOutWithForcedNoResponseTest.java
Show resolved
Hide resolved
...c/test/java/org/apache/camel/component/zookeeper/integration/ZooKeeperManagedEndpointIT.java
Outdated
Show resolved
Hide resolved
...rc/test/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/TraitHelperTest.java
Outdated
Show resolved
Hide resolved
dd3e7b5 to
4478bcb
Compare
gnodet
left a comment
There was a problem hiding this comment.
Good improvements after squakez's feedback — Arrays.toString() is the right approach for array logging.
One concern: the new expectedBodiesReceived(String[]) overload in MockEndpoint adds a new public API method that seems unnecessary. The varargs warning should be fixed at the call site (e.g., casting (Object[]) stringArray), not by adding a type-specific overload to the API. Otherwise, the same logic would apply for Integer[], byte[][], etc., leading to API bloat.
The rest of the changes look correct:
Arrays.toString()for array logging ✓constant((Object) null)for null disambiguation ✓- Removing explicit
nullargs for no-arg varargs calls ✓
|
@JinyuChen97 please, rebase with |
4478bcb to
1169cf7
Compare
components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
Outdated
Show resolved
Hide resolved
Noticed some improvement that should be applied.
… inexact argument type for last parameter https://issues.apache.org/jira/browse/CAMEL-22555
1169cf7 to
f2433c9
Compare
https://issues.apache.org/jira/browse/CAMEL-22555
try to fix more warning
impacted classes