You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/09/28 02:52:53 UTC

[GitHub] [camel] onderson commented on a change in pull request #4307: CAMEL-15585 - Camel Core health small refactor.

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:
users@infra.apache.org