micronaut-projects / micronaut-cache

This project includes caching support for Micronaut
Apache License 2.0
29 stars 31 forks source link

Hyphen keys are converted to camelCase with Caffeine Cache #810

Open dcalap opened 2 weeks ago

dcalap commented 2 weeks ago

Expected Behavior

When a Map with a String key that contains hyphen is cached (for instance "an-example"), when accessing through the cache, the key should be the same ("an-example").

Actual Behaviour

When a Map with a String key that contains hyphen is cached (for instance "an-example"), when accessing through the cache, the key is converted to camelCase ("anExample").

Steps To Reproduce

Download and run https://github.com/dcalap/micronaut-cache-bug

Perform a GET http://localhost:8080/cacheBug

The first time you will see an-id-with-hypen

Perform again a GET http://localhost:8080/cacheBug

The second time you will see anIdWithHypen

Environment Information

macOS, OpenJDK Runtime Environment Temurin-17.0.8.1+1 (build 17.0.8.1+1) Micronaut 4.6.2 with Java 17, Gradle, and Micronaut Caffeine Cache

Example Application

https://github.com/dcalap/micronaut-cache-bug

Version

4.6.2