Repository navigation
Conversation
AbstractConfig turns getter and setter names into property names with String.toLowerCase()/toUpperCase(), which follow the JVM default locale. Under a Turkish default locale "I" lowercases to a dotless "ı", so every property whose name starts with "i" was mangled: - appendParameters() wrote "ıothreads=8" instead of "iothreads=8" for ProtocolConfig#setIothreads (same for init, injvm, interface, ...). - refresh() looked up "dubbo.protocol.ıothreads", so dubbo.protocol.iothreads from system properties, dubbo.properties or the environment was silently ignored. Use Locale.ROOT in these helpers, as other parts of Dubbo already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 3.3 #16550 +/- ##
============================================
+ Coverage 60.90% 60.95% +0.05%
- Complexity 15 11754 +11739
============================================
Files 1953 1953
Lines 89280 89282 +2
Branches 13476 13477 +1
============================================
+ Hits 54376 54422 +46
+ Misses 29323 29268 -55
- Partials 5581 5592 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
EarthChen
left a comment
There was a problem hiding this comment.
The bug is real: under a Turkish-like default locale (tr, az), "Iothreads".substring(0, 1).toLowerCase() gives "ı", so keys such as iothreads are derived wrongly in appendParameters and refresh. The AbstractConfig changes and tests look correct, but the same root cause remains elsewhere, some of it worse:
AbstractConfigManager(~line 124):configModeStr.toUpperCase()turnsstrictintoSTRİCT, andConfigMode.valueOfthrows.ServiceConfig(~lines 1173/1182/1187): protocol nametriplebecomesTRİPLE.StringUtils(~lines 1005/1013/1056/1060):snakeToSplitName,isSnakeCase,toURLKey,toOSStyleKey.DubboBeanDefinitionParser(~lines 333/398):substring(3, 4).toLowerCase(), the same pattern as this PR.
Please cover these in this PR, or state in the description that the scope is AbstractConfig only and open a follow-up issue. (Line numbers are from a static review on 3.3.)
|
Thanks, good catch! Covered the four spots in b8a2927 (AbstractConfigManager, ServiceConfig, StringUtils, DubboBeanDefinitionParser), each with a tr-TR test. While grepping dubbo-common I also fixed the same getter/setter-name pattern in ReflectUtils, MethodUtils, PojoUtils, JavaBeanSerializeUtil, ExtensionLoader and EnvironmentAdapter. Left out on purpose: |
Per review: the same Turkish-locale problem as in AbstractConfig also broke config mode parsing (STRİCT), protocol names (TRİPLE), the StringUtils key helpers and DubboBeanDefinitionParser. Bean property, setter and extension names in ReflectUtils, MethodUtils, PojoUtils, JavaBeanSerializeUtil, ExtensionLoader and EnvironmentAdapter are fixed the same way. Each fixed path has a tr-TR test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ae133a7 to
b8a2927
Compare
What is the purpose of the change?
Several places turn identifiers and config keys into other forms with
toLowerCase()/toUpperCase(), which follow the JVM default locale. Under a Turkish default locale"I".toLowerCase()is a dotless"ı"and"i".toUpperCase()is a dotted"İ", so these keys get mangled. This PR usesLocale.ROOTin all of them, asEnvironmentConfiguration,FixedParamValueandSwitchLogLevelalready do:AbstractConfig: property names derived from getters/setters.appendParameters()wroteıothreads=8instead ofiothreads=8, andrefresh()looked updubbo.protocol.ıothreads, sodubbo.protocol.iothreadswas silently ignored.AbstractConfigManager:dubbo.config.mode=overridebecameOVERRİDE, soConfigMode.valueOfthrew and startup failed.ServiceConfig: protocoltrilooked upTRİ_DUBBO_PORT_TO_BIND/TRİ_DUBBO_IP_TO_BIND; also the random-port map keys.StringUtils:camelToSplitName,snakeToSplitName,isSnakeCase,toURLKey,toOSStyleKey(dubbo.protocol.iothreadsbecame env varDUBBO_PROTOCOL_İOTHREADS).DubboBeanDefinitionParser:setIothreads()mapped toıothreads, so theiothreadsXML attribute was ignored.ReflectUtils,MethodUtils,PojoUtils,JavaBeanSerializeUtil,ExtensionLoaderandEnvironmentAdapter(bean property, setter and extension names).Regression tests set the default locale to
tr-TR(inAbstractConfigTest,ConfigManagerTest,ServiceConfigTest,StringUtilsTest,DubboBeanDefinitionParserTest,ReflectUtilsTest,MethodUtilsTest,PojoUtilsTest,JavaBeanSerializeUtilTest). Each test fails without its source change and passes with it.ExtensionLoaderandEnvironmentAdapterhave no dedicated test; they are the same one-line change.I used Claude Code to write this change.
Checklist