onderson commented on a change in pull request #4307: URL: https://github.com/apache/camel/pull/4307#discussion_r495664499
########## File path: core/camel-health/src/main/java/org/apache/camel/impl/health/DefaultHealthCheckRegistry.java ########## @@ -166,66 +166,64 @@ private HealthCheckRepository resolveHealthCheckRepositoryById(String id) { @Override public boolean register(Object obj) { - boolean accept = obj instanceof HealthCheck || obj instanceof HealthCheckRepository; - if (!accept) { - throw new IllegalArgumentException(); - } + checkIfAccepted(obj); + + boolean result; Review comment: ```suggestion boolean result; ``` ########## File path: core/camel-health/src/main/java/org/apache/camel/impl/health/DefaultHealthCheckRegistry.java ########## @@ -166,66 +166,64 @@ private HealthCheckRepository resolveHealthCheckRepositoryById(String id) { @Override public boolean register(Object obj) { - boolean accept = obj instanceof HealthCheck || obj instanceof HealthCheckRepository; - if (!accept) { - throw new IllegalArgumentException(); - } + checkIfAccepted(obj); Review comment: ```suggestion boolean result; checkIfAccepted(obj); ``` ---------------------------------------------------------------- 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