-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config: Pattern converter error when Pattern used as key in Map to Nested Group #44805
Comments
/cc @radcortez (config) |
Our own key parser uses |
I'm not totally sure I follow: In both cases above I have used
and
The first case, the Pattern is parsed correctly, but second where the value of the map is a nested group, it does not. I can provide a reproducer, but if this is only supported by accident then I guess it won't really matter... |
Now I understand. An extra
Sorry for the noise. Btw, quarkus-config/smallrye config is great, and we use it extensively in our services. |
Yes, I'm sorry. I noticed that my comment was misleading. I did type Thank you very much for your feedback. Feel free to provide ideas or improvements :) |
Describe the bug
If I have the following code:
and application.properties
provider.tryg.info-mapping.Campervan\ \\d=CAMPERVAN
and change the
infoMapping()
Map toExpected behavior
Then if I iterate the
TrygConfiguration.infoMapping()
entrySet(), i.e.I'd expect
entry.getKey().matcher("Campervan 6").matches()
to return true in both cases.Actual behavior
However in the second case, it returns false, because the internal pattern of the converted java.util.regex.Pattern is
"Campervan d"
and not"Campervan \\d"
.I know it is somewhat weird to use Pattern as a key in a Map, as you may only retrieve it via iteration, but it made the corresponding configuration in the "application.properties" easier to write so that's why :)
How to Reproduce?
No response
Output of
uname -a
orver
Darwin CO-MBP-C02YL4N9LVCF-DK 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64 x86_64
Output of
java -version
openjdk version "21.0.5" 2024-10-15 LTS OpenJDK Runtime Environment Temurin-21.0.5+11 (build 21.0.5+11-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.5+11 (build 21.0.5+11-LTS, mixed mode)
Quarkus version or git rev
3.17.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: