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 2022/01/04 10:48:15 UTC

[GitHub] [camel] Croway opened a new pull request #6629: CAMEL-17373: Fix FhirComponent startup

Croway opened a new pull request #6629:
URL: https://github.com/apache/camel/pull/6629


   <!-- Uncomment and fill this section if your PR is not trivial
   - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
   Below are the contribution guidelines:
   https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel] davsclaus merged pull request #6629: CAMEL-17373: Fix FhirComponent startup

Posted by GitBox <gi...@apache.org>.
davsclaus merged pull request #6629:
URL: https://github.com/apache/camel/pull/6629


   


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel] Croway commented on a change in pull request #6629: CAMEL-17373: Fix FhirComponent startup

Posted by GitBox <gi...@apache.org>.
Croway commented on a change in pull request #6629:
URL: https://github.com/apache/camel/pull/6629#discussion_r778117928



##########
File path: components/camel-fhir/camel-fhir-component/src/main/java/org/apache/camel/component/fhir/FhirComponent.java
##########
@@ -45,18 +45,28 @@ protected FhirApiName getApiName(String apiNameStr) {
         return getCamelContext().getTypeConverter().convertTo(FhirApiName.class, apiNameStr);
     }
 
+    @Override
+    protected void afterPropertiesSet(FhirConfiguration endpointConfiguration) {
+        // ensure a client is set on the config
+        if (endpointConfiguration.getClient() == null && configuration.getClient() == null) {
+            if (configuration != null) {

Review comment:
       many thanks @orpiske ! actually no test were failing due to NPE, but I noticed that all tests were using a custom FhirComponent, if someone use the default one, NPE will happend, I just created a new test for this usecase FhirSimpleIT.java




-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel] orpiske commented on a change in pull request #6629: CAMEL-17373: Fix FhirComponent startup

Posted by GitBox <gi...@apache.org>.
orpiske commented on a change in pull request #6629:
URL: https://github.com/apache/camel/pull/6629#discussion_r778062454



##########
File path: components/camel-fhir/camel-fhir-component/src/main/java/org/apache/camel/component/fhir/FhirComponent.java
##########
@@ -45,18 +45,28 @@ protected FhirApiName getApiName(String apiNameStr) {
         return getCamelContext().getTypeConverter().convertTo(FhirApiName.class, apiNameStr);
     }
 
+    @Override
+    protected void afterPropertiesSet(FhirConfiguration endpointConfiguration) {
+        // ensure a client is set on the config
+        if (endpointConfiguration.getClient() == null && configuration.getClient() == null) {
+            if (configuration != null) {

Review comment:
       I apologize if I am missing context, but by looking at it, it seems that the `configuration` variable could be null. In which case, it would throw an NPE at line 51. Maybe it should fail right away by adding a pre-check with `ObjectHelper::notNull` ? 




-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel] orpiske commented on a change in pull request #6629: CAMEL-17373: Fix FhirComponent startup

Posted by GitBox <gi...@apache.org>.
orpiske commented on a change in pull request #6629:
URL: https://github.com/apache/camel/pull/6629#discussion_r778118738



##########
File path: components/camel-fhir/camel-fhir-component/src/main/java/org/apache/camel/component/fhir/FhirComponent.java
##########
@@ -45,18 +45,28 @@ protected FhirApiName getApiName(String apiNameStr) {
         return getCamelContext().getTypeConverter().convertTo(FhirApiName.class, apiNameStr);
     }
 
+    @Override
+    protected void afterPropertiesSet(FhirConfiguration endpointConfiguration) {
+        // ensure a client is set on the config
+        if (endpointConfiguration.getClient() == null && configuration.getClient() == null) {
+            if (configuration != null) {

Review comment:
       Thanks for double-checking.




-- 
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: commits-unsubscribe@camel.apache.org

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