You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class JSONTest {
@Test
public void testLocale() throws Exception {
Locale locale = Locale.US;
String result = JSON.json(locale);
//check JSON.json(Locale) into the dead loop
/**
java.lang.StackOverflowError
at java.lang.StringBuilder.append(StringBuilder.java:136)
at sun.util.locale.provider.LocaleResources.getLocaleName(LocaleResources.java:230)
at java.util.Locale.getDisplayName(Locale.java:1879)
at java.util.Locale.getDisplayName(Locale.java:1845)
at com.alibaba.dubbo.common.bytecode.Wrapper1.getPropertyValue(Wrapper1.java)
at com.alibaba.dubbo.common.json.GenericJSONConverter.writeValue(GenericJSONConverter.java:126)
at com.alibaba.dubbo.common.json.GenericJSONConverter.writeValue(GenericJSONConverter.java:73)
at com.alibaba.dubbo.common.json.GenericJSONConverter.writeValue(GenericJSONConverter.java:130)
at com.alibaba.dubbo.common.json.GenericJSONConverter.writeValue(GenericJSONConverter.java:73)
at com.alibaba.dubbo.common.json.GenericJSONConverter.writeValue(GenericJSONConverter.java:130)
at com.alibaba.dubbo.common.json.GenericJSONConverter.writeValue(GenericJSONConverter.java:73)
at com.alibaba.dubbo.common.json.GenericJSONConverter.writeValue(GenericJSONConverter.java:130)
*/
Assert.assertEquals(result, locale.toString());
}
The text was updated successfully, but these errors were encountered:
takeseem
added a commit
to takeseem-com/dubbo
that referenced
this issue
Mar 14, 2017
fix from dubbo:master, 2.5.7 : GenericJSONConverter主要是用在日志部分输出,所以当我们输出locale对象时就发生stack溢出。
java.lang.StackOverflowError
at com.alibaba.dubbo.common.json.JSONWriter.valueString(JSONWriter.java:189)
at com.alibaba.dubbo.common.json.GenericJSONConverter$7.encode(GenericJSONConverter.java:100)
at com.alibaba.dubbo.common.json.GenericJSONConverter.writeValue(GenericJSONConverter.java:338)
at com.alibaba.dubbo.common.json.GenericJSONConverter.writeValue(GenericJSONConverter.java:347)
at com.alibaba.dubbo.common.json.GenericJSONConverter.writeValue(GenericJSONConverter.java:395)
at com.alibaba.dubbo.common.json.GenericJSONConverter.writeValue(GenericJSONConverter.java:347)
at com.alibaba.dubbo.common.json.GenericJSONConverter.writeValue(GenericJSONConverter.java:395)
The text was updated successfully, but these errors were encountered: