bedlaj commented on a change in pull request #4414:
URL: https://github.com/apache/camel/pull/4414#discussion_r502946987



##########
File path: 
core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
##########
@@ -551,6 +551,9 @@ protected boolean useIntrospectionOnEndpoint() {
      * @throws IllegalArgumentException if referenced object was not found in 
registry.
      */
     public <T> T resolveAndRemoveReferenceParameter(Map<String, Object> 
parameters, String key, Class<T> type, T defaultValue) {
+        if (parameters.get(key) != null && 
type.isInstance(parameters.get(key))) {

Review comment:
       Now, when is `getClass` removed, the null check is redundant, as 
`type.isInstance(null)` returns false. The condition can be simplified to `if 
(type.isInstance(parameters.get(key)))`. Previous comments about String beans 
and unit test are still unresolved.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to