singleton
singleton copied to clipboard
[BUG] [Java Client]Can't accept map key as c.b.d(dot in the key name) in Named arguments to format message.
Describe the bug Can't accept map key as a.b.c(dot in the key name) in Named arguments to format message. Can't get corresponding message if message like below: "messages.placeholder": "Messages {a}, {b} and {c.b.d} in source"
To Reproduce Steps to reproduce the behavior: 1. String msg = "信息 {a}, {b} 以及 {c.b.d} 在资源里"; Map<String, Object> msgargs1 = new HashMap<>(); msgargs1.put("a", "The 1st Message"); msgargs1.put("b", "信息二"); msgargs1.put("c.b.d", "The 3rd message");
FormatUtils.formatMsg(msg, ZHCN, msgargs1);
Expected behavior java.lang.IllegalArgumentException: Bad argument syntax: [at pattern index 16] "c.b.d} 在资源里"
According to ICU Syntax. dot is an invalid character for key. New Syntax - ICU - International Components for Unicode http://site.icu-project.org/design/formatting/messageformat/newsyntax
As Singleton Service supports the key to use dot, and the keys of some products that integrated with Singleton includes dot. If not support dot in Java client, it doesn't support backward compatibility for Singleton.