CAMEL-24159: camel-azure-storage-datalake - Fix medium-severity bugs from code review#24871
Conversation
…from code review Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet
left a comment
There was a problem hiding this comment.
Claude Code on behalf of gnodet
Four clean fixes, all consistent with the patterns established across the azure PR series. This completes PR 5 of 5 for CAMEL-24159.
1. Credential override guard (DataLakeComponent.java)
The if (credentialType == null) guard wraps the entire auto-detection cascade (shared key → SAS → client secret), preventing any of it from running when the user explicitly set credentialType. Correct. ✅
2. Duplicate setRequestConditions (DataLakeFileOperations.java — upload)
Classic copy-paste error — .setRequestConditions() was called twice in the builder chain with the same argument. The second call silently overwrote the first. Removing the duplicate is correct. ✅
3. Null position NPE (DataLakeFileOperations.java — flushToFile)
position is Long (boxed). The expression position + fileClientWrapper.getFileSize() auto-unboxes, which NPEs when position is null. The ternary (position != null ? position : 0L) defaults to offset 0, which is the correct semantic — flush from the start of the appended data. ✅
4. Consumer downloadToFile — parent dirs + existing file
Same pattern as the blob PR (#24869): parentDir.mkdirs() for nested file names, delete() before re-download to prevent FileAlreadyExistsException on re-poll. ✅
LGTM ✅
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 9 tested, 29 compile-only — current: 9 all testedMaveniverse Scalpel detected 38 affected modules (current approach: 9).
|
Summary
Claude Code on behalf of davsclaus
Fixes 4 medium-severity findings in
camel-azure-storage-datalakefrom CAMEL-24159 code review:DataLakeComponent): wrap the auto-detection else branch withif (credentialType == null)so user-explicit credential type is not overridden when credential objects are found in the configuration.DataLakeFileOperations.upload()): remove the duplicate.setRequestConditions()call onFileParallelUploadOptions(copy-paste error).DataLakeFileOperations.flushToFile()): guard against nullposition(which isLongwith no default) before unboxing arithmetic withfileClientWrapper.getFileSize(). Defaults to 0 when null.DataLakeFileOperations.downloadToFile()): create parent directories before downloading (fixesNoSuchFileExceptionfor nested file names likedir/file.txt) and delete existing file first (fixesFileAlreadyExistsExceptionon re-poll).Test plan
cd components/camel-azure/camel-azure-storage-datalake && mvn clean installcredentialType🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com