Skip to content
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

GenericJSONConverter.json(Locale) will StackOverflowErro #908

Closed
wants to merge 1 commit into from

Conversation

takeseem
Copy link
Contributor

老项目有时候伤不起!依赖关系有时候太多了!

fix see #906,locale的字符串反序列化为Locale对象,我想应该是ok的

比如jackson的测试代码

public static void main(String[] args) throws IOException {
	ObjectMapper mapper = new ObjectMapper();
	String json = mapper.writeValueAsString(Locale.US);
	System.out.println(json);
	System.out.println(mapper.readValue(json, Locale.class));
}

@takeseem takeseem force-pushed the fix-issues-906 branch 2 times, most recently from 0d430a7 to 70532ff Compare November 23, 2017 03:38
@takeseem takeseem changed the title GenericJSONConverter.json(Locale) will StackOverflowError #906 GenericJSONConverter.json(Locale) will StackOverflowErro Nov 23, 2017
@chickenlj
Copy link
Contributor

I think you only fixed the serialize part, but ignored the deserialize part.

@takeseem
Copy link
Contributor Author

String -> Locale,确实没有测试。
jackson的Locale的序列化和反序列化,都是用的此字符串。除非dubbo内置的JSON本身就不支持Locale。

比如jackson的测试代码

public static void main(String[] args) throws IOException {
	ObjectMapper mapper = new ObjectMapper();
	String json = mapper.writeValueAsString(Locale.US);
	System.out.println(json);
	System.out.println(mapper.readValue(json, Locale.class));
}

@chickenlj
Copy link
Contributor

I have tested your code, but can not deserialize from the serialized string .

As JSON has been deprecated, i think we will not fix this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants