gnodet opened a new pull request, #31320:
URL: https://github.com/apache/camel/pull/31320

   ## Summary
   
   Fixes CAMEL-27968 - Multiple confirmed bugs in camel-dhis2:
   
   1. **Shadowed configuration field breaks client caching**: The 
`Dhis2Configuration configuration` field in `Dhis2Component` was shadowing the 
parent class field, making the client caching logic dead code. Removed the 
shadowing field to fix caching.
   
   2. **Missing baseApiUrl validation**: Added null checks for `baseApiUrl` 
before passing it to `Dhis2ClientBuilder.newClient()` to prevent NPEs.
   
   3. **queryParams hard-cast failures**: Changed from hard-casting `(String)` 
to using `String.valueOf()` for query parameter values, allowing Integer, 
Boolean, and other non-String types to be properly converted.
   
   4. **analytics() reliability issues**:
      - Restored interrupt flag when catching `InterruptedException`
      - Added null checks for response and taskId to prevent NPEs
      - Added null check for notification level before comparison
   
   ## Changes
   
   - `Dhis2Component.java`: Removed shadowing field declaration, added 
baseApiUrl validation
   - `Dhis2Get.java`, `Dhis2Post.java`, `Dhis2Put.java`, `Dhis2Delete.java`: 
Changed queryParams handling to use `String.valueOf()` instead of hard-casting
   - `Dhis2ResourceTables.java`: Added interrupt flag restoration and null 
checks in analytics()
   - `Dhis2ConfigurationTest.java`: Added tests for client caching and 
baseApiUrl validation
   
   ## Test plan
   
   - [x] Build succeeds: `mvn clean install -pl components/camel-dhis2 -am`
   - [x] All existing tests pass
   - [x] New tests added for configuration validation and client caching
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   _Claude Code on behalf of Guillaume Nodet_


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to