cloudinary_java icon indicating copy to clipboard operation
cloudinary_java copied to clipboard

`options` map modified directly

Open janosmeszaros opened this issue 7 months ago • 3 comments

Describe the bug in a sentence or two.

When passing in an immutable map to Uploader.uploadLarge it errors out because the method tries to update the same instance that was passed in to it. AFAICS, in most places a defensive copy is made from the options map, but not here. It caused issues for us as we are using the lib from Clojure interop, and by default, all the collections there are immutable.

Issue Type (Can be multiple)

[ ] Build - Can’t install or import the SDK [ ] Performance - Performance issues [x] Behaviour - Functions aren’t working as expected (Such as generate URL) [ ] Documentation - Inconsistency between the docs and behaviour [ ] Other (Specify)

Steps to reproduce

Use an immutable map as options for Uploader.uploadLarge when file is a java.util.File.

Versions and Libraries (fill in the version numbers)

Cloudinary Java SDK version - 1.39.0

janosmeszaros avatar Jul 17 '25 13:07 janosmeszaros

@janosmeszaros you are using quite an old version, can you please upgrade to the latest version (2.3.0) and let me know if the issue persists there?

tommyg-cld avatar Jul 21 '25 12:07 tommyg-cld

@tommyg-cld thanks for your reply. Let me try that, sure. But because the code path what causes the problem (see the link in the description) still exists on the master branch I'm pretty sure it's an issue on the latest version too.

janosmeszaros avatar Jul 21 '25 12:07 janosmeszaros

@janosmeszaros we've opened an internal bug for this so will keep you posted.

tommyg-cld avatar Jul 24 '25 10:07 tommyg-cld