package com.alibaba.json.bvt.bug;

import junit.framework.TestCase;

import com.alibaba.fastjson.JSON;

import java.util.Map;

public class Bug_for_Exception extends TestCase {
	public void test_exception() throws Exception {
		RuntimeException ex = new RuntimeException("e1");
		String text = JSON.toJSONString(ex);
		System.out.println(text);


		Object obj = JSON.parse(text);
		assertTrue(obj instanceof Map);

		RuntimeException ex2 = (RuntimeException) JSON.parseObject(text, Throwable.class);
	}
}

@@ -28,16 +28,56 @@
 t.bug;%0A%0A
+import com.alibaba.fastjson.JSONObject;%0A
 import j
@@ -425,37 +425,131 @@
 sert
-True(obj instanceof Map
+Equals(JSONObject.class, obj.getClass());%0A%0A%09%09Throwable throwable = JSON.parseObject(text, Throwable.class
 );%0A
-%0A
 %09%09
+assertEquals(
 Runt
@@ -564,72 +564,122 @@
 tion
- ex2 = (RuntimeException) JSON.parseObject(text, Throwable.c
+.class, throwable.getClass());%0A%0A%09%09Object obj2 = JSON.parse(text);%0A%09%09assertEquals(JSONObject.class, obj2.getC
 lass
+()
 );%0A%09

fix testcase